Page 1 of 1

btConvexTriangleMeshShape

Posted: Tue Jan 13, 2015 8:18 am
by lucky7456969
I am wondering which shapes to use for dynamic triangular meshes.
which has a motion state and affected by gravity.

I originally used btBvhTriangleMeshShape
But at runtime, it says it doesn't support dynamics.

So I switched to btConvexTriangleMeshShape
But it crashes at calculateLocalInertia

Code: Select all

inline void getNonvirtualAabb(const btTransform& trans,btVector3& aabbMin,btVector3& aabbMax, btScalar margin) const
	{

		//lazy evaluation of local aabb
		btAssert(m_isLocalAabbValid);
		btTransformAabb(m_localAabbMin,m_localAabbMax,margin,trans,aabbMin,aabbMax);
	}
So what happened?
Thanks
Jack

Re: btConvexTriangleMeshShape

Posted: Tue Jan 13, 2015 10:32 am
by xexuxjy
You most likely need to use the GImpact shapes instead. Have a look at that demo it should have what you need.

Re: btConvexTriangleMeshShape

Posted: Wed Jan 14, 2015 5:31 am
by tmason
btBvhTriangleMeshShape and btConvexTriangleMeshShape objects are designed to be non-moving in the Bullet physics world and thus won't have an inertia; the calculateLocalInertia() call fails by design.

As mentioned by xexuxjy you need to use objects specifically designed to be dynamic.