Class CGVolume
- Namespace
- FluffyUnderware.Curvy.Generator
Volume Data (Path + Vertex, VertexNormal, Cross)
[CGDataInfo(0.08, 0.4, 0.75, 1)]
public class CGVolume : CGPath
- Inheritance
-
CGVolume
- Inherited Members
Constructors
CGVolume(CGPath, CGShape)
Initializes a new instance of CGVolume from the given path and cross shape
public CGVolume(CGPath path, CGShape crossShape)
Parameters
pathCGPathThe path used in the creation of the volume
crossShapeCGShapeThe shape used as the cross section of the volume
CGVolume(CGVolume)
Initializes a new instance of CGVolume as a copy of the given volume
public CGVolume(CGVolume source)
Parameters
sourceCGVolumeThe volume to copy from
CGVolume(int, CGShape)
Initializes a new instance of CGVolume with the specified number of sample points and cross shape
public CGVolume(int samplePoints, CGShape crossShape)
Parameters
samplePointsintThe number of sample points along the path
crossShapeCGShapeThe shape used as the cross section of the volume
Fields
CrossClosed
Whether the Cross base spline is closed or not
public bool CrossClosed
Field Value
CrossFShift
A shift of the CrossRelativeDistances value that is applied when using the interpolation methods on the volume, like InterpolateVolume(float, float, out Vector3, out Vector3, out Vector3)
public float CrossFShift
Field Value
CrossMaterialGroups
Material groups for the cross shape
public SamplePointsMaterialGroupCollection CrossMaterialGroups
Field Value
CrossSeamless
Whether the Cross shape covers the whole length of the base spline
public bool CrossSeamless
Field Value
Properties
CrossCustomValues
The CustomValues of the CGShape used in the extrusion of this volume
public SubArray<float> CrossCustomValues { get; set; }
Property Value
Remarks
Setting a new SubArray<T> will Free(SubArray<T>) the current SubArray<T> instance
CrossRelativeDistances
The RelativeDistances of the CGShape used in the extrusion of this volume
public SubArray<float> CrossRelativeDistances { get; set; }
Property Value
Remarks
Setting a new SubArray<T> will Free(SubArray<T>) the current SubArray<T> instance
CrossSize
Gets the number of cross shape's sample points
public int CrossSize { get; }
Property Value
Scales
The 2D scale of the mesh at each sample point of the volume's path
public SubArray<Vector2> Scales { get; set; }
Property Value
- SubArray<Vector2>
VertexCount
Gets the total number of vertices in the volume
public int VertexCount { get; }
Property Value
VertexNormals
Normals of the points, in the local space
public SubArray<Vector3> VertexNormals { get; set; }
Property Value
- SubArray<Vector3>
Remarks
Setting a new SubArray<T> will Free(SubArray<T>) the current SubArray<T> instance
Vertices
Positions of the points, in the local space
public SubArray<Vector3> Vertices { get; set; }
Property Value
- SubArray<Vector3>
Remarks
Setting a new SubArray<T> will Free(SubArray<T>) the current SubArray<T> instance
Methods
Clone<T>()
Creates a copy of this data instance
public override T Clone<T>() where T : CGData
Returns
- T
Type Parameters
T
CrossDistanceToF(float, float, CurvyClamping)
Converts an absolute distance along the cross shape to a relative cross position
public float CrossDistanceToF(float pathF, float distance, CurvyClamping crossClamping = CurvyClamping.Clamp)
Parameters
pathFfloatdistancefloatcrossClampingCurvyClamping
Returns
CrossFToDistance(float, float, CurvyClamping)
Converts a cross position to an absolute distance along the cross shape
public float CrossFToDistance(float pathF, float crossF, CurvyClamping crossClamping = CurvyClamping.Clamp)
Parameters
pathFfloatcrossFfloatcrossClampingCurvyClamping
Returns
Dispose(bool)
protected override bool Dispose(bool disposing)
Parameters
disposingbool
Returns
Get(CGVolume, CGPath, CGShape)
Returns a CGVolume made from the given CGPath and CGShape
[NotNull]
public static CGVolume Get(CGVolume data, CGPath path, CGShape crossShape)
Parameters
dataCGVolumeIf not null, the returned instance will be the one but with its fields updated. If null, a new instance will be created
pathCGPathThe path used in the creation of the volume
crossShapeCGShapeThe shape used in the creation of the volume
Returns
GetCrossFIndex(float, out float)
Gets the index within the cross shape for a given relative cross position
public int GetCrossFIndex(float crossF, out float frag)
Parameters
crossFfloatPosition along the cross shape (0..1)
fragfloatThe interpolation value between the returned index and the next index, defining the exact position of the input point between those two points
Returns
GetCrossLength(float)
Gets the length of the cross shape at the given path position
public float GetCrossLength(float pathF)
Parameters
pathFfloatPosition along the path (0..1)
Returns
- float
The length of the cross shape at the specified path position
GetSegmentIndex(int)
Gets the vertex index of the first vertex of a given segment
public int GetSegmentIndex(int segment)
Parameters
segmentint
Returns
GetSegmentVertices(params int[])
Gets all vertices belonging to one or more extruded shape segments
public Vector3[] GetSegmentVertices(params int[] segmentIndices)
Parameters
segmentIndicesint[]Indices of segments in question
Returns
- Vector3[]
An array of vertices for the specified segments
GetVertexIndex(float, float, out float, out float)
Get the index of the first vertex of the edge a certain F and CrossF is part of
public int GetVertexIndex(float pathF, float crossF, out float pathFrag, out float crossFrag)
Parameters
pathFfloatposition on the path (0..1)
crossFfloatposition on the cross (0..1)
pathFragfloatremainder between the segment and the next segment
crossFragfloatremainder between the returned vertex and the next vertex
Returns
- int
a vertex index
GetVertexIndex(float, out float)
Get the index of the first vertex belonging to the segment a certain F is part of
public int GetVertexIndex(float pathF, out float pathFrag)
Parameters
pathFfloatposition on the path (0..1)
pathFragfloatremainder between the returned segment and the next segment
Returns
- int
a vertex index
InterpolateVolume(float, float, out Vector3, out Vector3, out Vector3)
Interpolates the volume's position, direction, and up vector at the given path and cross positions
public void InterpolateVolume(float pathF, float crossF, out Vector3 pos, out Vector3 dir, out Vector3 up)
Parameters
pathFfloatPosition along the path (0..1)
crossFfloatPosition along the cross shape (0..1)
posVector3The interpolated positione
dirVector3The interpolated direction (tangent)
upVector3The interpolated up vector (normal)
InterpolateVolumeDirection(float, float)
Interpolates the volume's direction (tangent) at the given path and cross positions
public Vector3 InterpolateVolumeDirection(float pathF, float crossF)
Parameters
Returns
- Vector3
The interpolated direction
InterpolateVolumePosition(float, float)
Interpolates the volume's position at the given path and cross positions
public Vector3 InterpolateVolumePosition(float pathF, float crossF)
Parameters
Returns
- Vector3
The interpolated position
InterpolateVolumeUp(float, float)
Interpolates the volume's up vector (normal) at the given path and cross positions
public Vector3 InterpolateVolumeUp(float pathF, float crossF)
Parameters
Returns
- Vector3
The interpolated up vector