Curvy  3.0.0
CurvyShape Class Reference
+ Inheritance diagram for CurvyShape:
+ Collaboration diagram for CurvyShape:

Detailed Description

Base class for CurvyShape components

Public Attributes

bool Dirty
 

Properties

bool Persistent [get, set]
 Whether this component is persistent or not More...
 
CurvyPlane Plane [get, set]
 Gets or sets the plane to create the shape in More...
 
static Dictionary< CurvyShapeInfo, System.Type > ShapeDefinitions [get]
 Dictionary of Shape definitions and their types More...
 
CurvySpline Spline [get]
 Gets the attached spline More...
 

Public Member Functions

void Delete ()
 Remove the CurvyShape component from it's GameObject More...
 
void Refresh ()
 Called to refresh the shape. Please call base.Refresh() or RefreshSpline() after your custom code! More...
 
CurvyShape Replace (string menuName)
 Replace the current script with another shape's script More...
 

Static Public Member Functions

static string GetShapeName (System.Type shapeType)
 Gets Shape Menu Name from a CurvyShape subclass type More...
 
static List< string > GetShapesMenuNames (bool only2D=false)
 Gets a list of Menu Names of available shapes More...
 
static List< string > GetShapesMenuNames (System.Type currentShapeType, out int currentIndex, bool only2D=false)
 Gets a list of Menu Names of available shapes More...
 
static Type GetShapeType (string menuName)
 Gets a CurvyShape subclass type from a Shape's MenuName More...
 
static void SetBezierHandles (float distanceFrag, bool setIn, bool setOut, params CurvySplineSegment[] controlPoints)
 Automatically place Bezier handles for a set of Control Points More...
 

Protected Member Functions

virtual void ApplyShape ()
 Override this to add custom code More...
 
void PrepareControlPoints (int count)
 Resizes the spline to have a certain number of Control Points More...
 
void PrepareSpline (CurvyInterpolation interpolation, CurvyOrientation orientation=CurvyOrientation.Dynamic, int cachedensity=50, bool closed=true)
 Sets basic spline parameters More...
 
void SetBezierHandles (int no, float distanceFrag)
 Sets a Control Point's Bezier Handles by index More...
 
void SetBezierHandles (int no, float inDistanceFrag, float outDistanceFrag)
 Sets a Control Point's Bezier Handles by index More...
 
void SetBezierHandles (int no, Vector3 i, Vector3 o, Space space=Space.World)
 Sets a Control Point's Bezier Handles position More...
 
void SetCGHardEdges (params int[] controlPoints)
 Enables CGHardEdge for a set of Control Points More...
 
void SetPosition (int no, Vector3 position)
 Sets a Control Point's position by index More...
 
void SetRotation (int no, Quaternion rotation)
 Sets a Control Point's rotation by index More...
 

Member Function Documentation

virtual void ApplyShape ( )
protectedvirtual

Override this to add custom code

Reimplemented in CSStar, CSPie, CSSpiral, CSRoundedRectangle, CSCircle, and CSRectangle.

void Delete ( )

Remove the CurvyShape component from it's GameObject

static string GetShapeName ( System.Type  shapeType)
static

Gets Shape Menu Name from a CurvyShape subclass type

Parameters
shapeType
Returns
static List<string> GetShapesMenuNames ( bool  only2D = false)
static

Gets a list of Menu Names of available shapes

Parameters
only2Dwhether to skip 3D shapes or not
Returns
a list of Menu Names
static List<string> GetShapesMenuNames ( System.Type  currentShapeType,
out int  currentIndex,
bool  only2D = false 
)
static

Gets a list of Menu Names of available shapes

Parameters
currentShapeTypethe current shape type
currentIndexreturns the index of the current shape type
only2Dwhether only to show 2D shapes
Returns
a list of Menu Names
static Type GetShapeType ( string  menuName)
static

Gets a CurvyShape subclass type from a Shape's MenuName

Parameters
menuName
Returns
void PrepareControlPoints ( int  count)
protected

Resizes the spline to have a certain number of Control Points

Parameters
countnumber of Control Points
void PrepareSpline ( CurvyInterpolation  interpolation,
CurvyOrientation  orientation = CurvyOrientation.Dynamic,
int  cachedensity = 50,
bool  closed = true 
)
protected

Sets basic spline parameters

void Refresh ( )

Called to refresh the shape. Please call base.Refresh() or RefreshSpline() after your custom code!

Warning: Only work with ControlPoints, not with segments

CurvyShape Replace ( string  menuName)

Replace the current script with another shape's script

Returns
the new shape script
void SetBezierHandles ( int  no,
float  distanceFrag 
)
protected

Sets a Control Point's Bezier Handles by index

Parameters
noControl point index
distanceFragdistance in percent
void SetBezierHandles ( int  no,
float  inDistanceFrag,
float  outDistanceFrag 
)
protected

Sets a Control Point's Bezier Handles by index

Parameters
noControl point index
inDistanceFragdistance in percent for HandleIn

///

Parameters
outDistanceFragdistance in percent for HandleOut
void SetBezierHandles ( int  no,
Vector3  i,
Vector3  o,
Space  space = Space.World 
)
protected

Sets a Control Point's Bezier Handles position

Parameters
nothe ControlPoint
iHandlInPosition
oHandleOutPosition
spaceWorld or local space
static void SetBezierHandles ( float  distanceFrag,
bool  setIn,
bool  setOut,
params CurvySplineSegment[]  controlPoints 
)
static

Automatically place Bezier handles for a set of Control Points

Parameters
distanceFraghow much % distance between neighbouring CPs are applied to the handle length?
setInSet HandleIn?
setOutSet HandleOut?
controlPointsone or more Control Points to set
void SetCGHardEdges ( params int[]  controlPoints)
protected

Enables CGHardEdge for a set of Control Points

Parameters
controlPointslist of Control Point indices
void SetPosition ( int  no,
Vector3  position 
)
protected

Sets a Control Point's position by index

Parameters
noControl point index
positionlocal position
void SetRotation ( int  no,
Quaternion  rotation 
)
protected

Sets a Control Point's rotation by index

Parameters
noControl point index
rotationlocal rotation

Member Data Documentation

bool Dirty

Property Documentation

bool Persistent
getset

Whether this component is persistent or not

CurvyPlane Plane
getset

Gets or sets the plane to create the shape in

Dictionary<CurvyShapeInfo, System.Type> ShapeDefinitions
staticget

Dictionary of Shape definitions and their types

CurvySpline Spline
get

Gets the attached spline


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