示例#1
0
	void BillBoard::renderImpl( Matrix4 const& trans )
	{
		RenderSystem* system = getScene()->_getRenderSystem();

		Matrix4 mat = system->getViewMatrix();

		switch ( mBoardType )
		{
		case BT_CYLINDICAL_X:
			mat[ 0] = trans( 0 , 0 );
			mat[ 1] = trans( 0 , 1 );
			mat[ 2] = trans( 0 , 2 );
			break;
		case BT_CYLINDICAL_Y:
			mat[ 4] = trans( 1 , 0 );
			mat[ 5] = trans( 1 , 1 );
			mat[ 6] = trans( 1 , 2 );
			break;
		case BT_CYLINDICAL_Z:
			mat[ 8] = trans( 2 , 0 );
			mat[ 9] = trans( 2 , 1 );
			mat[10] = trans( 2 , 2 );
			break;
		case BT_SPHERIAL:
			break;
		}

		mat[12] = trans( 3 , 0 );
		mat[13] = trans( 3 , 1 );
		mat[14] = trans( 3 , 2 );
		mat.modifyTranslation( trans.getTranslation() );
		system->setWorldMatrix( mat );
		_renderInternal();
	}
示例#2
0
	void SkyBox::renderImpl( Matrix4 const& trans )
	{
		//Camera* cam = getScene()->_getRenderCamera();

		RenderSystem* system = getScene()->_getRenderSystem();


		Matrix4 matView = system->getViewMatrix();

		Vector3 pos = matView.getTranslation();
		matView.modifyTranslation( Vector3(0,0,0) );

		system->setViewMatrix( matView );
		_renderInternal();

		matView.modifyTranslation( pos );
		system->setViewMatrix( matView );
	}