Get Moved Vertices from a btConvexHullShape? [HELP]
-
- Posts: 73
- Joined: Fri May 01, 2015 8:23 pm
Get Moved Vertices from a btConvexHullShape? [HELP]
Im trying to access each vertex of a btConvexHullShape that being simulated how can i access these vertices with the rigidbody transform applied to them?! If you have any suggestions anything will help!
- drleviathan
- Posts: 849
- Joined: Tue Sep 30, 2014 6:03 pm
- Location: San Francisco
Re: Get Moved Vertices from a btConvexHullShape? [HELP]
After reading the btConvexHullShape API I would guess the code you want might look something like this:
Note: I have not compiled or tested this.
Code: Select all
const btTransform& transform = body->getWorldTransform();
int numPoints = hullShape->getNumPoints();
for (int i = 0; i < numPoints; ++i)
{
btVector transformedPoint = transform * hullShape->getScaledPoint(i);
//... your custom code here ...
}