namespace: CurveArchitect.Objects
file: Segment.cs
Description:
Contains all information for one segment on an Architect Curve.
Public variables
Transform localSpace
- The transform of the ArchitectCurve..
float zRotation
- Sets the z rotation for the specific segment.
float contrast
- Sets the contrast for the specific segment.
Vector2 saddleSkew
- Sets the saddle skew for the specific segment.
Vector2 scale
- Sets the scale for the specific segment.
string id
- Segment id.
float length
- Segment length.
float zPosition
- Z position on the ArchitectCurve for the segment.
List<Link> links
- All control points linked to this segment.
Public functions
Vector3 GetPosition(Type type, Space space = Space.World)
Description:
Gets the position of the specified point type (anchor, tangentA, or tangentB).
Params:
- type: The type of the point (anchor, tangentA, or tangentB).
- space: The coordinate space (World or Local) for the position.
Returns:
The world or local position of the specified point.
void SetPosition(Type type, Vector3 newPosition, Space space = Space.World)
Description:
Sets the world or local position of the specified point type (anchor, tangentA, or tangentB).
Params:
- type: The type of the point (anchor, tangentA, or tangentB).
- newPosition: The new world or local position of the point.
- space: The coordinate space (World or Local) for the new position.
void Translate(Type type, Vector3 value, Space space = Space.World)
Description:
Translates the specified point type (anchor, tangentA, or tangentB) by a given value in world or local space.
Params:
- type: The type of the point (anchor, tangentA, or tangentB).
- value: The translation vector in world space.
- space: The coordinate space (World or Local) for the translation.
void SetContrast(float value)
Description:
Sets the contrast value, clamping it within the specified minimum and maximum range.
Params:
- value: The new contrast value.
void AddLink(Link l)
Description:
Adds a link to the segment's list of links.
Params:
void RemoveSegmentFromLinks(Segment s)
Description:
Removes a specified segment from the segment's list of links.
Params:
- s: The segment to remove from the links.
Remarks:
Logs a warning if the segment is not found in the links.
void SetLocalSpace(Transform localSpace)
Description:
Sets the local space transform for the segment and updates the positions of the anchor and tangents.
Params:
- localSpace: The new local space transform.