Skip to main content

ClimbingPressureCalculator

A class in Root.Township, Features.Climbing.

Works out how hard one climbing hand pushes against a surface and how much pressure it has left to resist with. One per hand, built with the other hand for reference.

Constructors​

MemberWhat it is
ClimbingPressureCalculator(ClimbingSettings settings, ClimbingHand thisHand, ClimbingHand otherHand)Creates a ClimbingPressureCalculator from settings, thisHand and otherHand.

Fields​

5 private and internal fields
MemberWhat it is
private ClimbingHand otherHandThe opposite climbing hand.
private float pressureDirectionPowerDirection factor from the last pressure calculation, reused when resisting.
private float remainingPressureBacking field for RemainingPressure.
private ClimbingSettings settingsClimbing settings that give the per-hand pressure limits.
private ClimbingHand thisHandThe climbing hand this calculator is for.

Properties​

MemberWhat it is
float RemainingPressure { get; }Pressure left after the last GetCurrentPressure call, including the extra resist pressure while climbing.

Methods​

MemberWhat it is
Vector3 CalculateResistance(Vector3 resistanceUnit)Returns the hand's resisting force along the given direction, scaled by the remaining pressure.
Vector3 GetCurrentPressure(float downwardGravityForce, float deltaTime)Returns the hand's pressure force for this step. Gravity is halved when the other hand is also climbing.

Used in​

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