MF_StaticCompute
Various computations.
Public Class MFcompute
Static Methods
SmoothRateChange : float ( distance : float, closureRate : float, curRate : float, rateAccel : float, decelMult : float, rateMax : float )
Returns the new rate of speed required to produce smooth starts and stops.
DistanceToStop : float ( speed : float, accel : float )
Finds the distance required to stop based on current speed and deceleration (acceleration)
FindTerminalVelocity : float ( thrust : float, rb Rigidbody )
Finds an approximated max speed of a rigidbody under a given thrust. This accounts for the rigidbody’s mass and drag. This is an approximation because Unity3D calculates the effect of drag in an unusual way.
Intercept : Vector3? ( shooterPosition : Vector3, shooterVelocity : Vector3, shotSpeed : float, targetPosition : Vector3, targetVelocity : Vector3 )
Calculates the Vector3 required to aim to hit a moving target at a particular shot speed. Returns null if no solution is possible.
Various computations.
Public Class MFcompute
Static Methods
SmoothRateChange : float ( distance : float, closureRate : float, curRate : float, rateAccel : float, decelMult : float, rateMax : float )
Returns the new rate of speed required to produce smooth starts and stops.
DistanceToStop : float ( speed : float, accel : float )
Finds the distance required to stop based on current speed and deceleration (acceleration)
FindTerminalVelocity : float ( thrust : float, rb Rigidbody )
Finds an approximated max speed of a rigidbody under a given thrust. This accounts for the rigidbody’s mass and drag. This is an approximation because Unity3D calculates the effect of drag in an unusual way.
Intercept : Vector3? ( shooterPosition : Vector3, shooterVelocity : Vector3, shotSpeed : float, targetPosition : Vector3, targetVelocity : Vector3 )
Calculates the Vector3 required to aim to hit a moving target at a particular shot speed. Returns null if no solution is possible.