btConvexHullShape ::btConvexHullShape

sparkprime
Posts: 508
Joined: Fri May 30, 2008 2:51 am
Location: Ossining, New York

btConvexHullShape ::btConvexHullShape

Post by sparkprime »

Why does btConvexHullShape ::btConvexHullShape take a btScalar* when internally it casts the data to btPoint3 objects? I just ran into a problem where btPoint3 is actually 16 bytes wide but i was feeding in an array of btScalars with a stride of 12.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: btConvexHullShape ::btConvexHullShape

Post by Erwin Coumans »

The btConvexHullShape uses a default stride of 16 bytes between vertices. If your stride is different, like 12 bytes, please pass the actual stride as 3rd argument. From btConvexHullShape.h:

Code: Select all

        ///btConvexHullShape make an internal copy of the points.
        btConvexHullShape(const btScalar* points=0,int numPoints=0, int stride=sizeof(btPoint3));
Alternatively you can use the btConvexTriangleMeshShape, and pass in a btStridingMeshInterface.
Hope this helps,
Erwin