public Vector3 ClosestPoint(Vector3 position) { physXPoint.FromVector(position); if (PhysXLib.GetClosestPointOnShape(shape, physXPoint, physXClosestPoint) == 0) { return(position); } return(physXClosestPoint.ToVector()); }
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(); } }