BloodyMess Code Snippets

From Ogre Wiki

Jump to: navigation, search
Image:NxOgreCube.pngThis page is related to the newest version of NxOgre, called BloodyMessImage:NxOgreCube.png

Image: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.


Contents


Image:NxOgreCube.png General

Image: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>();

Image: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();

Image:NxOgreCube.png Particles

Image:NxOgreCube.png MeshCooking

Image:NxOgreCube.png Cloths

image:NxOgreLogoTemplateBox.png

Official Wiki and Website - Forum - Ogre Portal for NxOgre
Betajaen's Guide to creating a Bloody mess


Personal tools
administration