Page 1 of 1

Wrapper class, am I doing anything wrong?

Posted: Mon Jan 21, 2008 2:51 am
by Osami
Below is a simple wrapper class I am making so that I can easly create objects. Currently I can Initilize bullet, create and draw box's, spheres, and triangle meshes. Before I work on this anymore ( currently it will do most of the things I need it to do ) I would like to know how my code is. Is there anything I am missing or that I might find useful to add?

Also why is it that I get a error when trying to find the local inertia for triangle meshes, also when setting the meshes's mass to anything other then 0 why does everything fall threw it.

Thanks.

Re: Wrapper class, am I doing anything wrong?

Posted: Mon Jan 21, 2008 8:18 pm
by Osami
Does anyone know how to properly add to a triangle mesh that has already been added to the world. Found out that the addTrianglesToMesh and updateMesh functions dont really work :S.. I have the drawing ofcouse but the collision body isnt updated, or something...

Re: Wrapper class, am I doing anything wrong?

Posted: Wed Jan 23, 2008 12:00 am
by Erwin Coumans
Also why is it that I get a error when trying to find the local inertia for triangle meshes, also when setting the meshes's mass to anything other then 0 why does everything fall threw it.
btBvhTriangleMeshShape is only for static, non-moving, non-dynamic objects with mass zero. If you want to use moving objects, you can better approximate the shape using a btConvexHullShape, or btCompoundShape with multiple simple shapes. Alternatively use btGimpactMeshShape, see MovingConcaveDemo how to use this.
Osami wrote:Does anyone know how to properly add to a triangle mesh that has already been added to the world. Found out that the addTrianglesToMesh and updateMesh functions dont really work :S.. I have the drawing ofcouse but the collision body isnt updated, or something...
You cannot add triangles to it, after construction.

Hope this helps,
Erwin