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


C++ ISceneNode::getScene方法代码示例

本文整理汇总了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();
        }
    }
开发者ID:dnjsflagh1,项目名称:code,代码行数:42,代码来源:SceneEntityAction.cpp

示例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);
	}
开发者ID:dnjsflagh1,项目名称:code,代码行数:22,代码来源:CItemEntity.cpp

示例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();
    }
开发者ID:dnjsflagh1,项目名称:code,代码行数:68,代码来源:SceneEntityAction.cpp


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