Wrapper class, am I doing anything wrong?

Osami
Posts: 5
Joined: Thu Jan 17, 2008 8:51 pm

Wrapper class, am I doing anything wrong?

Post 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.
You do not have the required permissions to view the files attached to this post.
Osami
Posts: 5
Joined: Thu Jan 17, 2008 8:51 pm

Re: Wrapper class, am I doing anything wrong?

Post 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...
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Wrapper class, am I doing anything wrong?

Post 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