Class VolumeController
- Namespace
- FluffyUnderware.Curvy.Controllers
Controller using a Curvy Generator Volume
[AddComponentMenu("Curvy/Controllers/CG Volume Controller")]
public class VolumeController : CurvyController
- Inheritance
-
ObjectComponentBehaviourMonoBehaviourDTVersionedMonoBehaviourVolumeController
- Inherited Members
Properties
CrossClamping
Gets or sets the clamping mode for lateral movement
public CurvyClamping CrossClamping { get; set; }
Property Value
CrossFrom
public float CrossFrom { get; set; }
Property Value
CrossLength
public float CrossLength { get; }
Property Value
CrossRelativePosition
Gets or sets the current relative lateral position, respecting clamping. Ranges from CrossFrom to CrossTo
public float CrossRelativePosition { get; set; }
Property Value
CrossTo
public float CrossTo { get; set; }
Property Value
IsReady
Returns true if the controller has all it dependencies ready.
public override bool IsReady { get; }
Property Value
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
Volume
Gets or sets the volume to use
public CGDataReference Volume { get; set; }
Property Value
VolumeData
Gets the actual volume data
[CanBeNull]
public CGVolume VolumeData { get; }
Property Value
Methods
AbsoluteToRelative(float)
Converts distance on source from absolute to relative position.
protected override float AbsoluteToRelative(float worldUnitDistance)
Parameters
worldUnitDistance
floatdistance 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
floatcontroller's speed. Should be strictly positive
deltaTime
floatthe 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
floatthe 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
floatthe 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
floatinterpolatedPosition
Vector3tangent
Vector3up
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
floatrelative 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
floatthe current virtual position (either TF or World Units)
direction
MovementDirectionthe current direction
speed
floatcontroller's speed. Should be strictly positive
deltaTime
floatthe time that the controller should advance with. Should be strictly positive