Skip to main content

FauxRigidbody

A class in Root.Township, the global namespace.

Moves a transform by a velocity and angular velocity each time Update is called, without physics. Also has a helper to work out acceleration toward a point.

Constructors​

MemberWhat it is
FauxRigidbody(Transform targetTransform)Creates a FauxRigidbody from targetTransform.

Fields​

MemberWhat it is
Vector3 angularVelocityEuler degrees per second applied to rotation.
Vector3 velocityUnits per second applied to position.
1 private and internal field
MemberWhat it is
private Transform targetTransformTransform that is moved.

Methods​

MemberWhat it is
static Vector3 CalculateAccelerationToReachPoint(Vector3 deltaPosition, Vector3 currentVelocity, float acceleration, float maxSpeed)Searches for the acceleration that reaches a point offset from here, within the given acceleration limit. maxSpeed isn't used.
void Update()Moves and rotates the transform by the velocities times delta time.

Used in​

Members of other types that take, return or hold a FauxRigidbody: