Curvy  4.1.0
CurvySplineSegment Class Reference
+ Inheritance diagram for CurvySplineSegment:
+ Collaboration diagram for CurvySplineSegment:

Detailed Description

Class covering a Curvy Spline Segment / ControlPoint

Classes

struct  ControlPointExtrinsicProperties
 Contains data about a control point related to it's parent spline. For example, is a control point a valid segment in the spline or not.
 

Public Attributes

Vector3[] Approximation = new Vector3[0]
 List of precalculated interpolations More...
 
float[] ApproximationDistances = new float[0]
 List of precalculated distances More...
 
Vector3[] ApproximationT = new Vector3[0]
 List of precalculated Tangent-Normals More...
 
Vector3[] ApproximationUp = new Vector3[0]
 List of precalculated Up-Vectors More...
 

Properties

bool AutoBakeOrientation [get, set]
 If set, Control Point's rotation will be set to the calculated Up-Vector3 More...
 
float AutoHandleDistance [get, set]
 
bool AutoHandles [get, set]
 Gets or Sets Auto Handles. When setting it the value of connected control points is also updated More...
 
Bounds Bounds [get]
 Gets this segment's bounds in world space More...
 
int CacheSize [get]
 Gets the number of individual cache points of this segment More...
 
CurvyConnection Connection [get, set]
 Gets/Sets the connection handler this Control Point is using (if any) More...
 
bool ConnectionSyncPosition [get, set]
 
bool ConnectionSyncRotation [get, set]
 
float Distance [get, set]
 Gets the distance from spline start to the first control point (localF=0) More...
 
float EndBias [get, set]
 End Bias More...
 
float EndContinuity [get, set]
 End Continuity More...
 
float EndTension [get, set]
 End Tension More...
 
CurvySplineSegment FollowUp [get]
 Gets the connected Control Point that is set as "Head To" More...
 
ConnectionHeadingEnum FollowUpHeading [get, set]
 Gets or sets the heading toward the "Head To" segment More...
 
Vector3 HandleIn [get, set]
 Left B-Spline Handle in local coordinates More...
 
Vector3 HandleInPosition [get, set]
 Left B-Spline Handle in world coordinates More...
 
Vector3 HandleOut [get, set]
 Right B-Spline Handle in local coordinates More...
 
Vector3 HandleOutPosition [get, set]
 Right B-Spline Handle in world coordinates More...
 
bool HasUnprocessedLocalOrientation [get]
 Returns true if the local orientation is different than the last one used in the segment approximations cache computation More...
 
bool HasUnprocessedLocalPosition [get]
 Returns true if the local position is different than the last one used in the segment approximations cache computation More...
 
bool IsFirstControlPoint [get]
 Gets whether this Control Point is the first IGNORING closed splines More...
 
bool IsLastControlPoint [get]
 Gets whether this Control Point is the last IGNORING closed splines More...
 
float Length [get]
 Gets the length of this spline segment More...
 
List< Component > MetaData [get]
 
bool OrientatinInfluencesSpline [get]
 Returns wheter the orientation of this Control Point influences the orientation of its containing spline's approximation points. Returns false if control point is not part of a spline More...
 
bool OverrideGlobalBias [get, set]
 Whether local Bias should be used More...
 
bool OverrideGlobalContinuity [get, set]
 Whether local Continuity should be used More...
 
bool OverrideGlobalTension [get, set]
 Whether local Tension should be used More...
 
bool SerializedOrientationAnchor [get, set]
 The serialized value of OrientationAnchor. This value is ignored in some cases (invisible control points, first and last visible control points). Use Spline.IsOrientationAnchor() to get the correct value. More...
 
CurvySpline Spline [get]
 Gets the parent spline More...
 
float StartBias [get, set]
 Start Bias More...
 
float StartContinuity [get, set]
 Start Continuity More...
 
float StartTension [get, set]
 Start Tension More...
 
CurvyOrientationSwirl Swirl [get, set]
 Swirling Mode More...
 
float SwirlTurns [get, set]
 Turns to swirl More...
 
bool SynchronizeTCB [get, set]
 Keep Start/End-TCB synchronized More...
 
float TF [get]
 Gets the TF of this Control Point More...
 

Public Member Functions

void BakeOrientationToTransform ()
 Modify the control point's local rotation to match the segment's orientation More...
 
void DeleteMetadata ()
 Removes all Metadata components of this Control Point More...
 
void Disconnect ()
 Resets the connections related data (Connection, FollowUp, etc) while updating the Connection object and dirtying relevant splines. More...
 
float DistanceToLocalF (float localDistance)
 Gets the local F by a distance within this line segment More...
 
int getApproximationIndexINTERNAL (float localF, out float frag)
 Internal, gets the index of mApproximation by F and the remaining fragment More...
 
Component GetMetaData (Type type, bool autoCreate=false)
 Gets Metadata More...
 
GetMetadata< T > (bool autoCreate=false)
 Gets Metadata of this ControlPoint More...
 
float GetNearestPointF (Vector3 p)
 Gets the f nearest to a certain point More...
 
Quaternion GetOrientationFast (float localF)
 Gets a rotation looking to Tangent with the head upwards along the Up-Vector More...
 
Quaternion GetOrientationFast (float localF, bool inverse)
 Gets a rotation looking to Tangent with the head upwards along the Up-Vector More...
 
Vector3 GetOrientationUpFast (float localF)
 Gets the Up-Vector for a local F based on the splines' Orientation mode More...
 
Vector3 GetTangent (float localF)
 Gets the tangent for a local F More...
 
Vector3 GetTangent (float localF, Vector3 position)
 Gets the normalized tangent for a local F with the interpolated position for f known More...
 
Vector3 GetTangentFast (float localF)
 Gets the cached tangent for a certain F More...
 
Vector3 Interpolate (float localF)
 Interpolates position for a local F More...
 
Vector3 Interpolate (float localF, CurvyInterpolation interpolation)
 Interpolates position for a local F More...
 
Vector3 InterpolateFast (float localF)
 Interpolates position for a local F using a linear approximation More...
 
object InterpolateMetadata (Type type, float f)
 Gets interpolated MetaData of this Segment More...
 
InterpolateMetadata< T, U > (float f)
 Gets interpolated MetaData of this Segment More...
 
Vector3 InterpolateScale (float localF)
 Gets the interpolated Scale More...
 
void LinkToSpline (CurvySpline spline)
 
float LocalFToDistance (float localF)
 Gets the local distance for a certain localF value More...
 
float LocalFToTF (float localF)
 Gets TF for a certain local F More...
 
void OnAfterPop ()
 
void OnBeforePush ()
 
void ReloadMetaData ()
 Reloads Metadata components More...
 
void ResetConnectionRelatedData ()
 Resets the connections related data (Connection, FollowUp, etc) More...
 
void SetBezierHandleIn (Vector3 position, Space space=Space.Self, CurvyBezierModeEnum mode=CurvyBezierModeEnum.None)
 Sets Bezier HandleIn More...
 
void SetBezierHandleOut (Vector3 position, Space space=Space.Self, CurvyBezierModeEnum mode=CurvyBezierModeEnum.None)
 Sets Bezier HandleOut More...
 
void SetBezierHandles (float distanceFrag=-1, bool setIn=true, bool setOut=true, bool noDirtying=false)
 Automatically place Bezier handles relative to neighbour Control Points More...
 
void SetBezierHandles (float distanceFrag, Vector3 p, Vector3 n, bool setIn=true, bool setOut=true, bool noDirtying=false)
 Automatically place Bezier handles More...
 
void SetFollowUp (CurvySplineSegment target, ConnectionHeadingEnum heading=ConnectionHeadingEnum.Auto)
 Sets Follow Up of this Control Point More...
 
void SetLocalPosition (Vector3 newPosition)
 Sets the local position while dirtying the spline, dirtying the connected splines, and updating the connected control points' positions accordingly. More...
 
void SetLocalRotation (Quaternion value)
 Sets the local rotation while dirtying the spline, dirtying the connected splines, and updating the connected control points' rotations accordingly. More...
 
void SetPosition (Vector3 value)
 Sets the global position while dirtying the spline, dirtying the connected splines, and updating the connected control points' positions accordingly. More...
 
void SetRotation (Quaternion value)
 Sets the global rotation while dirtying the spline, dirtying the connected splines, and updating the connected control points' rotations accordingly. More...
 
override string ToString ()
 
void UnlinkFromSpline ()
 

Member Function Documentation

void BakeOrientationToTransform ( )

Modify the control point's local rotation to match the segment's orientation

void DeleteMetadata ( )

Removes all Metadata components of this Control Point

void Disconnect ( )

Resets the connections related data (Connection, FollowUp, etc) while updating the Connection object and dirtying relevant splines.

float DistanceToLocalF ( float  localDistance)

Gets the local F by a distance within this line segment

Parameters
localDistancelocal distance in the range 0..Length
Returns
a local F in the range 0..1
int getApproximationIndexINTERNAL ( float  localF,
out float  frag 
)

Internal, gets the index of mApproximation by F and the remaining fragment

Component GetMetaData ( Type  type,
bool  autoCreate = false 
)

Gets Metadata

Parameters
typetype implementing ICurvyMetadata
autoCreatewhether to create the Metadata component if it's not present
Returns
the Metadata component or null
T GetMetadata< T > ( bool  autoCreate = false)

Gets Metadata of this ControlPoint

Template Parameters
TMetadata type
Parameters
autoCreatewhether to create the Metadata component if it's not present
Returns
the Metadata component or null
Type Constraints
T :Component 
T :ICurvyMetadata 
float GetNearestPointF ( Vector3  p)

Gets the f nearest to a certain point

Parameters
pa point (in the space of the spline)
Returns
LocalF of the nearest position
Quaternion GetOrientationFast ( float  localF)

Gets a rotation looking to Tangent with the head upwards along the Up-Vector

Parameters
localFa local F in the range 0..1
Returns
a rotation
Quaternion GetOrientationFast ( float  localF,
bool  inverse 
)

Gets a rotation looking to Tangent with the head upwards along the Up-Vector

Parameters
localFa local F in the range 0..1
inversewhether the orientation should be inversed or not
Returns
a rotation
Vector3 GetOrientationUpFast ( float  localF)

Gets the Up-Vector for a local F based on the splines' Orientation mode

Parameters
localFa local F in the range 0..1
Returns
the Up-Vector
Vector3 GetTangent ( float  localF)

Gets the tangent for a local F

Parameters
localFa local F in the range 0..1

SmoothTangent won't get respected!

Returns
the tangent/direction
Vector3 GetTangent ( float  localF,
Vector3  position 
)

Gets the normalized tangent for a local F with the interpolated position for f known

This saves one interpolation if you already know the position. SmoothTangent won't get respected!

Parameters
localFa local F in the range 0..1
positionthe result of Interpolate(localF)
Returns
Vector3 GetTangentFast ( float  localF)

Gets the cached tangent for a certain F

SmoothTangent option will be respected

Parameters
localFa local F in the range 0..1
Returns
Vector3 Interpolate ( float  localF)

Interpolates position for a local F

Parameters
localFa local F in the range 0..1
Returns
the interpolated position
Vector3 Interpolate ( float  localF,
CurvyInterpolation  interpolation 
)

Interpolates position for a local F

Parameters
localFa local F in the range 0..1
interpolationthe interpolation to use
Returns
the interpolated position
Vector3 InterpolateFast ( float  localF)

Interpolates position for a local F using a linear approximation

Parameters
localFa local F in the range 0..1
Returns
the interpolated position
object InterpolateMetadata ( Type  type,
float  f 
)

Gets interpolated MetaData of this Segment

Parameters
typeMetadata type implementing ICurvyInterpolatableMetadata
fa local F in the range 0..1
Returns
interpolated value
U InterpolateMetadata< T, U > ( float  f)

Gets interpolated MetaData of this Segment

Template Parameters
TMetadata type implementing ICurvyInterpolatableMetadata
UMetadata return value type
Parameters
fa local F in the range 0..1
Returns
interpolated value
Type Constraints
T :Component 
T :ICurvyInterpolatableMetadata<U> 
Vector3 InterpolateScale ( float  localF)

Gets the interpolated Scale

Parameters
localFa local F in the range 0..1
Returns
the interpolated value
void LinkToSpline ( CurvySpline  spline)
float LocalFToDistance ( float  localF)

Gets the local distance for a certain localF value

Parameters
localFa local F value in the range 0..1
Returns
a distance in the range 0..Length
float LocalFToTF ( float  localF)

Gets TF for a certain local F

Parameters
localFa local F in the range 0..1
Returns
a TF value
void OnAfterPop ( )
void OnBeforePush ( )
void ReloadMetaData ( )

Reloads Metadata components

void ResetConnectionRelatedData ( )

Resets the connections related data (Connection, FollowUp, etc)

void SetBezierHandleIn ( Vector3  position,
Space  space = Space.Self,
CurvyBezierModeEnum  mode = CurvyBezierModeEnum.None 
)

Sets Bezier HandleIn

Parameters
positionHandleIn position
spaceLocal or world space
modeHandle synchronization mode
void SetBezierHandleOut ( Vector3  position,
Space  space = Space.Self,
CurvyBezierModeEnum  mode = CurvyBezierModeEnum.None 
)

Sets Bezier HandleOut

Parameters
positionHandleOut position
spaceLocal or world space
modeHandle synchronization mode
void SetBezierHandles ( float  distanceFrag = -1,
bool  setIn = true,
bool  setOut = true,
bool  noDirtying = false 
)

Automatically place Bezier handles relative to neighbour Control Points

Parameters
distanceFraghow much % distance between neighbouring CPs are applied to the handle length?
setInSet HandleIn?
setOutSet HandleOut?
noDirtyingIf true, the Bezier handles will be modified without dirtying any spline
void SetBezierHandles ( float  distanceFrag,
Vector3  p,
Vector3  n,
bool  setIn = true,
bool  setOut = true,
bool  noDirtying = false 
)

Automatically place Bezier handles

Parameters
distanceFraghow much % distance between neighbouring CPs are applied to the handle length?
pPosition the In-Handle relates to
nPosition the Out-Handle relates to
setInSet HandleIn?
setOutSet HandleOut?
noDirtyingIf true, the Bezier handles will be modified without dirtying any spline
void SetFollowUp ( CurvySplineSegment  target,
ConnectionHeadingEnum  heading = ConnectionHeadingEnum.Auto 
)

Sets Follow Up of this Control Point

Parameters
targetthe Control Point to follow to
headingthe Heading on the target's spline
void SetLocalPosition ( Vector3  newPosition)

Sets the local position while dirtying the spline, dirtying the connected splines, and updating the connected control points' positions accordingly.

Parameters
newPosition
void SetLocalRotation ( Quaternion  value)

Sets the local rotation while dirtying the spline, dirtying the connected splines, and updating the connected control points' rotations accordingly.

Parameters
value
void SetPosition ( Vector3  value)

Sets the global position while dirtying the spline, dirtying the connected splines, and updating the connected control points' positions accordingly.

Parameters
value
void SetRotation ( Quaternion  value)

Sets the global rotation while dirtying the spline, dirtying the connected splines, and updating the connected control points' rotations accordingly.

Parameters
value
override string ToString ( )
void UnlinkFromSpline ( )

Member Data Documentation

Vector3 [] Approximation = new Vector3[0]

List of precalculated interpolations

Based on Spline's CacheDensity

float [] ApproximationDistances = new float[0]

List of precalculated distances

Based on Spline's CacheDensity

Vector3 [] ApproximationT = new Vector3[0]

List of precalculated Tangent-Normals

Based on Spline's CacheDensity

Vector3 [] ApproximationUp = new Vector3[0]

List of precalculated Up-Vectors

Based on Spline's CacheDensity

Property Documentation

bool AutoBakeOrientation
getset

If set, Control Point's rotation will be set to the calculated Up-Vector3

This is particularly useful when connecting splines

float AutoHandleDistance
getset
bool AutoHandles
getset

Gets or Sets Auto Handles. When setting it the value of connected control points is also updated

Bounds Bounds
get

Gets this segment's bounds in world space

int CacheSize
get

Gets the number of individual cache points of this segment

The actual approximations arrays' size is CacheSize + 1

CurvyConnection Connection
getset

Gets/Sets the connection handler this Control Point is using (if any)

If set to null, FollowUp wil be set to null to

bool ConnectionSyncPosition
getset
bool ConnectionSyncRotation
getset
float Distance
getset

Gets the distance from spline start to the first control point (localF=0)

float EndBias
getset

End Bias

remarks>This only applies to interpolation methods using Bias

float EndContinuity
getset

End Continuity

This only applies to interpolation methods using Continuity

float EndTension
getset

End Tension

This only applies to interpolation methods using Tension

CurvySplineSegment FollowUp
get

Gets the connected Control Point that is set as "Head To"

ConnectionHeadingEnum FollowUpHeading
getset

Gets or sets the heading toward the "Head To" segment

Vector3 HandleIn
getset

Left B-Spline Handle in local coordinates

Vector3 HandleInPosition
getset

Left B-Spline Handle in world coordinates

Vector3 HandleOut
getset

Right B-Spline Handle in local coordinates

Vector3 HandleOutPosition
getset

Right B-Spline Handle in world coordinates

bool HasUnprocessedLocalOrientation
get

Returns true if the local orientation is different than the last one used in the segment approximations cache computation

bool HasUnprocessedLocalPosition
get

Returns true if the local position is different than the last one used in the segment approximations cache computation

bool IsFirstControlPoint
get

Gets whether this Control Point is the first IGNORING closed splines

bool IsLastControlPoint
get

Gets whether this Control Point is the last IGNORING closed splines

float Length
get

Gets the length of this spline segment

List<Component> MetaData
get
bool OrientatinInfluencesSpline
get

Returns wheter the orientation of this Control Point influences the orientation of its containing spline's approximation points. Returns false if control point is not part of a spline

bool OverrideGlobalBias
getset

Whether local Bias should be used

This only applies to interpolation methods using Bias

bool OverrideGlobalContinuity
getset

Whether local Continuity should be used

This only applies to interpolation methods using Continuity

bool OverrideGlobalTension
getset

Whether local Tension should be used

This only applies to interpolation methods using Tension

bool SerializedOrientationAnchor
getset

The serialized value of OrientationAnchor. This value is ignored in some cases (invisible control points, first and last visible control points). Use Spline.IsOrientationAnchor() to get the correct value.

CurvySpline Spline
get

Gets the parent spline

float StartBias
getset

Start Bias

This only applies to interpolation methods using Bias

float StartContinuity
getset

Start Continuity

This only applies to interpolation methods using Continuity

float StartTension
getset

Start Tension

This only applies to interpolation methods using Tension

CurvyOrientationSwirl Swirl
getset

Swirling Mode

float SwirlTurns
getset

Turns to swirl

bool SynchronizeTCB
getset

Keep Start/End-TCB synchronized

Applies only to TCB Interpolation

float TF
get

Gets the TF of this Control Point

This is a shortcut to LocalFToTF(0)


The documentation for this class was generated from the following files: