Class WaterLocomotion
- Namespace
- Trailblazer.Navigation.Motor
- Assembly
- Trailblazer.dll
Handles water traversal mechanics, including active swimming, buoyancy, water resistance, and breath control.
public class WaterLocomotion : ILocomotion, ITransient, IRecordable
- Inheritance
-
WaterLocomotion
- Implements
-
IRecordable
- Inherited Members
- Extension Methods
Remarks
This locomotion module owns liquid-medium runtime state. Active swim input is one capability inside that model alongside passive floating, sinking, breach behavior, and dive-time tracking.
Constructors
WaterLocomotion()
public WaterLocomotion()
Fields
BreachJumpMultiplier
Multiplier applied to the jump velocity when the scout breaches water. Controls how forcefully the scout exits the water.
public Fixed64 BreachJumpMultiplier
Field Value
- Fixed64
Remarks
A value less than 1 results in a lower jump arc compared to standard ground jumps.
BreathRegenerateIncrement
The amount of breath the scout regenerates per tick when resurfacing.
public Fixed64 BreathRegenerateIncrement
Field Value
- Fixed64
BuoyancyFactor
The buoyancy factor determining how strongly the scout floats or sinks in water.
public Fixed64 BuoyancyFactor
Field Value
- Fixed64
CanBreachWater
Determines whether the scout can breach the water surface when jumping.
public bool CanBreachWater
Field Value
CanDrown
Determines whether the scout can drown if underwater for too long.
public bool CanDrown
Field Value
CanSwim
Determines whether the scout can actively swim while in water.
public bool CanSwim
Field Value
DefaultBreachJumpMultiplier
Default multiplier applied to jump force when breaching from water into air.
public static readonly Fixed64 DefaultBreachJumpMultiplier
Field Value
- Fixed64
DefaultBreathRegenerateIncrement
The default amount of breath regenerated per tick when resurfacing.
public static readonly Fixed64 DefaultBreathRegenerateIncrement
Field Value
- Fixed64
DefaultBuoyancyFactor
The default buoyancy factor, controlling how strongly the scout floats in water.
public static readonly Fixed64 DefaultBuoyancyFactor
Field Value
- Fixed64
DefaultHoldBreathTime
The default duration the scout can hold its breath underwater before drowning begins.
public static readonly Fixed64 DefaultHoldBreathTime
Field Value
- Fixed64
DefaultMaxSwimAcceleration
The default maximum acceleration while swimming.
public static readonly Fixed64 DefaultMaxSwimAcceleration
Field Value
- Fixed64
DefaultMaxSwimSidewaysSpeed
The default maximum sideways swimming speed.
public static readonly Fixed64 DefaultMaxSwimSidewaysSpeed
Field Value
- Fixed64
DefaultMaxSwimSpeed
The default maximum swimming speed.
public static readonly Fixed64 DefaultMaxSwimSpeed
Field Value
- Fixed64
DefaultSwimAccelerationModifier
The default swim acceleration multiplier.
public static readonly Fixed64 DefaultSwimAccelerationModifier
Field Value
- Fixed64
HoldBreathTime
The maximum time the scout can hold its breath underwater before drowning.
public Fixed64 HoldBreathTime
Field Value
- Fixed64
MaxSwimSidewaysSpeed
The maximum sideways swimming speed when active swim control is engaged.
public Fixed64 MaxSwimSidewaysSpeed
Field Value
- Fixed64
MaxSwimSpeed
The maximum forward swimming speed when active swim control is engaged.
public Fixed64 MaxSwimSpeed
Field Value
- Fixed64
MaxWaterAcceleration
The maximum acceleration while actively swimming.
public Fixed64 MaxWaterAcceleration
Field Value
- Fixed64
SwimAccelerationModifier
The acceleration multiplier applied to active swimming movement.
public Fixed64 SwimAccelerationModifier
Field Value
- Fixed64
Properties
IsDiving
Indicates whether the scout is currently diving (fully submerged).
[Transient]
public bool IsDiving { get; set; }
Property Value
IsDrowning
Determines whether the scout is drowning due to prolonged underwater exposure.
public bool IsDrowning { get; }
Property Value
IsEnabled
Indicates whether this locomotion behavior is enabled. If disabled, its movement effects will not be applied.
public bool IsEnabled { get; set; }
Property Value
IsSwimming
Indicates whether the scout is currently under active swimming control.
[Transient]
public bool IsSwimming { get; set; }
Property Value
MaxSwimAcceleration
The effective maximum acceleration while swimming, factoring in the acceleration modifier.
public Fixed64 MaxSwimAcceleration { get; }
Property Value
- Fixed64
RequestedSwimThisTraversal
Stores the authored swim intent for the active traversal so entry into liquid can resolve after state refresh.
[Transient]
public bool RequestedSwimThisTraversal { get; set; }
Property Value
UnderwaterTimer
The amount of time the scout has been underwater.
[Transient]
public Fixed64 UnderwaterTimer { get; set; }
Property Value
- Fixed64
Methods
RecordData(IChronicler)
Records the current instance state to the provided chronicler.
public void RecordData(IChronicler chronicler)
Parameters
chroniclerIChroniclerThe active chronicler pass.
UpdateDiveTime()
Updates the dive timer, tracking underwater duration and regenerating breath when resurfacing.
public void UpdateDiveTime()