i'm talking about that the free pascal header has a wrong pointer datatype - that has nothing to do with a floating point exception!!!! i changed the header so that it works and if someone wants to update the official headers, too, he can do it.
back to topic: if anyone wants to see the result just watch this:
i'm using the naive idea that every voxel is a convex hull of 8 points and each 8x8x8 voxels are joined into one compound collision. (and 8x8x8 blocks are updated together)
the total memory of the engine is 12.5 MB in the GUI and about 50 MB while playing
In my older experiments, the auto inertia calculation failed, but now it looks pretty good.
Carli wrote:i'm talking about that the free pascal header has a wrong pointer datatype - that has nothing to do with a floating point exception!!!! i changed the header so that it works and if someone wants to update the official headers, too, he can do it.
By Free Pascal Header do you mean This(Its not a "Free Pascal Header" but a Pascal Header(Difference is that its designed for both Delphi and Free Pascal)? I don't see whats different between your version and the official version except that your doing Bla = ^Pointer; PBla = ^Bla; where PBla should just be the same data type as Bla and that your removing the array.
Maybe we could set the current header into a repository for that everyone can add fixes or updates and I even can have the latest version of it as a subrepos of my project. (i'm using mercurial hg version control)
That would be over the top in my oppinion. For a project, version control may be needed. But for a header, there wouldn't be any benefit. You can just run a Diff program manualy to see what the changes were.
Stucuk wrote:By Free Pascal Header do you mean This(Its not a "Free Pascal Header" but a Pascal Header(Difference is that its designed for both Delphi and Free Pascal)? I don't see whats different between your version and the official version except that your doing Bla = ^Pointer; PBla = ^Bla; where PBla should just be the same data type as Bla and that your removing the array.
How is that an error? Also as i keep saying how does doing ^PNewtonCollision help? PNewtonCollision is already set to ^Pointer, so doing ^ to the PNewtonCollision will not be any different than using the PNewtonCollision. People have used Free Pascal with the header without getting errors, so it sounds to me just like you havn't got the right compiler options set.
you can even cast a "array of PNewtonCollision" into a "^PNewtonCollision" with the @ operator but it's an eyesore if some things do not work in objfpc mode.
Things should be uniform, while i know not everything in the header is(Since some of the code that came from the 1.53 version was never modified like the one you mention). Any changes should be the same as whats done in other parts of the header. PNewtonCollision should be used in favor over arrays rather than ^PNewtonCollision which is considered a different type.
function NewtonCreateCompoundCollision (const newtonWorld: PNewtonWorld; count: integer; const collisionPrimitiveArray: array of PNewtonCollision; shapeid: integer): PNewtonCollision; cdecl; external newtondll;
I swear that array of there works with fpc 2.2.4 on win32, i'm using it myself in my game and it works properly with compoundarray[0] or directly compoundarray, the array is constant length, but if you use dynamic you need to use [0].
Delfi wrote:I swear that array of there works with fpc 2.2.4 on win32, i'm using it myself in my game and it works properly with compoundarray[0] or directly compoundarray, the array is constant length, but if you use dynamic you need to use [0].
And I say that it does not work with FPC 2.4.0 on win32 and linux64. I'm using it myself in my game and the "array of" crashes because of: