Class SerpentineLocomotionMath
Controller-neutral helpers that convert an observed world displacement into wave phase.
Inheritance
object
SerpentineLocomotionMath
Namespace: CreatureKit.Serpentine
Assembly: CreatureKit.Serpentine.Runtime.dll
Syntax
public static class SerpentineLocomotionMath
Methods
AdvancePhase(float, float, float)
Advances a normalized phase by an actual signed travel distance.
Declaration
public static float AdvancePhase(float currentPhase, float signedTravelDistance, float distancePerCycle)
Parameters
| Type | Name | Description |
|---|---|---|
| float | currentPhase | |
| float | signedTravelDistance | |
| float | distancePerCycle |
Returns
| Type | Description |
|---|---|
| float |
CalculateSignedPathDistance(Vector3, Vector3)
Returns the actual path distance, signed from its alignment with the creature's forward axis. Lateral-only displacement does not advance the locomotion wave.
Declaration
public static float CalculateSignedPathDistance(Vector3 actualWorldDisplacement, Vector3 worldForward)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | actualWorldDisplacement | |
| Vector3 | worldForward |
Returns
| Type | Description |
|---|---|
| float |