Curvy  8.4.0
CGVMesh Class Reference
+ Inheritance diagram for CGVMesh:
+ Collaboration diagram for CGVMesh:

Detailed Description

Mesh Data (Bounds + Vertex,UV,UV2,Normal,Tangents,SubMehes)

Public Attributes

CGVSubMesh[] SubMeshes
 
- Public Attributes inherited from CGData
string Name
 

Properties

override int Count [get]
 Gets the number of vertices More...
 
bool HasNormals [get]
 True if at least one vertex has a normal More...
 
bool HasPartialNormals [get]
 True if HasNormals but not all vertices have normals More...
 
bool HasPartialTangents [get]
 True if HasTangents but not all vertices have tangents More...
 
bool HasTangents [get]
 True if at least one vertex has a tangent More...
 
bool HasUV [get]
 
bool HasUV2 [get]
 
Vector3[] Normals [get, set]
 Normals of the points, in the local space More...
 
SubArray< Vector3 > NormalsList [get, set]
 Normals of the points, in the local space More...
 
Vector4[] Tangents [get, set]
 Tangents of the points, in the local space More...
 
SubArray< Vector4 > TangentsList [get, set]
 Tangents of the points, in the local space More...
 
int TriangleCount [get]
 
Vector2[] UV [get, set]
 UVs of the points More...
 
Vector2[] UV2 [get, set]
 UV2s of the points More...
 
SubArray< Vector2 > UV2s [get, set]
 UV2s of the points More...
 
SubArray< Vector2 > UVs [get, set]
 UVs of the points More...
 
Vector3[] Vertex [get, set]
 Positions of the points, in the local space More...
 
SubArray< Vector3 > Vertices [get, set]
 Positions of the points, in the local space More...
 
- Properties inherited from CGBounds
Bounds Bounds [get, set]
 
float Depth [get]
 
- Properties inherited from CGData
virtual int Count [get]
 

Public Member Functions

void AddSubMesh (CGVSubMesh submesh=null)
 
Mesh AsMesh ()
 Creates a Mesh from the data More...
 
 CGVMesh ()
 
 CGVMesh (int vertexCount, bool addUV=false, bool addUV2=false, bool addNormals=false, bool addTangents=false)
 
 CGVMesh (CGVolume volume)
 
 CGVMesh (CGVolume volume, IntRegion subset)
 
 CGVMesh (CGVMesh source)
 
 CGVMesh (CGMeshProperties meshProperties)
 
 CGVMesh (Mesh source, Material[] materials, Matrix4x4 trsMatrix)
 
override T Clone< T > ()
 
SubArray< int > GetCachedSortedVertexIndices ()
 Gets an array of the index of vertices when sorted by Z coordinate, from smaller to bigger. This array is cached. Curvy Splines does clear this cache if it modifies Vertices, but if you modify Vertices through its getter, you will have to clear the cached value by calling ClearCachedSortedVertexIndices More...
 
Material[] GetMaterials ()
 Gets a list of all Materials used More...
 
CGVSubMesh GetMaterialSubMesh (Material mat, bool createIfMissing=true)
 Gets the submesh using a certain material More...
 
void MergeVMesh (CGVMesh source)
 Combine/Merge another VMesh into this More...
 
void MergeVMesh (CGVMesh source, Matrix4x4 matrix)
 Combine/Merge another VMesh into this, applying a matrix More...
 
void MergeVMeshes (List< CGVMesh > vMeshes, int startIndex, int endIndex)
 Combine/Merge multiple CGVMeshes into this More...
 
override void RecalculateBounds ()
 
void RecalculateUV2 ()
 
void SetSubMeshCount (int count)
 
void ToMesh (ref Mesh mesh, bool includeNormals=true, bool includeTangents=true)
 Copies the data into an existing Mesh More...
 
void TRS (Matrix4x4 matrix)
 Applies the translation, rotation and scale defined by the given matrix More...
 
- Public Member Functions inherited from CGBounds
 CGBounds ()
 
 CGBounds (Bounds bounds)
 
 CGBounds (CGBounds source)
 
- Public Member Functions inherited from CGData
void Dispose ()
 Disposes an instance that is no more used, allowing it to free its resources immediately. Dispose is called automatically when an instance is Finalized More...
 

Static Public Member Functions

static CGVMesh Get (CGVMesh data, CGVolume source, bool addUV, bool reverseNormals)
 
static CGVMesh Get (CGVMesh data, CGVolume source, IntRegion subset, bool addUV, bool reverseNormals)
 
static CGVMesh Get (CGVMesh data, CGVolume source, IntRegion subset, bool addUV, bool addUV2, bool reverseNormals)
 
- Static Public Member Functions inherited from CGBounds
static void Copy (CGBounds dest, CGBounds source)
 
- Static Public Member Functions inherited from CGData
static implicit operator bool (CGData a)
 

Protected Member Functions

override bool Dispose (bool disposing)
 
- Protected Member Functions inherited from CGData
int getGenericFIndex (SubArray< float > FMapArray, float fValue, out float frag)
 Searches FMapArray and returns the index that covers the fValue as well as the percentage between index and index+1 More...
 

Additional Inherited Members

- Protected Attributes inherited from CGBounds
Bounds mBounds
 

Constructor & Destructor Documentation

CGVMesh ( )
CGVMesh ( int  vertexCount,
bool  addUV = false,
bool  addUV2 = false,
bool  addNormals = false,
bool  addTangents = false 
)
CGVMesh ( CGVolume  volume)
CGVMesh ( CGVolume  volume,
IntRegion  subset 
)
CGVMesh ( CGVMesh  source)
CGVMesh ( CGMeshProperties  meshProperties)
CGVMesh ( Mesh  source,
Material[]  materials,
Matrix4x4  trsMatrix 
)

Member Function Documentation

void AddSubMesh ( CGVSubMesh  submesh = null)
Mesh AsMesh ( )

Creates a Mesh from the data

override T Clone< T > ( )
virtual

Reimplemented from CGBounds.

override bool Dispose ( bool  disposing)
protectedvirtual

Reimplemented from CGData.

static CGVMesh Get ( CGVMesh  data,
CGVolume  source,
bool  addUV,
bool  reverseNormals 
)
static
static CGVMesh Get ( CGVMesh  data,
CGVolume  source,
IntRegion  subset,
bool  addUV,
bool  reverseNormals 
)
static
static CGVMesh Get ( CGVMesh  data,
CGVolume  source,
IntRegion  subset,
bool  addUV,
bool  addUV2,
bool  reverseNormals 
)
static
SubArray<int> GetCachedSortedVertexIndices ( )

Gets an array of the index of vertices when sorted by Z coordinate, from smaller to bigger. This array is cached. Curvy Splines does clear this cache if it modifies Vertices, but if you modify Vertices through its getter, you will have to clear the cached value by calling ClearCachedSortedVertexIndices

Is thread safe

Material [] GetMaterials ( )

Gets a list of all Materials used

CGVSubMesh GetMaterialSubMesh ( Material  mat,
bool  createIfMissing = true 
)

Gets the submesh using a certain material

Parameters
matthe material the submesh should use
createIfMissingwhether to create the submesh if no existing one matches
Returns
a submesh using the given material
void MergeVMesh ( CGVMesh  source)

Combine/Merge another VMesh into this

Parameters
source
void MergeVMesh ( CGVMesh  source,
Matrix4x4  matrix 
)

Combine/Merge another VMesh into this, applying a matrix

Parameters
source
matrix
void MergeVMeshes ( List< CGVMesh vMeshes,
int  startIndex,
int  endIndex 
)

Combine/Merge multiple CGVMeshes into this

Parameters
vMesheslist of CGVMeshes
startIndexIndex of the first element of the list to merge
endIndexIndex of the last element of the list to merge
override void RecalculateBounds ( )
virtual

Reimplemented from CGBounds.

void RecalculateUV2 ( )
void SetSubMeshCount ( int  count)
void ToMesh ( ref Mesh  mesh,
bool  includeNormals = true,
bool  includeTangents = true 
)

Copies the data into an existing Mesh

Parameters
meshThe mesh to copy the data from this CGVMesh into
includeNormalsshould normals be copied or set to empty?
includeTangentsshould tangents be copied or set to empty?
void TRS ( Matrix4x4  matrix)

Applies the translation, rotation and scale defined by the given matrix

Member Data Documentation

CGVSubMesh [] SubMeshes

Property Documentation

override int Count
get

Gets the number of vertices

bool HasNormals
get

True if at least one vertex has a normal

bool HasPartialNormals
get

True if HasNormals but not all vertices have normals

bool HasPartialTangents
get

True if HasTangents but not all vertices have tangents

bool HasTangents
get

True if at least one vertex has a tangent

bool HasUV
get
bool HasUV2
get
Vector3 [] Normals
getset

Normals of the points, in the local space

This getter returns a copy of the actual array. For performance reasons, use the equivalent getter returning a SubArray<T> instance, which allows you to directly access and modify the underlying array

SubArray<Vector3> NormalsList
getset

Normals of the points, in the local space

Setting a new SubArray<T> will ArrayPool<T>.Free(ToolBuddy.Pooling.Collections.SubArray<T>) the current SubArray<T> instance

Vector4 [] Tangents
getset

Tangents of the points, in the local space

This getter returns a copy of the actual array. For performance reasons, use the equivalent getter returning a SubArray<T> instance, which allows you to directly access and modify the underlying array

SubArray<Vector4> TangentsList
getset

Tangents of the points, in the local space

Setting a new SubArray<T> will ArrayPool<T>.Free(ToolBuddy.Pooling.Collections.SubArray<T>) the current SubArray<T> instance

int TriangleCount
get
Vector2 [] UV
getset

UVs of the points

This getter returns a copy of the actual array. For performance reasons, use the equivalent getter returning a SubArray<T> instance, which allows you to directly access and modify the underlying array

Vector2 [] UV2
getset

UV2s of the points

This getter returns a copy of the actual array. For performance reasons, use the equivalent getter returning a SubArray<T> instance, which allows you to directly access and modify the underlying array

SubArray<Vector2> UV2s
getset

UV2s of the points

Setting a new SubArray<T> will ArrayPool<T>.Free(ToolBuddy.Pooling.Collections.SubArray<T>) the current SubArray<T> instance

SubArray<Vector2> UVs
getset

UVs of the points

Setting a new SubArray<T> will ArrayPool<T>.Free(ToolBuddy.Pooling.Collections.SubArray<T>) the current SubArray<T> instance

Vector3 [] Vertex
getset

Positions of the points, in the local space

This getter returns a copy of the actual array. For performance reasons, use the equivalent getter returning a SubArray<T> instance, which allows you to directly access and modify the underlying array

SubArray<Vector3> Vertices
getset

Positions of the points, in the local space

Setting a new SubArray<T> will ArrayPool<T>.Free(ToolBuddy.Pooling.Collections.SubArray<T>) the current SubArray<T> instance

If you modify the content of the returned array, make sure to call ClearCachedSortedVertexIndices before calling GetCachedSortedVertexIndices


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