Mulitple Worlds

OvermindDL1

07-03-2006 03:32:05

I have something that is very large, and spans multiple scene managers, but will all need physics (each physics world will actually have rather few objects overall) updated. Let's say I have something like this:

sceneManager0

sceneManager1
- NewtonWorld0 - centered at (0,0,0) in the Ogre World
- NewtonWorld1 - centered at (0,30000,0) in the Ogre World

sceneManager2
- NewtonWorld2 - centered at (0,0,0) in the Ogre World
- NewtonWorld3 - centered at (20000,0,18000) in the Ogre
- NewtonWorld3 - centered at (20000,0,18000) in the Ogre World


Each newton world in the graphical world is centered in a way to keep floating point errors at a minimum (center of action), plus one centered at the graphical origin that handles all other bodies that are not in one of the sub-worlds. Putting them on multiple scene managers while keeping seperate seems simple enough, what about positioning inside the graphical system, some of these will be much further then what is exampled above, to the point graphical accuracy may suffer (not noticably hopefully), but physics must not.

So, basic question, how do I have an OgreNewt::World centred at a position other then the origin for when it moves the Ogre::Node? Should I just have it not hook a node and just do it manually, and if so, is there a nice interface for moving things manually, and not worrying about it when things don't move?

EDIT: While I'm at it, shouldn't OgreNewt::MomentOfInertia::CalcSphereHollor be called OgreNewt::MomentOfInertia::CalcSphereHollow?

walaber

07-03-2006 05:28:24

you might want to add an offset internally... then use a custom "transformCallback". Newton passes you the position of the body (and its orientation) here. then you can apply the offset, and position the Ogre object (SceneNode) after that. the callback is great because Newton only calls it when the body has moved.

OvermindDL1

07-03-2006 10:37:00

Wonderfully perfect, just what I was looking for. Will delve into it after I get some sleep (*yawn*, going on 36 hours now... classes in 3 hours, need some sleep....)