G30n3t!C
18-01-2009 21:40:01
Hi everybody,
I'm currently trying to get OgreOde and my Application working together.
I use the common TerrainSceneManager for my terrain geometry (setWorldGeometry) and want to apply simple physics like in the
OgreOde Basic Tutorial (http://www.ogre3d.org/wiki/index.php/Fi ... th_OgreODE) with the difference I want to use my
terrain geometry and not a simple plane.
For this purpose I looked at the code of landscape demo...
my steps are:
first: create my scene, which includes calling
second:
but i get the error:
at runtime within the line
it seems ode does not recognize my terrain in my mSceneMgr which it should take with mWorld = new OgreOde::World(mSceneMgr);
but why?
what am I doing wrong?
Honestly this are my first trys with ogreode, and don't have any experience with it
thx in advance
I'm currently trying to get OgreOde and my Application working together.
I use the common TerrainSceneManager for my terrain geometry (setWorldGeometry) and want to apply simple physics like in the
OgreOde Basic Tutorial (http://www.ogre3d.org/wiki/index.php/Fi ... th_OgreODE) with the difference I want to use my
terrain geometry and not a simple plane.
For this purpose I looked at the code of landscape demo...
my steps are:
first: create my scene, which includes calling
mSceneMgr->setWorldGeometry("Island.cfg");
second:
void GameState_Play_Core::initialiseOgreOde()
{
/************************************************************************/
/* Ogre Ode Implementation */
/************************************************************************/
mWorld = new OgreOde::World(mSceneMgr);
mWorld->setGravity(Ogre::Vector3(0,-9.80665,0));
mWorld->setCFM(10e-5);
mWorld->setERP(0.8);
mWorld->setAutoSleep(true);
mWorld->setAutoSleepAverageSamplesCount(10);
mWorld->setContactCorrectionVelocity(1.0);
mSpace = mWorld->getDefaultSpace();
const Ogre::Real _time_step = 0.5;
const Ogre::Real time_scale = Ogre::Real(1.7);
const Ogre::Real max_frame_time = Ogre::Real(1.0 / 4);
mStepper = new OgreOde::StepHandler(mWorld, OgreOde::StepHandler::QuickStep,
_time_step, max_frame_time, time_scale);
/************************************************************************/
/* OgreTerrain setup */
/************************************************************************/
/*
* values from Island.cfg
*/
Vector3 scale = Vector3::ZERO;
int nodes_per_side = 129;
int nodes_per_side_all_X = 0;
int nodes_per_side_all_Y = 0;
int worldWidth = 0;
int worldHeight = 0;
bool center = false;
mSceneMgr->getOption("Scale", &scale);
mSceneMgr->getOption("PageSize", &nodes_per_side);
if (scale == Vector3::ZERO)
{
// PageWorldX
scale.x = 3000 / nodes_per_side;
// MaxHeight
scale.y = 200;
// PageWorldZ
scale.z = 3000 / nodes_per_side;
}
worldWidth = scale.x * (nodes_per_side - 1);
worldHeight = scale.z * (nodes_per_side - 1);
nodes_per_side_all_X = nodes_per_side;
nodes_per_side_all_Y = nodes_per_side;
mTerrain = new OgreOde::TerrainGeometry(mWorld,
mSpace,
Vector3::ZERO,
nodes_per_side_all_X,
nodes_per_side_all_Y,
worldWidth,
worldHeight,
center);
}
but i get the error:
assertion "depthSamples >= 2" failed in
..\..\ode\src\heightfield.cpp:663
at runtime within the line
mTerrain = new OgreOde::TerrainGeometry(mWorld,
mSpace,
Vector3::ZERO,
nodes_per_side_all_X,
nodes_per_side_all_Y,
worldWidth,
worldHeight,
center);
it seems ode does not recognize my terrain in my mSceneMgr which it should take with mWorld = new OgreOde::World(mSceneMgr);
but why?
what am I doing wrong?
Honestly this are my first trys with ogreode, and don't have any experience with it
thx in advance