Scene + Objects = No Movement & Scene Collision Body

batnom

12-10-2008 06:26:37

I have loaded a scene and placed some objects in it (ranging from a ball to a simple vehicle) but when in the scene they don't move.. at all. It's like they're not getting updated or something.

However, when I make them start below the scene the balls bounce and the car spasms out (as there's no real floor I assume).

I have debugged and the code is getting run to change things but it's just not showing.


I also need to somehow get the scene to act as a collision body for when the car does move it lands on it instead of going straight through it.


Any help on any of the above would be excellent if you can spare the time :)


edit\
It seems to be an issue with the scale, making progress!

Still need a way to make collision bodies of everything in the scene though =/

edit 2\
Nope, still seems to be stuck.. as if it's suspended there and cannot move.. when it's in the ogremax scene world..

edit3\
Getting there, just need to work out correct scale for meshes woot!

Ultima2876

12-10-2008 13:53:36

You should set the world size. Anything outside the "world" doesn't get processed, and will just seem to be frozen - you set the world size by using:

mWorld = new OgreNewt::World();
AxisAlignedBox physicsBox(Vector3(-700, -700, -700), Vector3(700, 700, 700));
mWorld->setWorldSize(physicsBox);


That code, for example, creates a world that ranges from -700, -700, -700 to 700, 700, 700 (so it's 1400x1400x1400 centered around 0, 0, 0.)

batnom

12-10-2008 18:43:35

Thanks for that Ultima2876.

Anyone have any ideas on how to make a scene a collision body without defining each mesh manually?

micken

14-10-2008 17:37:05

Thanks for that Ultima2876.

Anyone have any ideas on how to make a scene a collision body without defining each mesh manually?


I've used OgreMax with 3d studio max to create a .scene file and linked all of the geometry in my level that I want to be static to a single node. Then after loading the scene file with OgreMax I use a TreeCollisionSceneParser to create static TreeCollision geometry for that node and all of it's children. This only works for static geometry however. If you're not using max then you can create something else that will load all of the meshes that you want to be static and make them children of a single node so that OgreNewt can create a TreeCollision from it.