Skip to main content
NxOgre   This page is related to a deprecated version of NxOgre, called BloodyMess. Some code from here may be adopted to newer versions with sufficient care and knowledge.   NxOgre


help 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.

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:

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


Or;

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


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

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

Or:

Copy to clipboard
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.

Copy to clipboard
if(m_pTimeController->isPaused()) m_pTimeController->resume(); else m_pTimeController->pause();

NxOgreCube.png Particles

NxOgreCube.png MeshCooking

NxOgreCube.png Cloths