本文整理汇总了C++中MovableObject::getParentSceneNode方法的典型用法代码示例。如果您正苦于以下问题:C++ MovableObject::getParentSceneNode方法的具体用法?C++ MovableObject::getParentSceneNode怎么用?C++ MovableObject::getParentSceneNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MovableObject
的用法示例。
在下文中一共展示了MovableObject::getParentSceneNode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mousePressed
Ogre::String ObjectControl::mousePressed(QPoint lastPos,float w,float h)
{
using namespace Ogre;
float RatioX = float(lastPos.x())/w;
float RatioY = float(lastPos.y())/h;
MovableObject* nodeM = getNode(RatioX,RatioY);
if( nodeM != NULL )
{
String name = nodeM->getParentSceneNode()->getName();
if ( name == "move_widget_x" )
{
Vector3 objPos = Vector3(node->_getWorldAABB().getCenter());
planeXNode->setPosition(objPos);
planeYNode->setPosition(objPos);
planeZNode->setPosition(objPos);
currntOperation=MoveX;
}
else if ( name == "move_widget_y" )
{
Vector3 objPos = Vector3(node->_getWorldAABB().getCenter());
planeXNode->setPosition(objPos);
planeYNode->setPosition(objPos);
planeZNode->setPosition(objPos);
currntOperation=MoveY;
}
else if ( name == "move_widget_z" )
{
Vector3 objPos = Vector3(node->_getWorldAABB().getCenter());
planeXNode->setPosition(objPos);
planeYNode->setPosition(objPos);
planeZNode->setPosition(objPos);
currntOperation=MoveZ;
}
else if ( name == "rotate_widget_x" ) currntOperation = RotateX;
else if ( name == "rotate_widget_y" ) currntOperation = RotateY;
else if ( name == "rotate_widget_z" ) currntOperation = RotateZ;
else if ( name == "scale_widget_x" ) currntOperation = ScaleX;
else if ( name == "scale_widget_y" ) currntOperation = ScaleY;
else if ( name == "scale_widget_z" ) currntOperation = ScaleZ;
else if ( name == "scale_widget_xyz" ) currntOperation = ScaleXYZ;
else
{
if (currentMode==Move_Mode ) selectObjectForEdit(name.c_str(),"move_widget" );
else if (currentMode==Rotate_Mode) selectObjectForEdit(name.c_str(),"rotate_widget");
else if (currentMode==Scale_Mode ) selectObjectForEdit(name.c_str(),"scale_widget" );
}
return name;
}
else
{
reset();
return "";
}
}
示例2: execute
//---------------------------------------------------------------------
void PCZIntersectionSceneQuery::execute(IntersectionSceneQueryListener* listener)
{
typedef std::pair<MovableObject *, MovableObject *> MovablePair;
typedef std::set
< std::pair<MovableObject *, MovableObject *> > MovableSet;
MovableSet set;
// Iterate over all movable types
Root::MovableObjectFactoryIterator factIt =
Root::getSingleton().getMovableObjectFactoryIterator();
while(factIt.hasMoreElements())
{
SceneManager::MovableObjectIterator it =
mParentSceneMgr->getMovableObjectIterator(
factIt.getNext()->getType());
while( it.hasMoreElements() )
{
MovableObject * e = it.getNext();
PCZone * zone = ((PCZSceneNode*)(e->getParentSceneNode()))->getHomeZone();
PCZSceneNodeList list;
//find the nodes that intersect the AAB
static_cast<PCZSceneManager*>( mParentSceneMgr ) -> findNodesIn( e->getWorldBoundingBox(), list, zone, 0 );
//grab all moveables from the node that intersect...
PCZSceneNodeList::iterator nit = list.begin();
while( nit != list.end() )
{
SceneNode::ObjectIterator oit = (*nit) -> getAttachedObjectIterator();
while( oit.hasMoreElements() )
{
MovableObject * m = oit.getNext();
if( m != e &&
set.find( MovablePair(e,m)) == set.end() &&
set.find( MovablePair(m,e)) == set.end() &&
(m->getQueryFlags() & mQueryMask) &&
(m->getTypeFlags() & mQueryTypeMask) &&
m->isInScene() &&
e->getWorldBoundingBox().intersects( m->getWorldBoundingBox() ) )
{
listener -> queryResult( e, m );
// deal with attached objects, since they are not directly attached to nodes
if (m->getMovableType() == "Entity")
{
Entity* e2 = static_cast<Entity*>(m);
Entity::ChildObjectListIterator childIt = e2->getAttachedObjectIterator();
while(childIt.hasMoreElements())
{
MovableObject* c = childIt.getNext();
if (c->getQueryFlags() & mQueryMask &&
e->getWorldBoundingBox().intersects( c->getWorldBoundingBox() ))
{
listener->queryResult(e, c);
}
}
}
}
set.insert( MovablePair(e,m) );
}
++nit;
}
}
}
}