MCPcopy Create free account
hub / github.com/OpenDungeons/OpenDungeons / orientMenuEntityPosition

Method orientMenuEntityPosition

source/render/RenderManager.cpp:341–354  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

339}
340
341void RenderManager::orientMenuEntityPosition(Ogre::SceneNode* node, const Ogre::Vector3& direction)
342{
343 Ogre::Vector3 tempVector = node->getOrientation() * Ogre::Vector3::NEGATIVE_UNIT_Y;
344
345 // Work around 180 degree quaternion rotation quirk
346 if ((1.0f + tempVector.dotProduct(direction)) < 0.0001f)
347 {
348 node->roll(Ogre::Degree(180));
349 }
350 else
351 {
352 node->rotate(tempVector.getRotationTo(direction));
353 }
354}
355
356Ogre::ParticleSystem* RenderManager::addEntityParticleEffectMenu(Ogre::SceneNode* node,
357 const std::string& particleName, const std::string& particleScript)

Callers 4

activateMethod · 0.80
activateMethod · 0.80
activateMethod · 0.80
updateMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected