Author Topic: Box2d Kinematic body How to ...  (Read 2185 times)

Offline siatek

  • Mr. Drawsprite
  • **
  • Posts: 58
    • View Profile
Box2d Kinematic body How to ...
« on: 2012-Jul-18 »
Hi

I'm add this to a wrapper but it's doesn't working ... there is no "type" member it saying ... but in box2d documentation it written that this shoud work :/ (def.type = b2_kinematicBody;)

anybody could help ??

regards

Code: (glbasic) [Select]
FUNCTION b_CreateKinematicPoly_ext: x, y, friction, pts[]

INLINE
b2BodyDef def;
def.type = b2_kinematicBody;
def.position.Set((float)x, (float)y);

b2Body* kinematic = bWorld->CreateBody(&def);

b2PolygonDef kinematicshapedef;
kinematicshapedef.vertexCount = LEN(pts);
for(int i=0; i<LEN(pts); ++i)
{
kinematicshapedef.vertices[i] = b2Vec2(pts(i,0), pts(i,1));
}

kinematicshapedef.friction = friction;
kinematic->CreateShape(&kinematicshapedef);
return b_NewObject(kinematic,bBody);
ENDINLINE

ENDFUNCTION
glbasic roxx !!!

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10728
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Box2d Kinematic body How to ...
« Reply #1 on: 2012-Jul-18 »
Maybe our box2d source is too old?

Offline siatek

  • Mr. Drawsprite
  • **
  • Posts: 58
    • View Profile
Re: Box2d Kinematic body How to ...
« Reply #2 on: 2012-Jul-19 »
Yes it is :)
Thanks
glbasic roxx !!!