OgreOde tutorials

Aiursrage2k

03-01-2007 03:00:18

http://www.ogre3d.org/wiki/index.php/Ogreode
It seems like most of the tutorials have disapeared (or maybe they were never there). If they were there can someone postt them back.

Aiursrage2k

05-01-2007 14:56:17

I am starting to use OgreOde. I have read the through the simplescene example.

For starters I want to place a stack of boxes, and knock them over via a projectile (ie from the crash demo).

I am using my own code, which is very similar to the example code. The problem is the boxes start tumbling down as if in a collison.

I've tried changing the sceneManger, time step, stepper, all to no avail. Ode doesnt like such large objects, so I tried scaling it down, but the boxes still react as if in a collison.

where
m_stepperPtr is a OgreOde::Stepper*
m_worldPtr is a OgreOde::World*
m_sceneManager=m_root->createSceneManager(Ogre::ST_GENERIC);

//in init
m_worldPtr = new OgreOde::World(m_ogreAppPtr->getSceneManager());
m_worldPtr->setGravity(Vector3(0,-9.80665,0));
m_worldPtr->setCFM(10e-5);
m_worldPtr->setERP(0.8);
m_worldPtr->setContactCorrectionVelocity(0.01);

m_stepperPtr = new OgreOde::ForwardFixedInterpolatedQuickStepper(0.01);
m_stepperPtr->setAutomatic(OgreOde::Stepper::AutoMode_NotAutomatic,m_ogreAppPtr->getRoot());
int q=0, j = 0;
for(int i=0; i<10; i++)
{
// for(int j=0; j<10; j++)
{
char tmp[245];
sprintf(tmp,"ack%d",q++);
Entity* box = m_sceneManager->createEntity(tmp,"crate.mesh");
box->setCastShadows(true);

SceneNode* node = m_sceneManager->getRootSceneNode()->createChildSceneNode(tmp);
node->attachObject(box);
//node->setScale(0.1,0.1,0.1);
Quaternion q;

Vector3 pos(390+j*10,i*10+.5,590);
node->setPosition(pos);
// node->setOrientation(Ogre::Quaternion::IDENTITY);
node->setScale(1,1,1);

// Create a box for ODE and attach it to the Ogre version
OgreOde::Body* body = new OgreOde::Body();
node->attachObject(body);
body->setMass(OgreOde::BoxMass(.5,Vector3(10,10,10)));

OgreOde::BoxGeometry* geom = new OgreOde::BoxGeometry(Vector3(10,10,10),
m_worldPtr->getDefaultSpace());
geom->setBody(body);
}
}
m_worldPtr->setCollisionListener(this);
m_stepperPtr->setStepListener(this);


//in frameEnded
if(m_stepperPtr->step(dt))
m_worldPtr->synchronise();


//in collision
if (g1 && g2)
{
const OgreOde::Body * const b1 = g1->getBody();
const OgreOde::Body * const b2 = g2->getBody();
if (b1 && b2 && OgreOde::Joint::areConnected(b1, b2))
return false;
}
contact->setCoulombFriction(OgreOde::Utility::Infinity);
return true;


Hopefully theres something dumb I am forgetting to do.

Zeal

08-01-2007 04:57:24

I am also very anxious to sink my teeth into the tutorials, but they seem to be experiencing technical difficulties :(

Can anyone please reupload them?

rewb0rn

08-01-2007 15:44:04

I believe they are just not ready, seems to me like nobody has written them yet

tuan kuranes

12-01-2007 15:46:34

Tutorial never been done, just planned.

Check on ODE mailing list and ODE Wiki to get many, many information that applies also to OgreODE.