本文整理汇总了C++中ISceneNode::getScene方法的典型用法代码示例。如果您正苦于以下问题:C++ ISceneNode::getScene方法的具体用法?C++ ISceneNode::getScene怎么用?C++ ISceneNode::getScene使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISceneNode
的用法示例。
在下文中一共展示了ISceneNode::getScene方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onEnter
//-----------------------------------------------------------------------
void CCSEntityLineMoveAcion::onEnter()
{
//calculateRealMoveSpeed();
if(!mEntity)
{
return;
}
mIsPrepareMoveEndPos = false;
mIsAlreadyMoveEndPos = false;
mAnimPlaying = false;
mPathRadius = mEntity->getEntity()->getModelObject()->getPatherRadius();
ISceneNode* sceneNode = mEntity->getEntity()->getSceneNode();
if(!sceneNode)
{
return;
}
mEntity->playAnimation(mAnimName.c_str(), true, true, false, false );
mBlockManager = sceneNode->getScene()->getBlockManager();
//calculateRealMoveSpeed();
/////////////////////////////////////////////////////////////////////////////////////////////
setMoveAcionState( MAS_MOVING );
/////////////////////////////////////////////////////////////////////////////////////////////
if ( isNeedMoveToStartPos() )
{
moveToStartPos();
}else
{
moveToEndPos();
}
}
示例2: parabolaDrop
//-----------------------------------------------------------------------
void CItemEntity::parabolaDrop( Vec3 dropStartPos )
{
Flt height = 0;
ClientMain::getInstance().getScene()->getCollisionSystem()->getStickHeight(dropStartPos, height);
dropStartPos.y = height;
Vec3 dir(1,0,0);
Int angle = MGRandom::getInstance().rand_ab_One(0, 360);
dir = MGMath::rotateVector(dir, angle * (MG_PI / 180));
Int dis = MGRandom::getInstance().rand_ab_One(1, 3);
Vec3 dropEndPos = dropStartPos + dir * dis;
ISceneNode* sceneNode = mEntity->getSceneNode();
ISceneNodeLineMoveToAction* lineMoveToAction = sceneNode->getScene()->getActionManager()->createSceneNodeParabolaMoveToAction(sceneNode);
lineMoveToAction->setMoveSpeed(1);
lineMoveToAction->setIgnoreHeight(false);
lineMoveToAction->setStickTerrain(false);
lineMoveToAction->setMoveToDestination(dropEndPos);
sceneNode->getLinedStateManager()->push(lineMoveToAction);
}
示例3: moveToEndPos
//-----------------------------------------------------------------------
void CCSEntityLineMoveAcion::moveToEndPos()
{
mIsAlreadyMoveEndPos = true;
if ( !mEntity )
return;
if ( !mEntity->getEntity() )
return;
ISceneNode* sceneNode = mEntity->getEntity()->getSceneNode();
if( !sceneNode )
{
return;
}
IDynamicBlockObject* dynamicBlockObject = mEntity->getEntity()->getDynamicBlockObject();
mSceneNodeLineMoveToEndPosAction = sceneNode->getScene()->getActionManager()->createSceneNodeGridLineMoveToAction(sceneNode, dynamicBlockObject);
mSceneNodeLineMoveToActionName = mSceneNodeLineMoveToEndPosAction->getName();
mSceneNodeLineMoveToEndPosAction->addListener( this );
mSceneNodeLineMoveToEndPosAction->setMoveSpeed(mMoveSpeed);
mSceneNodeLineMoveToEndPosAction->setMoveToDestination(mEndPos);
mSceneNodeLineMoveToEndPosAction->setBlockCheck( mIsBlockCheck );
mSceneNodeLineMoveToEndPosAction->setMoveToPathFindType(mMoveToPathFindType);
if (dynamicBlockObject != NULL)
{
Flt perturbRadiu = dynamicBlockObject->getObjectRadius()*2;
mSceneNodeLineMoveToEndPosAction->setPerturbRadiu(perturbRadiu);
//mSceneNodeLineMoveToEndPosAction->setPerturbEnable(true);
}
CCSEntityLineMoveAcion* entityLineMoveAcion = NULL;
ISceneNodeGridLineMoveToAction* sceneNodeGridLineMoveToAction = NULL;
for(UInt i = 0; i < mMoveAcionListenerList.size(); ++i)
{
entityLineMoveAcion = mMoveAcionListenerList[i];
sceneNodeGridLineMoveToAction = entityLineMoveAcion->getCurrSceneNodeGridLineMoveToAction();
if(!sceneNodeGridLineMoveToAction)
{
continue;
}
mSceneNodeLineMoveToEndPosAction->addListener(sceneNodeGridLineMoveToAction);
}
sceneNode->getLinedStateManager()->push(mSceneNodeLineMoveToEndPosAction, false);
/////////////////////////////////////////////////////////////////////////////////////////////
ISceneNodeYawToAction* yawToAction = sceneNode->getScene()->getActionManager()->createSceneNodeYawToAction(sceneNode);
yawToAction->setYawSpeed(mYawSpeed);
//Vec3 currPos;
//sceneNode->getPosition(currPos);
yawToAction->setYawToPosition(mEndPos);
yawToAction->setIsImmediately(false);
sceneNode->getLinedStateManager()->push(yawToAction, false);
/////////////////////////////////////////////////////////////////////////////////////////////
sceneNode->stickTerrain();
}