[newbie] Opengl - btshape size

codemaster
Posts: 4
Joined: Wed Jan 27, 2010 1:54 pm
Location: Poland

[newbie] Opengl - btshape size

Post by codemaster »

First of all,
hello to all of you maniacs :)

I have defined :

Code: Select all

SHAPE_box = new btBoxShape(btVector3(1,1,1));
this shape would be used globally as a box falling down from the sky onto a floor platform.

The question is - knowing the dimension of the SHAPE_box now, can i somehow obtain that size later on in the program so my GL code currently:

Code: Select all

glPushMaitrx();
...
glScalef(1,1,1);
auxSolidCube(1);
glPopMatrix();
could look as follows:

Code: Select all

glScalef(SHAPE_box.size_x,SHAPE_box.size_y,SHAPE_box.sizez);
auxSolidCube(1);
?

This would be v.helpfull, is it possible to get the size of a btshape somewhere in program?
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: [newbie] Opengl - btshape size

Post by Erwin Coumans »

For a btBoxShape you can use boxShape->getHalfExtentsWithMargin().

Hope this helps,
Erwin
codemaster
Posts: 4
Joined: Wed Jan 27, 2010 1:54 pm
Location: Poland

Re: [newbie] Opengl - btshape size

Post by codemaster »

Erwin,
much much appreciated.

Best regards from a freezing Poland :)