示例#1
0
void
CStarField::vUpdateBeforeChildren( unsigned long in_Time )
{
	if(!m_bPreloadError)
	{
//		CLog::Print("CStarField::vUpdateBeforeChildren( %lu );\n",in_Time);
		m_Matrix.ConstructScaling( CVector(5.0f,5.0f,5.0f) );
		float AngleSelf = CONST_2PI*float(in_Time%(10000))/10000.0f;
//		CLog::Print("  AngleSelf = %f\n",AngleSelf);
		CMatrix RotationSelf; RotationSelf.ConstructRotationY(AngleSelf);
		CMatrix RotationTilt; RotationTilt.ConstructRotationZ(CONST_PI_6);
		float AngleAxisDrift = -CONST_2PI*float(in_Time%(40000))/40000.0f;
		CMatrix RotationDrift; RotationDrift.ConstructRotationY(AngleAxisDrift);
		m_Matrix *= RotationSelf;
		m_Matrix *= RotationTilt;
		m_Matrix *= RotationDrift;

		CRenderSection_RenderVB Cmd( m_Matrix, m_VBHandle, m_PSHandle, 0, m_PrimitiveType, m_PrimitiveCount );
		CRenderProxy::getInstance().RenderVB( Cmd );
	}
}