lexchou
15-08-2007 13:27:22
PhysX SDK: 2.7.2
NxOgre: 0.9-33 (from SVN)
OGRE: 1.4.3(Eihort)
Bodies fall through the terrain, and stoped under a certain distance below the terrain.
Here's my code:
The terrain.cfg comes from Ogre DEMO(I removed some comments in the following code):
I've searched in this forum, many guys got the same fucking problem, some of them solved, and some not. none of those posts can help me.
For those posts here about the same problem, their NxOgre::TerrainShape's constructor accepts many parameters, but my SVN version NxOgre only accepts three, is the problem happened due to the lack of some important parameters? maybe not, but I don't understand why this code doesn't work.
Thank you what ever helped me solved this problem.
NxOgre: 0.9-33 (from SVN)
OGRE: 1.4.3(Eihort)
Bodies fall through the terrain, and stoped under a certain distance below the terrain.
Here's my code:
SceneManager *sceneMgr=root->createSceneManager("TerrainSceneManager","Main");
Camera *camera=sceneMgr->createCamera("MainCamera");
NxOgre::World * world=new NxOgre::World();
NxOgre::Scene * scene=world->createScene("Main",sceneMgr,"gravity: yes, floor: yes");
....................................
sceneMgr->setWorldGeometry("terrain.cfg");
scene->createBody("terrain",new NxOgre::TerrainShape("terrain.png", 100, "material:terrain_texture.jpg"),Vector3::ZERO,"static: yes");
The terrain.cfg comes from Ogre DEMO(I removed some comments in the following code):
WorldTexture=terrain_texture.jpg
DetailTexture=terrain_detail.jpg
DetailTile=3
PageSource=Heightmap
Heightmap.image=terrain.png
PageSize=513
TileSize=65
MaxPixelError=3
PageWorldX=3000
PageWorldZ=3000
MaxHeight=100
MaxMipMapLevel=5
VertexProgramMorph=yes
LODMorphStart=0.2
I've searched in this forum, many guys got the same fucking problem, some of them solved, and some not. none of those posts can help me.
For those posts here about the same problem, their NxOgre::TerrainShape's constructor accepts many parameters, but my SVN version NxOgre only accepts three, is the problem happened due to the lack of some important parameters? maybe not, but I don't understand why this code doesn't work.
Thank you what ever helped me solved this problem.