Isolating vertex of rigid body cube

Post Reply
b3nk0
Posts: 1
Joined: Mon Apr 14, 2014 3:37 pm

Isolating vertex of rigid body cube

Post 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!
bwelch
Posts: 48
Joined: Thu Dec 12, 2013 4:04 pm

Re: Isolating vertex of rigid body cube

Post 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.
billias13
Posts: 18
Joined: Thu Mar 22, 2012 9:29 am

Re: Isolating vertex of rigid body cube

Post 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);
Post Reply