Get Moved Vertices from a btConvexHullShape? [HELP]

Post Reply
johnsonalpha
Posts: 73
Joined: Fri May 01, 2015 8:23 pm

Get Moved Vertices from a btConvexHullShape? [HELP]

Post by johnsonalpha »

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! :)
User avatar
drleviathan
Posts: 849
Joined: Tue Sep 30, 2014 6:03 pm
Location: San Francisco

Re: Get Moved Vertices from a btConvexHullShape? [HELP]

Post by drleviathan »

After reading the btConvexHullShape API I would guess the code you want might look something like 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 ...
}
Note: I have not compiled or tested this.
Post Reply