Ejemplo n.º 1
0
    public override void UpdatePositionAndVelocity()
    {
        PhysXLib.GetPosition(physXBody, physXPosition);

        PhysXLib.GetRotation(physXBody, physXRotation);

        physXPosition.ToVector(ref _position);
        physXRotation.ToQuaternion(ref _rotation);

        transform.SetPositionAndRotation(_position, _rotation);

        PhysXLib.GetLinearVelocity(physXBody, physXVelocity);
        physXVelocity.ToVector(ref _velocity);

        PhysXLib.GetAngularVelocity(physXBody, physXAngularVelocity);
        physXAngularVelocity.ToVector(ref _angularVelocity);

        foreach (PhysXWheelCollider wheel in wheels)
        {
            wheel.UpdateData();
        }
    }