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.
Table of contents
General
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>();
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();
Particles
MeshCooking
Cloths
Official Wiki and Website - Forum - Ogre Portal for NxOgre
Betajaen's Guide to creating a Bloody mess
Code snippetsbloody mess
General - Particles - Mesh Cooking - Cloths
Spacegaier's Tutorialsbloody mess
Setting up BloodyMess - First steps - Visual Debugger - Volumes & Triggers - Kinematics - Raycasting - Resources and Meshes