Table of Contents

Class SplineController.SplineSwitcher

protected class SplineController.SplineSwitcher
Inheritance
SplineController.SplineSwitcher

Properties

Direction

The controller's current Direction on the Spline. Its value is invalid if no spline switching is in progress. Spline switching is done by calling Start(CurvySpline, float, float, MovementDirection)

public MovementDirection Direction { get; set; }

Property Value

MovementDirection

Duration

The duration of the the current spline switching. Its value is invalid if no spline switching is in progress. Spline switching is done by calling Start(CurvySpline, float, float, MovementDirection)

public float Duration { get; set; }

Property Value

float

IsSwitching

Gets whether the Controller is switching splines

public bool IsSwitching { get; set; }

Property Value

bool

Progress

The ratio (value between 0 and 1) expressing the progress of the current spline switch. 0 means the switch just started, 1 means the switch ended. Its value is 0 if no spline switching is in progress. Spline switching is done by calling Start(CurvySpline, float, float, MovementDirection)

public float Progress { get; }

Property Value

float

Spline

The spline to which the controller is switching. Its value is invalid if no spline switching is in progress. Spline switching is done by calling Start(CurvySpline, float, float, MovementDirection)

public CurvySpline Spline { get; set; }

Property Value

CurvySpline

StartTime

The time at which the current spline switching started. Its value is invalid if no spline switching is in progress. Spline switching is done by calling Start(CurvySpline, float, float, MovementDirection)

public float StartTime { get; set; }

Property Value

float

Tf

The controller's current TF on the Spline. Its value is invalid if no spline switching is in progress. Spline switching is done by calling Start(CurvySpline, float, float, MovementDirection)

public float Tf { get; set; }

Property Value

float

Methods

Advance(CurvySpline, MoveModeEnum, float, CurvyClamping)

Advance the current spline switch. Updates Tf and Direction accordingly.

public void Advance(CurvySpline spline, CurvyController.MoveModeEnum moveMode, float distance, CurvyClamping clamping)

Parameters

spline CurvySpline

Spline on witch advancing

moveMode CurvyController.MoveModeEnum

movement type

distance float

distance of the advance. Its unit depends on the value of moveMode

clamping CurvyClamping

Defines the behaviour when reaching a spline end

Start(CurvySpline, float, float, MovementDirection)

Start a spline switch. Should be called only on non stopped controllers.

public void Start(CurvySpline spline, float tf, float duration, MovementDirection direction)

Parameters

spline CurvySpline

the target spline to switch to

tf float

the target TF

duration float

duration of the switch phase

direction MovementDirection

Remarks

While switching is not finished, movement on destination spline will not fire events nor consider connections

Stop()

Stop the current spline switch

public void Stop()