Class ScalingModule
- Namespace
- FluffyUnderware.Curvy.Generator.Modules
A base class for CG modules that wish to scale objects along a path or shape
public abstract class ScalingModule : CGModule
- Inheritance
-
ObjectComponentBehaviourMonoBehaviourDTVersionedMonoBehaviourScalingModule
- Derived
- Inherited Members
Properties
ScaleMode
public ScaleMode ScaleMode { get; set; }
Property Value
ScaleMultiplierX
Defines a scale multiplier relatively to the Relative Distance of a point on the path.
public AnimationCurve ScaleMultiplierX { get; set; }
Property Value
- AnimationCurve
Remarks
ScaleMultiplierY
Defines a scale multiplier relatively to the Relative Distance of a point on the path.
public AnimationCurve ScaleMultiplierY { get; set; }
Property Value
- AnimationCurve
Remarks
ScaleOffset
Scale is applied starting at this offset
public float ScaleOffset { get; set; }
Property Value
Remarks
ScaleReference
Determines on what range the scale is applied: Self: the scale is applied over the Path's active range Source: the scale is applied over the Path's total length
public CGReferenceMode ScaleReference { get; set; }
Property Value
Remarks
ScaleUniform
If enabled, the same scale is applied to both X and Y axis of the cross section
public bool ScaleUniform { get; set; }
Property Value
ScaleX
The (base) value of the scaling along the cross section's X axis
public float ScaleX { get; set; }
Property Value
ScaleY
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
public float ScaleY { get; set; }
Property Value
Methods
GetAdvancedScale(float, float, bool, float, AnimationCurve, float, AnimationCurve)
Get the scale value along the x and y axis for a point on a path
protected static Vector2 GetAdvancedScale(float relativeDistance, float scaleOffset, bool isUniform, float scaleX, AnimationCurve scaleMultiplierX, float scaleY, AnimationCurve scaleMultiplierY)
Parameters
relativeDistance
floatA 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)
scaleOffset
floatisUniform
boolscaleX
floatscaleMultiplierX
AnimationCurvescaleY
floatscaleMultiplierY
AnimationCurve
Returns
- Vector2
GetRelativeDistance(int, CGReferenceMode, SubArray<float>, SubArray<float>)
Get the relative distance of a sample point
protected static float GetRelativeDistance(int sampleIndex, CGReferenceMode cgReferenceMode, SubArray<float> relativeDistances, SubArray<float> sourceRelativeDistances)
Parameters
sampleIndex
intthe index of the sample point in the path's RelativeDistances and SourceRelativeDistances
cgReferenceMode
CGReferenceModerelativeDistances
SubArray<float>sourceRelativeDistances
SubArray<float>
Returns
Exceptions
- ArgumentOutOfRangeException
If
cgReferenceMode
has an invalid value
GetScale(int, SubArray<float>, SubArray<float>)
Get the scale value along the x and y axis for a point on a path
protected Vector2 GetScale(int sampleIndex, SubArray<float> relativeDistances, SubArray<float> sourceRelativeDistances)
Parameters
sampleIndex
intthe index of the point in the path's RelativeDistances and SourceRelativeDistances
relativeDistances
SubArray<float>sourceRelativeDistances
SubArray<float>
Returns
- Vector2
Exceptions
- ArgumentOutOfRangeException
If ScaleMode has an invalid value
GetScale(float)
Gets the scale vector of a cross section at a specific position on a path
public Vector2 GetScale(float relativeDistance)
Parameters
relativeDistance
floatA 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
- Vector2
The X and Y value are the scale value along those axis
GetScale(float, ScaleMode, float, bool, float, AnimationCurve, float, AnimationCurve)
Get the scale value along the x and y axis for a point on a path
protected static Vector2 GetScale(float relativeDistance, ScaleMode mode, float offset, bool isUniform, float scaleX, AnimationCurve scaleMultiplierX, float scaleY, AnimationCurve scaleMultiplierY)
Parameters
relativeDistance
floatA 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)
mode
ScaleModeoffset
floatisUniform
boolscaleX
floatscaleMultiplierX
AnimationCurvescaleY
floatscaleMultiplierY
AnimationCurve
Returns
- Vector2
Exceptions
- ArgumentOutOfRangeException
If
mode
has an invalid value
GetSimpleScale(bool, float, float)
Get the scale value along the x and y axis
protected static Vector2 GetSimpleScale(bool isUniform, float scaleX, float scaleY)
Parameters
Returns
- Vector2