Ejemplo n.º 1
0
Archivo: car.cpp Proyecto: basecq/thug
void CCar::DoGameLogic()
{
	Dbg_MsgLog(("DoGameLogic for car '%s'",Script::FindChecksumName(GetID())));
	
	if ( GetSuspendComponent()->SkipLogic( ) )
	{
		return;
	}
	
	if ( IsDead() )
	{
		return;
	}

	// Don't update the wheels if we should not animate
	// (and this cunningly lets the SuspendComponment actually work, by clearing the initial_animations	
	if (GetSuspendComponent()->should_animate( ))
	{
		// check to see if it's got a hierarchy
		// if it does, then update the wheels
		Gfx::CSkeleton* pCarSkeleton = this->GetSkeleton();
		if ( pCarSkeleton )
		{
			update_wheels();
	
			display_wheels();
			
//			debug_wheels();
		}
	}
}
Ejemplo n.º 2
0
		void VehicleObject::update(const double dt)
		{

			if(m_pvehicle)
			{
				//update wheels
				update_wheels();

				//update transform matrix
				float temp[16];
				btTransform bt_transform;
				bt_transform = m_pvehicle->getChassisWorldTransform();

				//Apply bullet tranformation to engine matrix
				bt_transform.getOpenGLMatrix(temp);
				//temp[13] += 1.0f;
				array_1D_to_matrix(m_transform_matrix, temp);
			}
		}