Static Geometry and Collision Bodies

goldman82

01-09-2007 22:45:02

hi,

i have build some static geometries in my ogre project. these "new" object are not connected to any scenenode.
how can i now build a collision body from this? TreeCollision needs a scenenode, right? but i dont have one :?

what can i do?

thanks
goldman82

Bren

02-09-2007 19:30:06

TreeCollision is just a helper function to convert ogre mesh data into a Newton collision object.

So you could go into the function and rip out the parts you need, eliminating the need for a SceneNode.

You could also temporarily create an entity and attach it to a SceneNode, create your collision, then remove/destroy the SceneNode.

Considering that you are creating a StaticGeometry, I would suggest you create an Entity/SceneNode, use that SceneNode to create your collision, then convert that SceneNode to a StaticGeometry.

walaber

03-09-2007 03:01:17

there are several constructors for TreeCollision, some that just take arrays of vertices and indices, you can use that version with data from your static object.

treecollision also supports manual creation, by adding the polygons individually. have a look at the class documentation, you should see what I'm talking about.