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


C++ SceneNode::setInheritScale方法代码示例

本文整理汇总了C++中ogre::SceneNode::setInheritScale方法的典型用法代码示例。如果您正苦于以下问题:C++ SceneNode::setInheritScale方法的具体用法?C++ SceneNode::setInheritScale怎么用?C++ SceneNode::setInheritScale使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ogre::SceneNode的用法示例。


在下文中一共展示了SceneNode::setInheritScale方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: CreateTerrain

// Create the scene node for the terrain. We don't need to make the mesh as the later calls
// will do that.
Ogre::SceneNode* Region::CreateTerrain(Ogre::SceneNode* regionNode,
			 const float width, const float length, Ogre::String terrainName) {
	LG::Log("Region::CreateTerrain: r=%s, w=%f, l=%f, n=%s", this->Name.c_str(), width, length, terrainName.c_str());
	Ogre::SceneNode* terrainNode = regionNode->createChildSceneNode("TerrainSceneNode/" + terrainName);
	terrainNode->setInheritOrientation(true);
	terrainNode->setInheritScale(false);
	terrainNode->translate(0.0, 0.0, 0.0);
	return terrainNode;
}
开发者ID:Misterblue,项目名称:LookingGlass-Viewer,代码行数:11,代码来源:Region.cpp

示例2: CreateOcean

// Create the scene node for the ocean. We create a plane, add the ocean material, create a scene node
// and add the plane to the scene node and return that scene node.
// BETWEEN FRAME OPERATION
Ogre::SceneNode* Region::CreateOcean(Ogre::SceneNode* regionNode,
			 const float width, const float length, const float waterHeight, Ogre::String waterName) {
	Ogre::Plane* oceanPlane = new Ogre::Plane(0.0, 0.0, 1.0, 0);
	Ogre::MeshPtr oceanMesh = Ogre::MeshManager::getSingleton().createPlane(waterName, OLResourceGroupName, 
					*oceanPlane, width, length,
					2, 2, true,
					2, 2.0, 2.0, Ogre::Vector3::UNIT_Y);
	Ogre::String oceanMaterialName = LG::GetParameter("Renderer.Ogre.OceanMaterialName");
	LG::Log("Region::CreateOcean: r=%s, h=%f, n=%s, m=%s", 
		regionNode->getName().c_str(), waterHeight, waterName.c_str(), oceanMaterialName.c_str());
	oceanMesh->getSubMesh(0)->setMaterialName(oceanMaterialName);
	Ogre::Entity* oceanEntity = LG::RendererOgre::Instance()->m_sceneMgr->createEntity("WaterEntity/" + waterName, oceanMesh->getName());
	oceanEntity->addQueryFlags(Ogre::SceneManager::WORLD_GEOMETRY_TYPE_MASK);
	oceanEntity->setCastShadows(false);
	Ogre::SceneNode* oceanNode = regionNode->createChildSceneNode("WaterSceneNode/" + waterName);
	oceanNode->setInheritOrientation(true);
	oceanNode->setInheritScale(false);
	oceanNode->translate(width/2.0f, length/2.0f, waterHeight);
	oceanNode->attachObject(oceanEntity);
	return oceanNode;
}
开发者ID:Misterblue,项目名称:LookingGlass-Viewer,代码行数:24,代码来源:Region.cpp

示例3: OgreContainer

//!
//! Creates a copy of the given scene node.
//!
//! \param sceneNode The scene node to copy.
//! \param name The name to use for the copied scene node.
//! \param sceneManager The scene manager to use for creating the scene node.
//! \return A copy of the given scene node.
//!
Ogre::SceneNode * OgreTools::copySceneNode ( Ogre::SceneNode *sceneNode, const QString &name, Ogre::SceneManager *sceneManager /* = 0 */ )
{
    // make sure the given scene node is valid
    if (!sceneNode) {
        Log::error("The given scene node is invalid.", "OgreTools::copySceneNode");
        return 0;
    }

    // make sure a valid scene manager is available
    if (!sceneManager)
        sceneManager = sceneNode->getCreator();
    if (!sceneManager) {
        Log::error("No valid scene manager available.", "OgreTools::copySceneNode");
        return 0;
    }

    // check if a scene node of the given name already exists
    if (sceneManager->hasSceneNode(name.toStdString())) {
        Log::error(QString("The scene manager already contains a scene node named \"%1\".").arg(name), "OgreTools::copySceneNode");
        return 0;
    }

    // create the scene node copy
    Ogre::SceneNode *sceneNodeCopy = sceneManager->createSceneNode(name.toStdString());
    if (!sceneNodeCopy) {
        Log::error("The scene node copy could not be created.", "OgreTools::copySceneNode");
        return 0;
    }

    // create a container for the scene node copy
    OgreContainer *sceneNodeCopyContainer = new OgreContainer(sceneNodeCopy);
    sceneNodeCopy->setUserAny(Ogre::Any(sceneNodeCopyContainer));

    const Ogre::Any &userAny = sceneNode->getUserAny();
    userAny.isEmpty();
    if (!sceneNode->getUserAny().isEmpty()) {
        OgreContainer *sceneNodeContainer = Ogre::any_cast<OgreContainer *>(sceneNode->getUserAny());
        if (sceneNodeContainer)
            QObject::connect(sceneNodeContainer, SIGNAL(sceneNodeUpdated()), sceneNodeCopyContainer, SLOT(updateSceneNode()));
    }

    // copy parameters from scene node to scene node copy
    //sceneNodeCopy->setAutoTracking(...);
    //sceneNodeCopy->setCustomParameter(...);
    //sceneNodeCopy->setDebugDisplayEnabled(...);
    //sceneNodeCopy->setDirection(...);
    //sceneNodeCopy->setFixedYawAxis(...);
    sceneNodeCopy->setInheritOrientation(sceneNode->getInheritOrientation());
    sceneNodeCopy->setInheritScale(sceneNode->getInheritScale());
    //sceneNodeCopy->setInitialState(...);
    //sceneNodeCopy->setInSceneGraph(...);
    sceneNodeCopy->setListener(sceneNode->getListener());
    sceneNodeCopy->setOrientation(sceneNode->getOrientation());
    //sceneNodeCopy->setParent(...);
    sceneNodeCopy->setPolygonModeOverrideable(sceneNode->getPolygonModeOverrideable());
    sceneNodeCopy->setPosition(sceneNode->getPosition());
    //sceneNodeCopy->setRenderSystemData(...);
    sceneNodeCopy->setScale(sceneNode->getScale());
    sceneNodeCopy->setUseIdentityProjection(sceneNode->getUseIdentityProjection());
    sceneNodeCopy->setUseIdentityView(sceneNode->getUseIdentityView());
    //sceneNodeCopy->getUserAny(...);
    //sceneNodeCopy->setVisible(...);
    return sceneNodeCopy;
}
开发者ID:banduladh,项目名称:levelfour,代码行数:72,代码来源:OgreTools.cpp


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