Body not rendered
tuxbook
12-04-2008 12:42:12
It's my understanding that the following will add a body and render its mesh:
mWorld = new World();
mScene = mWorld->createScene("Main", m_scene_manager, "gravity: yes, floor: yes");
mScene->createBody("vf1s.mesh", new Cube(NxVec3(1,1,1)), NxOgre::Pose(Ogre::Vector3(10.0f,10.0f,10.0f)), "mass: 5");
But nothing is actually rendered. Am I missing something? Ogre can load the .mesh file fine. There is no mention of anything related in the ogre log. I'm using the TerrainSceneManager.
betajaen
12-04-2008 19:07:29
The camera is probably inside the body or the mesh is offset.
tuxbook
13-04-2008 04:00:46
I've tried several meshes (including a box and ninja) so I don't think the mesh is offset. I did notice however that there is no error message or anything if it can't find the mesh. But like I said, it should see it.
I've moved the camera all around the world looking for the mesh and didn't see anything, even in wireframe.
tuxbook
13-04-2008 04:46:53
I screwed around more with it, but still nothing.
I'm thinking that NxOgre isn't loading the mesh at all, since there is no messages in the ogre log (there's several when Ogre loads the mesh with CreateEntity). Is there any way to check NxOgre errors? There's no NxOgre messages in the ogre log, and no NxOgre log.
I'm stumped.
Caphalor
13-04-2008 10:00:01
Do you use bleeding? "new Cube" looks like bleeding.
tuxbook
13-04-2008 10:47:22
Yes, I'm using bleeding from svn.
Dutchie
13-04-2008 10:50:44
Cube is also in older versions...
and in bleeding you have to specify a name to your body:
mWorld = new World();
mScene = mWorld->createScene("Main", m_scene_manager, "gravity: yes, floor: yes, renderer: ogre");
mScene->createBody("myname;vf1s.mesh", new Cube(NxVec3(1,1,1)), NxOgre::Pose(Ogre::Vector3(10.0f,10.0f,10.0f)), "mass: 5");
and you have to specify that you want to use ogre as renderer to your scene
tuxbook
13-04-2008 11:07:14
That's exactly what I was missing. Thanks Dutchie!
betajaen
13-04-2008 11:45:00
Which I was thinking you was using 0.9. There is a rule in this forum any posts about the Bleeding SVN must have a title prefix of "[Bleeding]".
tuxbook
13-04-2008 11:49:59
Sorry, I should have mentioned that.
Although the meshes are now being rendered, they refuse to let me set their pose or global position. They remain at 0,0,0 and don't move. Something else I'm missing?
betajaen
13-04-2008 11:50:55
You haven't told NxOgre how you want the "time handled" by default it expects you to call it, but there is a shortcut.
mWorld = new World("time-controller: ogre");
mScene = mWorld->createScene("Main", "gravity: yes, floor: yes, renderer: ogre");
mScene->createBody("myname;vf1s.mesh", new Cube(1,1,1), Ogre::Vector3(10.0f,10.0f,10.0f), "mass: 5");
Otherwise anything you won't matter because NxOgre and PhysX are "frozen in time".
tuxbook
13-04-2008 11:54:45
Thanks Betajaen, it's working now.
i type in the same code (using the ogrehead.mesh instead) and i dont see anything...im using the ogre application wizard to create my scene and im trying to just get something on the screen