コード例 #1
0
	void EffectElement::update( Real time, TransformInfo &info )
	{
		// calculate the born time
		Real currentStartTime = mCurrentStartTime + time;
		if ( currentStartTime < mStartTime )
		{
			mCurrentStartTime = currentStartTime;
			return;
		}

		/*if (mBasicNode)
			mBasicNode->setVisible(mVisible);*/

		if ( false == mIsRenderInstanceCreated )
		{
			if ( createRenderInstance() )
				mIsRenderInstanceCreated = true;
		}
	
		//¡¡calculate the life time
		Real currentTime = mCurrentLifeTime + time;

		// if the life time is zero ,the element will not be deleted.
		if ( (currentTime > mLifeTime) && (mLifeTime > 0.0f) )
		{
			// destroy
			destroyMe();
		}
		else
		{
			mCurrentLifeTime = currentTime;			

			updateRenderInstance(time,info);			
		}	
	}	
コード例 #2
0
ファイル: WXLightObject.cpp プロジェクト: brock7/TianLong
    //-----------------------------------------------------------------------
    void LightObject::createRenderInstance(System* system)
    {
        assert(system);
        assert(!mBaseSceneNode);

        mBaseSceneNode = system->getBaseSceneNode();

        updateRenderInstance();
    }