[solved]how to move an ogre3dbody's object

sungoco

15-10-2009 05:16:21

create ogre3dbody code:
NxOgre::ResourceSystem::getSingleton()->openArchive("media", "file:E:/work/Game/Player_v2.0_Source/Player/Bin/Media");
NxOgre::Mesh* triangleMesh = NxOgre::MeshManager::getSingleton()->load("media:ninja.nxs");
NxOgre::TriangleGeometry* triangleGeometry = new NxOgre::TriangleGeometry(triangleMesh);

m_body = RenderSystem->createBody(triangleGeometry, position, meshName);

move code:

m_body->getSceneNode()->translate(direction * deltaTimeSecs * walkSpeed);

sungoco

15-10-2009 06:41:36

then ,i create a ninja like this:
NxOgre::ResourceSystem::getSingleton()->openArchive("media", "file:E:/work/Game/Player_v2.0_Source/Player/Bin/Media");
NxOgre::Mesh* convexMesh = NxOgre::MeshManager::getSingleton()->load("media:ninja.nxs");
NxOgre::Convex* convex = new NxOgre::Convex(convexMesh);
OGRE3DBody* body = RenderSystem->createBody(convex, position, meshName);

my ninja cannt stand on the plane, it falls down always. how can i fix it?

sungoco

15-10-2009 06:54:10

when i use NxOgre::TriangleGeometry, it works, but ninja is a little rocking

by the way, could anyone give a terrain.xhf? i cannt find ogre's terrain.raw;
i convert "height.png" into "height.raw" with photoshop, but flour cannt convert it to .xhf,
error info:
Unknown file-format.

sungoco

16-10-2009 02:44:13

noone reply ? my question out of your disscuss range?

sungoco

16-10-2009 04:10:01

ok ,problem is solved by:

body->setGlobalPose(NxOgre::Matrix44(
body->getSceneNode()->_getDerivedPosition(),
body->getSceneNode()->_getDerivedOrientation()));


But i donnt understand the Pose means. Is there a tutorial ?