public static void CreateKinematicData(this MonoEx monoex, out KinematicData data) { data.velocity = monoex.cachedRigidbody.velocity; data.angularVelocity = monoex.cachedRigidbody.angularVelocity; data.position = monoex.cachedTransform.position; data.orientation = monoex.cachedTransform.eulerAngles; }
public static void ApplyPositionAndRotation(this MonoEx monoex, ref KinematicData kinematic_data) { monoex.cachedTransform.position = kinematic_data.position; monoex.cachedTransform.rotation = Quaternion.Euler(kinematic_data.orientation); }
public static void ApplyKinematicVelocity(this MonoEx monoex, ref KinematicData kinimatic_data) { monoex.cachedRigidbody.velocity = kinimatic_data.velocity; monoex.cachedRigidbody.angularVelocity = kinimatic_data.angularVelocity; }