当前位置: 首页>>代码示例>>C++>>正文


C++ Node::getScale方法代码示例

本文整理汇总了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");
        }
    }
}
开发者ID:BackupTheBerlios,项目名称:dsa-hl-svn,代码行数:35,代码来源:PlaneNodeProcessor.cpp

示例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));

}
开发者ID:bregma,项目名称:ember,代码行数:21,代码来源:ModelMountTestCase.cpp


注:本文中的ogre::Node::getScale方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。