Table of Contents

Class TransitState

Namespace
Trailblazer.Navigation.Motor
Assembly
Trailblazer.dll

Represents the traversal state for a object while using a NavMotor and provides synchronization with TrekCondition.

public class TransitState
Inheritance
TransitState
Inherited Members

Constructors

TransitState(TrekCondition)

Initializes a new instance of the TransitState class using the specified trek condition.

public TransitState(TrekCondition condition)

Parameters

condition TrekCondition

The trek condition to use for initializing the state. Cannot be null.

TransitState(TrekCondition, TrekCondition?)

Initializes a new instance of the TransitState class with the specified current and previous trek conditions.

public TransitState(TrekCondition condition, TrekCondition? previous)

Parameters

condition TrekCondition

The current trek condition to represent. Cannot be null.

previous TrekCondition?

The previous trek condition, or null if there is no previous condition.

Properties

CeilingLevel

The ceiling height above the entity.

public Fixed64 CeilingLevel { get; }

Property Value

Fixed64

GroundState

The ground state, if applicable.

public GroundCondition? GroundState { get; }

Property Value

GroundCondition?

Medium

The current traversal medium.

public TraversalMedium Medium { get; }

Property Value

TraversalMedium

PreviousMedium

The previous traversal medium, treating a missing previous sample as Unknown.

public TraversalMedium PreviousMedium { get; }

Property Value

TraversalMedium

PreviousState

The previous traversal state (for comparison and transition detection).

public TrekCondition? PreviousState { get; }

Property Value

TrekCondition?

SlopeAngle

Gets the angle of the slope at the current position, in fixed-point degrees.

public Fixed64 SlopeAngle { get; }

Property Value

Fixed64

SurfaceLevel

The height of the surface the entity is interacting with.

public Fixed64 SurfaceLevel { get; }

Property Value

Fixed64

SurfaceNormal

The normal of the ground surface.

public Vector3d SurfaceNormal { get; }

Property Value

Vector3d

Methods

GetSignedSlopeAngle(Vector3d)

Calculates the signed angle of the current surface slope relative to the specified movement direction.

public Fixed64 GetSignedSlopeAngle(Vector3d moveDirection)

Parameters

moveDirection Vector3d

The movement direction vector used to determine the orientation relative to the slope. If this value is FixedMathSharp.Vector3d.Zero, the method treats the movement as oriented downhill.

Returns

Fixed64

The signed slope angle in degrees. A negative value indicates movement downhill, and a positive value indicates movement uphill. Returns zero if the surface is flat.

ToTrekCondition()

Returns a new TraversalCondition instance reflecting the current state.

public TrekCondition ToTrekCondition()

Returns

TrekCondition

Update(TrekCondition, TrekCondition?)

Updates the traversal state and retains the previous state for transition tracking.

public void Update(TrekCondition condition, TrekCondition? previous)

Parameters

condition TrekCondition
previous TrekCondition?