Hi,
After doing this :
pmScene = mWorld->createScene("Main", "renderer: ogre, controller: accumulator, gravity: yes, floor: yes");
pmScene->createBody("box.mesh", new Cube(1), Vector3(0,1200,0), "mass: 10");
pmScene->createBody("box.mesh", new Cube(1), Vector3(30,1100,0), "mass: 1");
I can see 2 cubes falling, as expected.
However, if i make a bigger cube than 1, the physic representation doens't fit the graphical representation.
How can i acess the visual mesh that was created, so i can assign it a material ?
thanks,
Bruno
betajaen
01-06-2008 22:34:40
Which version of NxOgre are you using? Scaling is different between 0.9/1.0
Material? Ogre or NxOgre? NxOgre materials are created through the Scene, then passed into the shape through the material params. Ogre materials you will need to read up on the Wiki and/or manual.
I'm not sure what version i'm using, it's the last one available from the SVN.
How does the scaling works in the latest version ?
I'm talking about Ogre materials.
I know how to use Ogre materials, however i need an entity to assign the material to it, here i don't have a entity.
pmScene->createBody("box.mesh", new Cube(1), Vector3(0,1200,0), "mass: 10");
pmScene doens't seem to expose the entity, or i can't find the function that does that. pmScene is a NxOgre::Scene
betajaen
01-06-2008 22:57:02
You need to play with the NodeRenderableParams. "Bleeding" doesn't expose any Ogre stuff; It's handled abstractly through a Rendersystem.
pmScene->createBody("Box1", new Cube(4,4,4), Vector3(0,12,0), "model: box.mesh, model-type: resource, model-scale: 4 4 4, material: boxMaterial", "mass: 10");
These are a good read:
-
http://www.nxogre.org/Inheriting_Actor_ ... type_class
-
http://www.nxogre.org/shortguide
-
http://www.nxogre.org/Core_Hierarchy_Diagram
Thanks,
The material does work, the scale however doesn't.
What's the "Bleeding" ? Is there a nxOgre version that exposes the rendersystem ?
betajaen
01-06-2008 23:27:09
No. This is how NxOgre works. I forgot it's "scale" not "node-scale". Bleeding is the name of the latest SVN commit of 1.0
You should scale and assign your material to the mesh off-line though; using MeshMagick. It's faster and more neater.