Class CGVMesh
- Namespace
- FluffyUnderware.Curvy.Generator
Mesh Data (Bounds + Vertex,UV,UV2,Normal,Tangents,SubMehes)
[CGDataInfo(0.98, 0.5, 0, 1)]
public class CGVMesh : CGBounds
- Inheritance
-
CGVMesh
- Inherited Members
Constructors
CGVMesh()
public CGVMesh()
CGVMesh(CGMeshProperties)
public CGVMesh(CGMeshProperties meshProperties)
Parameters
meshPropertiesCGMeshProperties
CGVMesh(CGVMesh)
public CGVMesh(CGVMesh source)
Parameters
sourceCGVMesh
CGVMesh(CGVolume)
public CGVMesh(CGVolume volume)
Parameters
volumeCGVolume
CGVMesh(CGVolume, IntRegion)
public CGVMesh(CGVolume volume, IntRegion subset)
Parameters
volumeCGVolumesubsetIntRegion
CGVMesh(int, bool, bool, bool, bool)
public CGVMesh(int vertexCount, bool addUV = false, bool addUV2 = false, bool addNormals = false, bool addTangents = false)
Parameters
CGVMesh(Mesh, Material[], Matrix4x4)
public CGVMesh(Mesh source, Material[] materials, Matrix4x4 trsMatrix)
Parameters
sourceMeshmaterialsMaterial[]trsMatrixMatrix4x4
Fields
SubMeshes
public CGVSubMesh[] SubMeshes
Field Value
Properties
Count
Gets the number of vertices
public override int Count { get; }
Property Value
HasNormals
True if at least one vertex has a normal
public bool HasNormals { get; }
Property Value
HasPartialNormals
True if HasNormals but not all vertices have normals
public bool HasPartialNormals { get; }
Property Value
HasPartialTangents
True if HasTangents but not all vertices have tangents
public bool HasPartialTangents { get; }
Property Value
HasTangents
True if at least one vertex has a tangent
public bool HasTangents { get; }
Property Value
HasUV
public bool HasUV { get; }
Property Value
HasUV2
public bool HasUV2 { get; }
Property Value
NormalsList
Normals of the points, in the local space
public SubArray<Vector3> NormalsList { get; set; }
Property Value
- SubArray<Vector3>
Remarks
Setting a new SubArray<T> will Free(SubArray<T>) the current SubArray<T> instance
TangentsList
Tangents of the points, in the local space
public SubArray<Vector4> TangentsList { get; set; }
Property Value
- SubArray<Vector4>
Remarks
Setting a new SubArray<T> will Free(SubArray<T>) the current SubArray<T> instance
TriangleCount
public int TriangleCount { get; }
Property Value
UV2s
UV2s of the points
public SubArray<Vector2> UV2s { get; set; }
Property Value
- SubArray<Vector2>
Remarks
Setting a new SubArray<T> will Free(SubArray<T>) the current SubArray<T> instance
UVs
UVs of the points
public SubArray<Vector2> UVs { get; set; }
Property Value
- SubArray<Vector2>
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
AddSubMesh(CGVSubMesh)
public void AddSubMesh(CGVSubMesh submesh = null)
Parameters
submeshCGVSubMesh
Clone<T>()
public override T Clone<T>() where T : CGData
Returns
- T
Type Parameters
T
Dispose(bool)
protected override bool Dispose(bool disposing)
Parameters
disposingbool
Returns
Get(CGVMesh, CGVolume, IntRegion, bool, bool, bool)
[NotNull]
public static CGVMesh Get(CGVMesh data, CGVolume source, IntRegion subset, bool addUV, bool addUV2, bool reverseNormals)
Parameters
Returns
GetCachedSortedVertexIndices()
Gets an array of the index of vertices when sorted by Z coordinate, from smaller to bigger. This array is cached. Curvy Splines makes sure the cache is valid when it modifies Vertices. Whoever, if you modify yourself Vertices through its getter, the cache will become outdated.
public SubArray<int> GetCachedSortedVertexIndices()
Returns
Remarks
Is thread safe
GetMaterialSubMesh(Material, bool)
Gets the submesh using a certain material
public CGVSubMesh GetMaterialSubMesh(Material mat, bool createIfMissing = true)
Parameters
matMaterialthe material the submesh should use
createIfMissingboolwhether to create the submesh if no existing one matches
Returns
- CGVSubMesh
a submesh using the given material
GetMaterials()
Gets a list of all Materials used
public Material[] GetMaterials()
Returns
- Material[]
MergeVMesh(CGVMesh)
Combine/Merge another VMesh into this
public void MergeVMesh(CGVMesh source)
Parameters
sourceCGVMesh
MergeVMesh(CGVMesh, Matrix4x4)
Combine/Merge another VMesh into this, applying a matrix
public void MergeVMesh(CGVMesh source, Matrix4x4 matrix)
Parameters
sourceCGVMeshmatrixMatrix4x4
MergeVMeshes(List<CGVMesh>, int, int)
Combine/Merge multiple CGVMeshes into this
public void MergeVMeshes(List<CGVMesh> vMeshes, int startIndex, int endIndex)
Parameters
vMeshesList<CGVMesh>list of CGVMeshes
startIndexintIndex of the first element of the list to merge
endIndexintIndex of the last element of the list to merge
RecalculateBounds()
public override void RecalculateBounds()
SetSubMeshCount(int)
public void SetSubMeshCount(int count)
Parameters
countint
TRS(Matrix4x4)
Applies the translation, rotation and scale defined by the given matrix
public void TRS(Matrix4x4 matrix)
Parameters
matrixMatrix4x4
ToMesh(ref Mesh, bool, bool)
Copies the data into an existing Mesh
public void ToMesh(ref Mesh mesh, bool includeNormals = true, bool includeTangents = true)