Problem about moving code from ODE to OgreODE

blackgun

10-08-2007 06:31:13

I plan to move the code from ODE to OgreODE.

I understand this way:
It creates ogre entity, node, and a ODE body, then tranfer the ode.body's position and rotation to ogre.node. at last do "world.step". That works.

but I didn't find the code binding ogre.node with ode.body from OgreODE demos.

i don't know how the ode.body's postion and rotation transfer to ogre.node and i didn't find the "world.step". I remember OgreNewton has a "BasicFrameListener" do some similar "world.step" job.

what did i miss?

rewb0rn

10-08-2007 10:34:26

call the attach method of the node to attach the body to it, use steppers to step through the simulation, there are 3 afaik, try out exactvariableframestepper first.

blackgun

10-08-2007 11:47:31

so , when a node attach a body , the body control the body movement? but a parent node A attach body A, a child node B attach body B. node B will move as same as body B, node A will do nothing to node B?
if a node attach two different body, what will happen?

rewb0rn

10-08-2007 17:46:53

1) yes, there will most probably be no interaction between node a and node b, the bodies control all the movement, and even explicit position changes at the nodes will have no effect.
2)i dont know, try out.

blackgun

11-08-2007 04:46:17

I guess these code is what you said steppers
switch(_stepper_mode_choice)
{
case 0: stepModeType = StepHandler::BasicStep; break;
case 1: stepModeType = StepHandler::FastStep; break;
case 2: stepModeType = StepHandler::QuickStep; break;

default: stepModeType = StepHandler::QuickStep; break;
}

switch (_stepper_choice)
{
case 0:
_stepper = new OgreOde::StepHandler(_world,
StepHandler::QuickStep,
time_step,
max_frame_time,
time_scale);

break;
case 1:
_stepper = new OgreOde::ExactVariableStepHandler(_world,
stepModeType,
time_step,
max_frame_time,
time_scale);

break;
case 2:
_stepper = new OgreOde::ForwardFixedStepHandler(_world,
stepModeType,
time_step,
max_frame_time,
time_scale);

break;
case 3:
default:
_stepper = new OgreOde::ForwardFixedInterpolatedStepHandler (_world,
stepModeType,
time_step,
frame_rate,
max_frame_time,
time_scale);
break;
}

_stepper->setAutomatic(OgreOde::StepHandler::AutoMode_PostFrame, root);


but i can't find these keywords in ODE API:
StepHandler
ExactVariableStepHandler
ForwardFixedInterpolatedStepHandler
setAutomatic
...


is there some OgreODE's tutorial or manual ?
And what's the advantage of OgreODE vs ODE? OgreODE's demo code looks very strange for me.
And the website said OgreODE lastest release time is Jan,2006. is OgreODE support ODE 0.8?

rewb0rn

11-08-2007 15:55:51

well ogreode is not developed any further at the moment, only maintained for the latest ode and ogre versions. the stephandlers are not in the api because they have been added later i think. the latest ogreode version is on the cvs, the sdk on the page is outdated, you should not use it. there are only a few tutorials on the ogre wiki, but the demo codes are easy to understand i think. the advantage of ogreode is, that you do not have to tell ode the information about model geometries etc yourself, this will be done by ogreode, so you do not need to go through every single model to get the vertex data to tell ode. on the other hand ogreode will automatically update your nodes, again something you do not need to do yourself then.