public Vector3 ComputeRelativeForce(Vector3 force) { if (thing != null) { return(MathI.RotateVector(force, Vector3.zero, thing.rotation)); } return(Vector3.zero); }
public void ApplyForce(Vector3 thrustVector, Vector3 offset, bool relativeToRotation = true) { if (thing != null) { Vector3 point = offset; Vector3 force = thrustVector; if (relativeToRotation) { ApplyForceAndTorque(ComputeRelativeForce(thrustVector), ComputeTorque(thrustVector, offset)); force = ComputeRelativeForce(thrustVector); } else { ApplyForceAndTorque(thrustVector, ComputeTorque(thrustVector, offset)); } Vector3 tPt = MathI.RotateVector(thing.position + centerOfMass + point, thing.position + centerOfMass, thing.rotation); } }