GLBasic forum

Main forum => GLBasic - en => Topic started by: djtoon on 2012-May-09

Title: AC3D TO BOX2D LIB
Post by: djtoon on 2012-May-09
hi
im creating a glb function to read vertex points from vrml1 that i export from ac3d

for some reson i cant get the thing to work
here is the lib
test it and maybe fix and share :)
10x


[attachment deleted by admin]
Title: Re: AC3D TO BOX2D LIB
Post by: Kitty Hello on 2012-May-09
Oh no.
The Box2D version crashes internally. And I can't reproduce it with visual studio.
In Common/BlockAllocator.cpp repleace these 2 functions.

Code (glbasic) Select

void* b2BlockAllocator::Allocate(int32 size)
{
return (void*) new char[size];
}

void b2BlockAllocator::Free(void* p, int32 size)
{
if (size == 0)
{
return;
}
delete [] p;
return;
}


It does not crash then. Maybe a new version of Box2D has fixed this issue?
Title: Re: AC3D TO BOX2D LIB
Post by: djtoon on 2012-May-09
that fix't it :)
10x kitty
Title: Re: AC3D TO BOX2D LIB
Post by: djtoon on 2012-May-09
heres the working version


[attachment deleted by admin]
Title: Re: AC3D TO BOX2D LIB
Post by: djtoon on 2012-May-09
the polys seem to be transparent ( object dont collide with them) any idea why?
Title: Re: AC3D TO BOX2D LIB
Post by: Kitty Hello on 2012-May-09
Maybe you did (not) include the last point the same as the first?
No idea :(
Title: Re: AC3D TO BOX2D LIB
Post by: djtoon on 2012-May-10
its ok its just the covent vs concave polys in box2d :)
it works ok
10x