本文整理汇总了C++中ogre::Node::getScale方法的典型用法代码示例。如果您正苦于以下问题:C++ Node::getScale方法的具体用法?C++ Node::getScale怎么用?C++ Node::getScale使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::Node
的用法示例。
在下文中一共展示了Node::getScale方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createCollision
void PlaneNodeProcessor::createCollision(Ogre::Entity *entity, DOMElement *physicsProxyElem)
{
bool collisionEnabled = false;
if (physicsProxyElem == NULL || !hasAttribute(physicsProxyElem, "collision"))
collisionEnabled = false;
else if(getAttributeValueAsBool(physicsProxyElem, "collision"))
collisionEnabled = true;
if(collisionEnabled)
{
std::vector<OgreNewt::CollisionPtr> collisions;
OgreNewt::CollisionPtr collision = OgreNewt::CollisionPtr();
OgreNewt::World* world = PhysicsManager::getSingleton()._getNewtonWorld();
const AxisAlignedBox &aab = entity->getMesh()->getBounds();
Ogre::Node* parentNode = entity->getParentNode();
Ogre::Vector3 size = (aab.getMaximum() - aab.getMinimum()) * parentNode->getScale();
const Quaternion orientation(0,0,0,0);// = parentNode->getOrientation();
const Ogre::Vector3 pos = aab.getMinimum() * parentNode->getScale() + (size/2.0);
collision = PhysicsManager::getSingleton().createCollision(entity, GT_BOX, "", Vector3::ZERO, Quaternion::IDENTITY, 0, NULL, NULL, true);
if ( collision != NULL )
{
collisions.push_back(collision);
}
// Add to physics of map
if (collisions.size() > 0)
{
PhysicsManager::getSingleton().addLevelGeometry(entity, collisions);
LOG_WARNING(Logger::RULES, " Plane '"+entity->getName()+"' in levelGeometry geladen");
}
}
}
示例2: scaleAndTestMount
void scaleAndTestMount(TestModel& model, Model::ModelMount& mount, const Ogre::Node& node)
{
WFMath::AxisBox<3> axisBox(WFMath::Point<3>(0, 0, 0), WFMath::Point<3>(10, 10, 10));
model.bbox = Ogre::AxisAlignedBox(Ogre::Vector3(0, 0, 0), Ogre::Vector3(5, 5, 5));
mount.rescale(&axisBox);
CPPUNIT_ASSERT(node.getScale() == Ogre::Vector3(2, 2, 2));
model.bbox = Ogre::AxisAlignedBox(Ogre::Vector3(0, 0, 0), Ogre::Vector3(20, 20, 20));
mount.rescale(&axisBox);
CPPUNIT_ASSERT(node.getScale() == Ogre::Vector3(0.5, 0.5, 0.5));
model.bbox = Ogre::AxisAlignedBox(Ogre::Vector3(10, 10, 10), Ogre::Vector3(20, 20, 20));
mount.rescale(&axisBox);
CPPUNIT_ASSERT(node.getScale() == Ogre::Vector3(1, 1, 1));
model.bbox = Ogre::AxisAlignedBox(Ogre::Vector3(0, 10, 15), Ogre::Vector3(20, 20, 20));
mount.rescale(&axisBox);
CPPUNIT_ASSERT(node.getScale() == Ogre::Vector3(2, 1, 0.5));
}