Skip to main content

History: BloodyMess Code Snippets

Preview of version: 1



Forum icon question2.gif Help: For any problems you encounter while working with these code snippets, as well as for detailed questions and propositions, please visit the NxOgre OgreAddons-Forum.

TOC

NxOgreCube.png General

NxOgreCube.png Converting Ogre::Vector3 (or any Vector3-like class) to NxOgre::Vec3

Converting an Ogre vector or any other class (that has three floats named x, y, z) to a NxOgre one is something, you probably have to do quite often.

This is how to do it:

Ogre::Vector3 myOgreVector(1, 2, 3);
NxOgre::Vec3 myNxOgreVector(myOgreVector);


Or;

Ogre::Vector3 myOgreVector3(1, 2, 3);
NxOgre::Vec3 myNxOgreVector3;
myNxOgreVector3.from<Ogre::Vector3>(myOgreVector3);


If you need it the other way round...:

Ogre::Vector3 myOgreVector3(myNxOgreVector3.as<Ogre::Vector3>());


Or:

Ogre::Vector3 myOgreVector3 = myNxOgreVector3.as<Ogre::Vector3>();

NxOgreCube.png Toggle physics simulation

If you want to toggle whether BloodyMess should go on simulating physics or should pause it, this code snippet offers you the needed functionalty. Just put it in the input handler function for the respective key, you want to use for toggling.

if(m_pTimeController->isPaused())
   m_pTimeController->resume();
else
   m_pTimeController->pause();

NxOgreCube.png Particles

NxOgreCube.png MeshCooking

NxOgreCube.png Cloths



Category:NxOgre

History

Information Version
Wed 23 of Dec, 2009 13:34 GMT-0000 jacmoe 3
Wed 23 of Dec, 2009 13:33 GMT-0000 jacmoe 2
Fri 25 of Sep, 2009 16:56 GMT-0000 Betajaen /* Image:NxOgreCube.png Converting Ogre::Vector3 (or any XYZ variable) to NxOgre::Vec3 */ 1