Table of Contents

Class VolumeController

Controller using a Curvy Generator Volume

[AddComponentMenu("Curvy/Controllers/CG Volume Controller")]
public class VolumeController : CurvyController
Inheritance
Object
Component
Behaviour
MonoBehaviour
DTVersionedMonoBehaviour
VolumeController
Inherited Members

Properties

CrossClamping

Gets or sets the clamping mode for lateral movement

public CurvyClamping CrossClamping { get; set; }

Property Value

CurvyClamping

CrossFrom

public float CrossFrom { get; set; }

Property Value

float

CrossLength

public float CrossLength { get; }

Property Value

float

CrossRelativePosition

Gets or sets the current relative lateral position, respecting clamping. Ranges from CrossFrom to CrossTo

public float CrossRelativePosition { get; set; }

Property Value

float

CrossTo

public float CrossTo { get; set; }

Property Value

float

IsReady

Returns true if the controller has all it dependencies ready.

public override bool IsReady { get; }

Property Value

bool

Remarks

A controller that is not initialized and has IsReady true, will be initialized at the next update call (automatically each frame or manually through Refresh().

Length

Gets the source's length

public override float Length { get; }

Property Value

float

Volume

Gets or sets the volume to use

public CGDataReference Volume { get; set; }

Property Value

CGDataReference

VolumeData

Gets the actual volume data

[CanBeNull]
public CGVolume VolumeData { get; }

Property Value

CGVolume

Methods

AbsoluteToRelative(float)

Converts distance on source from absolute to relative position.

protected override float AbsoluteToRelative(float worldUnitDistance)

Parameters

worldUnitDistance float

distance in world units from the source start. Should be already clamped

Returns

float

relative distance in the range 0..1

Advance(float, float)

Advance the controller and return the new position. This method will do side effect operations if needed, like updating some internal state, or triggering events.

protected override void Advance(float speed, float deltaTime)

Parameters

speed float

controller's speed. Should be strictly positive

deltaTime float

the time that the controller should advance with. Should be strictly positive

CrossAbsoluteToRelative(float)

Converts absolute lateral to relative position, respecting clamping, ignoring CrossRange

public float CrossAbsoluteToRelative(float worldUnitDistance)

Parameters

worldUnitDistance float

the absolute position

Returns

float

the relative position

CrossRelativeToAbsolute(float)

Converts relative lateral to absolute position, respecting clamping, ignoring CrossRange

public float CrossRelativeToAbsolute(float relativeDistance)

Parameters

relativeDistance float

the relative position

Returns

float

the absolute position

GetInterpolatedSourcePosition(float)

Retrieve the source global position for a given relative position (TF)

protected override Vector3 GetInterpolatedSourcePosition(float tf)

Parameters

tf float

Returns

Vector3

GetInterpolatedSourcePosition(float, out Vector3, out Vector3, out Vector3)

Retrieve the source global position, tangent and orientation for a given relative position (TF)

protected override void GetInterpolatedSourcePosition(float tf, out Vector3 interpolatedPosition, out Vector3 tangent, out Vector3 up)

Parameters

tf float
interpolatedPosition Vector3
tangent Vector3
up Vector3

GetOrientation(float)

Retrieve the source global Orientation/Up-Vector for a given relative position

protected override Vector3 GetOrientation(float tf)

Parameters

tf float

Returns

Vector3

GetTangent(float)

Gets global tangent for a given relative position

protected override Vector3 GetTangent(float tf)

Parameters

tf float

Returns

Vector3

RelativeToAbsolute(float)

Converts distance on source from relative to absolute position.

protected override float RelativeToAbsolute(float relativeDistance)

Parameters

relativeDistance float

relative distance from the source start. Should be already clamped

Returns

float

distance in world units from the source start

SimulateAdvance(ref float, ref MovementDirection, float, float)

Advance the controller and return the new position. Contrary to Advance(float, float), this method will not do any side effect operations, like updating some internal state, or triggering events

protected override void SimulateAdvance(ref float tf, ref MovementDirection direction, float speed, float deltaTime)

Parameters

tf float

the current virtual position (either TF or World Units)

direction MovementDirection

the current direction

speed float

controller's speed. Should be strictly positive

deltaTime float

the time that the controller should advance with. Should be strictly positive