Curvy  8.3.0
ScalingModule Class Reference
+ Inheritance diagram for ScalingModule:
+ Collaboration diagram for ScalingModule:

Detailed Description

A base class for CG modules that wish to scale objects along a path or shape

Properties

ScaleMode ScaleMode [get, set]
 Modules.ScaleMode More...
 
AnimationCurve ScaleMultiplierX [get, set]
 Defines a scale multiplier relatively to the Relative Distance of a point on the path. More...
 
AnimationCurve ScaleMultiplierY [get, set]
 Defines a scale multiplier relatively to the Relative Distance of a point on the path. More...
 
float ScaleOffset [get, set]
 Scale is applied starting at this offset More...
 
CGReferenceMode ScaleReference [get, set]
 Determines on what range the scale is applied: CGReferenceMode.Self: the scale is applied over the Path's active range CGReferenceMode.Source: the scale is applied over the Path's total length More...
 
bool ScaleUniform [get, set]
 If enabled, the same scale is applied to both X and Y axis of the cross section More...
 
float ScaleX [get, set]
 The (base) value of the scaling along the cross section's X axis More...
 
float ScaleY [get, set]
 The (base) value of the scaling along the cross section's Y axis if ScaleUniform is set to false, otherwise the ScaleX value is used instead More...
 
- Properties inherited from CGModule
bool Active [get, set]
 
bool CircularReferenceError [get, set]
 Whether this module has circular reference errors More...
 
bool Dirty [get, set]
 
CurvyGenerator Generator [get]
 
ModuleInfoAttribute Info [get]
 
List< CGModuleInputSlotInput [get]
 
Dictionary< string, CGModuleInputSlotInputByName [get]
 
virtual bool IsConfigured [get]
 Gets whether the module is properly configured i.e. has everything to work like intended More...
 
virtual bool IsInitialized [get]
 Gets whether the module and all its dependencies are fully initialized More...
 
string ModuleName [get, set]
 
CurvyCGEvent OnBeforeRefresh [get, set]
 
CurvyCGEvent OnRefresh [get, set]
 
List< CGModuleOutputSlotOutput [get]
 
Dictionary< string, CGModuleOutputSlotOutputByName [get]
 
bool RandomizeSeed [get, set]
 If is set to false, Seed is used to initialize Unity's random numbers generator before refreshing the current module. If set to true, a random seed will be used More...
 
int Seed [get, set]
 If RandomizeSeed is set to false, Seed is used to initialize Unity's random numbers generator before refreshing the If RandomizeSeed is set to true, a random seed will be used current module More...
 
int UniqueID [get]
 

Public Member Functions

Vector2 GetScale (float relativeDistance)
 Gets the scale vector of a cross section at a specific position on a path More...
 
- Public Member Functions inherited from CGModule
Component AddManagedResource (string resourceName, string context="", int index=-1)
 
CGModule CopyTo (CurvyGenerator targetGenerator)
 
void Delete ()
 
virtual bool DeleteAllOutputManagedResources ()
 Delete all the managed resources acting as an output. One example of this are the generated meshes by the FluffyUnderware.Curvy.Generator.Modules.CreateMesh module More...
 
void DeleteAllPrefabPools ()
 
void DeleteManagedResource (string resourceName, Component res, [NotNull] string context="", bool dontUsePool=false)
 
List< IPool > GetAllPrefabPools ()
 
CGModuleLink GetInputLink (CGModuleInputSlot inSlot, CGModuleOutputSlot outSlot)
 
List< CGModuleLinkGetInputLinks (CGModuleInputSlot inSlot)
 
CGModuleInputSlot GetInputSlot (string name)
 
List< CGModuleInputSlotGetInputSlots (System.Type filterType=null)
 
bool GetManagedResources (out List< Component > components, out List< string > resourceNames)
 
CGModuleLink GetOutputLink (CGModuleOutputSlot outSlot, CGModuleInputSlot inSlot)
 
List< CGModuleLinkGetOutputLinks (CGModuleOutputSlot outSlot)
 
CGModuleOutputSlot GetOutputSlot (string name)
 
List< CGModuleOutputSlotGetOutputSlots (System.Type filterType=null)
 
void Initialize ()
 
bool IsManagedResource (Component res)
 
virtual void OnStateChange ()
 Called when a module's state changes (Link added/removed, Active toggles etc..) More...
 
virtual void OnTemplateCreated ()
 Called after a module was copied to a template More...
 
virtual void Refresh ()
 Add Module processing code in here More...
 
void ReInitializeLinkedSlots ()
 
virtual void Reset ()
 

Protected Member Functions

Vector2 GetScale (int sampleIndex, SubArray< float > relativeDistances, SubArray< float > sourceRelativeDistances)
 Get the scale value along the x and y axis for a point on a path More...
 
- Protected Member Functions inherited from CGModule
virtual void Awake ()
 
CurvyCGEventArgs OnBeforeRefreshEvent (CurvyCGEventArgs e)
 
virtual void OnDestroy ()
 
virtual void OnDisable ()
 
virtual void OnEnable ()
 
CurvyCGEventArgs OnRefreshEvent (CurvyCGEventArgs e)
 

Static Protected Member Functions

static Vector2 GetAdvancedScale (float relativeDistance, float scaleOffset, bool isUniform, float scaleX, AnimationCurve scaleMultiplierX, float scaleY, AnimationCurve scaleMultiplierY)
 Get the scale value along the x and y axis for a point on a path More...
 
static float GetRelativeDistance (int sampleIndex, CGReferenceMode cgReferenceMode, SubArray< float > relativeDistances, SubArray< float > sourceRelativeDistances)
 Get the relative distance of a sample point More...
 
static Vector2 GetScale (float relativeDistance, ScaleMode mode, float offset, bool isUniform, float scaleX, AnimationCurve scaleMultiplierX, float scaleY, AnimationCurve scaleMultiplierY)
 Get the scale value along the x and y axis for a point on a path More...
 
static Vector2 GetSimpleScale (bool isUniform, float scaleX, float scaleY)
 Get the scale value along the x and y axis More...
 
- Static Protected Member Functions inherited from CGModule
static T GetRequestParameter< T > (ref CGDataRequestParameter[] requests)
 Gets a request parameter of a certain type More...
 
static void RemoveRequestParameter (ref CGDataRequestParameter[] requests, CGDataRequestParameter request)
 Removes a certain request parameter from the requests array More...
 

Additional Inherited Members

- Public Attributes inherited from CGModule
List< CGModuleLinkInputLinks = new List<CGModuleLink>()
 
List< CGModuleLinkOutputLinks = new List<CGModuleLink>()
 
CGModuleProperties Properties = new CGModuleProperties()
 
List< string > UIMessages = new List<string>()
 

Member Function Documentation

static Vector2 GetAdvancedScale ( float  relativeDistance,
float  scaleOffset,
bool  isUniform,
float  scaleX,
AnimationCurve  scaleMultiplierX,
float  scaleY,
AnimationCurve  scaleMultiplierY 
)
staticprotected

Get the scale value along the x and y axis for a point on a path

Parameters
relativeDistanceA value between 0 and 1 representing how far the point is on a pah. A value of 0 means the start of the path, and a value of 1 means the end of it. It is defined as: (the point's distance from the path's start) / (the total length of the path)
scaleOffsetScaleOffset
isUniformScaleUniform
scaleXScaleX
scaleMultiplierXScaleMultiplierX
scaleYScaleY
scaleMultiplierYScaleMultiplierY
static float GetRelativeDistance ( int  sampleIndex,
CGReferenceMode  cgReferenceMode,
SubArray< float >  relativeDistances,
SubArray< float >  sourceRelativeDistances 
)
staticprotected

Get the relative distance of a sample point

Parameters
sampleIndexthe index of the sample point in the path's CGShape.RelativeDistances and CGShape.SourceRelativeDistances
cgReferenceModeScaleReference
relativeDistancesCGShape.RelativeDistances
sourceRelativeDistancesCGShape.SourceRelativeDistances
Returns
Exceptions
ArgumentOutOfRangeExceptionIf cgReferenceMode has an invalid value
Vector2 GetScale ( float  relativeDistance)

Gets the scale vector of a cross section at a specific position on a path

Parameters
relativeDistanceA value between 0 and 1 representing how far the point is on a pah. A value of 0 means the start of the path, and a value of 1 means the end of it. It is defined as: (the point's distance from the path's start) / (the total length of the path)
Returns
The X and Y value are the scale value along those axis
Vector2 GetScale ( int  sampleIndex,
SubArray< float >  relativeDistances,
SubArray< float >  sourceRelativeDistances 
)
protected

Get the scale value along the x and y axis for a point on a path

Parameters
sampleIndexthe index of the point in the path's CGShape.RelativeDistances and CGShape.SourceRelativeDistances
relativeDistancesCGShape.RelativeDistances
sourceRelativeDistancesCGShape.SourceRelativeDistances
Returns
Exceptions
ArgumentOutOfRangeExceptionIf ScaleMode has an invalid value
static Vector2 GetScale ( float  relativeDistance,
ScaleMode  mode,
float  offset,
bool  isUniform,
float  scaleX,
AnimationCurve  scaleMultiplierX,
float  scaleY,
AnimationCurve  scaleMultiplierY 
)
staticprotected

Get the scale value along the x and y axis for a point on a path

Parameters
relativeDistanceA value between 0 and 1 representing how far the point is on a pah. A value of 0 means the start of the path, and a value of 1 means the end of it. It is defined as: (the point's distance from the path's start) / (the total length of the path)
modeScaleMode
offsetScaleOffset
isUniformScaleUniform
scaleXScaleX
scaleMultiplierXScaleMultiplierX
scaleYScaleY
scaleMultiplierYScaleMultiplierY
Exceptions
ArgumentOutOfRangeExceptionIf mode has an invalid value
static Vector2 GetSimpleScale ( bool  isUniform,
float  scaleX,
float  scaleY 
)
staticprotected

Get the scale value along the x and y axis

Parameters
isUniformScaleUniform
scaleXScaleX
scaleYScaleY
Returns

Property Documentation

AnimationCurve ScaleMultiplierX
getset

Defines a scale multiplier relatively to the Relative Distance of a point on the path.

Considered only when ScaleMode is set to Modules.ScaleMode.Advanced

You will need to set this module's Dirty to true yourself if you modify the AnimationCurve without setting a new one

AnimationCurve ScaleMultiplierY
getset

Defines a scale multiplier relatively to the Relative Distance of a point on the path.

Considered only when ScaleMode is set to Modules.ScaleMode.Advanced

You will need to set this module's Dirty to true yourself if you modify the AnimationCurve without setting a new one

float ScaleOffset
getset

Scale is applied starting at this offset

Considered only when ScaleMode is set to Modules.ScaleMode.Advanced

CGReferenceMode ScaleReference
getset

Determines on what range the scale is applied: CGReferenceMode.Self: the scale is applied over the Path's active range CGReferenceMode.Source: the scale is applied over the Path's total length

Considered only when ScaleMode is set to Modules.ScaleMode.Advanced

bool ScaleUniform
getset

If enabled, the same scale is applied to both X and Y axis of the cross section

float ScaleX
getset

The (base) value of the scaling along the cross section's X axis

float ScaleY
getset

The (base) value of the scaling along the cross section's Y axis if ScaleUniform is set to false, otherwise the ScaleX value is used instead


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