Page 1 of 1

Isolating vertex of rigid body cube

Posted: Tue Apr 15, 2014 2:02 pm
by b3nk0
Hello, I'm new to Bullet and c++ and I'm trying to output the location of each vertex of the rigid body cube btBoxShape as it falls and bounces. How would I go about doing this? Is this even possible with this shape?

Thanks!

Re: Isolating vertex of rigid body cube

Posted: Fri Apr 18, 2014 2:03 pm
by bwelch
Seems like there would be an easy way to grab that from Bullet, but I don't know of a way. If you know the dimensions of the cube, you can get the position of the cube and the orientation and use those to determine the vertices, I suppose.

Re: Isolating vertex of rigid body cube

Posted: Thu Apr 24, 2014 10:29 am
by billias13
Just get the transformation matrix of the cube ( getWorldTransform() ) and multiply it with the vector that describes the local coordinates of each vertex. For example :

btVector3 VertexPosition = Cube.getWorldTransform()*btVector3( CubeSize/2, CubeSize/2, CubeSize/2);