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!
Isolating vertex of rigid body cube
-
- Posts: 48
- Joined: Thu Dec 12, 2013 4:04 pm
Re: Isolating vertex of rigid body cube
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.
-
- Posts: 18
- Joined: Thu Mar 22, 2012 9:29 am
Re: Isolating vertex of rigid body cube
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);
btVector3 VertexPosition = Cube.getWorldTransform()*btVector3( CubeSize/2, CubeSize/2, CubeSize/2);