Class CurvyShape
- Namespace
- FluffyUnderware.Curvy
Base class for CurvyShape components
[RequireComponent(typeof(CurvySpline))]
[ExecuteAlways]
public class CurvyShape : DTVersionedMonoBehaviour
- Inheritance
-
ObjectComponentBehaviourMonoBehaviourDTVersionedMonoBehaviourCurvyShape
- Derived
Fields
Dirty
[NonSerialized]
public bool Dirty
Field Value
Properties
Plane
Gets or sets the plane to create the shape in.
public CurvyPlane Plane { get; set; }
Property Value
Spline
Gets the attached spline
public CurvySpline Spline { get; }
Property Value
Methods
ApplyShape()
Override this to add custom code
protected virtual void ApplyShape()
Delete()
Remove the CurvyShape component from it's GameObject
public void Delete()
PrepareControlPoints(int)
Resizes the spline to have a certain number of Control Points
protected void PrepareControlPoints(int count)
Parameters
countintnumber of Control Points
PrepareSpline(CurvyInterpolation, CurvyOrientation, int, bool)
Sets basic spline parameters
protected void PrepareSpline(CurvyInterpolation interpolation, CurvyOrientation orientation = CurvyOrientation.Dynamic, int cachedensity = 50, bool closed = true)
Parameters
interpolationCurvyInterpolationorientationCurvyOrientationcachedensityintclosedbool
Refresh()
Called to refresh the shape. Please call base.Refresh() or RefreshSpline() after your custom code!
public void Refresh()
Remarks
Warning: Only work with ControlPoints, not with segments
SetBezierHandles(int, float)
Sets a Control Point's Bezier Handles by index
protected void SetBezierHandles(int no, float distanceFrag)
Parameters
SetBezierHandles(int, float, float)
Sets a Control Point's Bezier Handles by index
protected void SetBezierHandles(int no, float inDistanceFrag, float outDistanceFrag)
Parameters
nointControl point index
inDistanceFragfloatdistance in percent for HandleIn
outDistanceFragfloatdistance in percent for HandleOut
SetBezierHandles(int, Vector3, Vector3, Space)
Sets a Control Point's Bezier Handles position
protected void SetBezierHandles(int no, Vector3 i, Vector3 o, Space space = Space.World)
Parameters
nointthe ControlPoint
iVector3HandlInPosition
oVector3HandleOutPosition
spaceSpaceWorld or local space
SetBezierHandles(float, bool, bool, params CurvySplineSegment[])
Automatically place Bezier handles for a set of Control Points
public static void SetBezierHandles(float distanceFrag, bool setIn, bool setOut, params CurvySplineSegment[] controlPoints)
Parameters
distanceFragfloathow much % distance between neighbouring CPs are applied to the handle length?
setInboolSet HandleIn?
setOutboolSet HandleOut?
controlPointsCurvySplineSegment[]one or more Control Points to set
SetCGHardEdges(params int[])
Enables CGHardEdge for a set of Control Points
protected void SetCGHardEdges(params int[] controlPoints)
Parameters
controlPointsint[]list of Control Point indices
SetPosition(int, Vector3)
Sets a Control Point's position by index
protected void SetPosition(int no, Vector3 position)
Parameters
nointControl point index
positionVector3local position
SetRotation(int, Quaternion)
Sets a Control Point's rotation by index
protected void SetRotation(int no, Quaternion rotation)
Parameters
nointControl point index
rotationQuaternionlocal rotation