Physics Simulation Forum

 

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Thu Nov 30, 2006 5:13 am 
Offline

Joined: Wed Nov 29, 2006 9:27 am
Posts: 12
I'm wanting to make a class to encapsulate a physics "object" (body and shape) and visual (irrlicht scene node)

When creating my object with ODE I pass a flag which identifies the "type" of object and from the other parameters, scale and so forth I can create my new object.
Now I'm using bullet I'm having to rewrite sections of the class

Do I need a separate shape per object if they are different sizes?

or is there some way the body can apply different scales to the same
shape object?

Is there a general purpose shape pointer or should I just use a void pointer for the objects shape and cast to btConeShape or whatever my object type flag indicates, if I need it later...

btw wheres the common code for the demos hide...


Top
 Profile  
 
PostPosted: Thu Nov 30, 2006 6:10 am 
Offline
Site Admin
User avatar

Joined: Sun Jun 26, 2005 6:43 pm
Posts: 3744
Location: California, USA
ChrisC wrote:
I'm wanting to make a class to encapsulate a physics "object" (body and shape) and visual (irrlicht scene node)
When creating my object with ODE I pass a flag which identifies the "type" of object and from the other parameters, scale and so forth I can create my new object.
Now I'm using bullet I'm having to rewrite sections of the class
Do I need a separate shape per object if they are different sizes?
or is there some way the body can apply different scales to the same
shape object?

All collision shapes in Bullet are derived from one base class, btCollisionShapes. You can get the type using getShapeType(). The local scaling is stored in the collision shapes, so for primitive shapes like box, sphere, cone, cylinder, capsule (= btMultisphereShape with 2 spheres) you need the same scaling to share.

For convex and concave triangle meshes, Bullet allows to share the mesh data among different collision shapes. Also, you can share the graphics mesh data for collision detection by indexing.

You can find more info by studying the demos, and Bullet_User_Manual.pdf. See also the Bullet/Demos/OpenGL/DemoApplication.cpp.
Erwin


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 30, 2006 11:53 am 
Offline

Joined: Wed Nov 29, 2006 9:27 am
Posts: 12
Thanks thats a little clearer!

The manual is a little slim and bereft of description about basic concepts, the api docs are good but theres little discussion about correct use of the api

many things like a discussion of the last parameter of btStaticPlaneShape for example are missing

The manual could really do with expanding with extra advice about how the api is intended to be used and what things to avoid.

This from the perspective of a new user is the only thing missing from this fantastic piece of work.

Please keep up the good work and take this in the spirit it was intended!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group