Interface IGeometryGroup
Represents a TriLib Geometry Group. A Geometry Group contains child Geometries.
Namespace: TriLibCore.Interfaces
Assembly: TriLibCore.dll
Syntax
public interface IGeometryGroup : IObject
Properties
BlendShapeKeys
Gets/Sets the Blend-Shape keys in this group.
Declaration
List<IBlendShapeKey> BlendShapeKeys { get; set; }
Property Value
| Type | Description |
|---|---|
| List<IBlendShapeKey> |
Colors
Gets or sets the color data for all vertices in this Geometry Group.
Declaration
List<Color> Colors { get; set; }
Property Value
| Type | Description |
|---|---|
| List<Color> |
GeometriesData
Gets/Sets the Geometries in this group.
Declaration
Dictionary<int, IGeometry> GeometriesData { get; }
Property Value
| Type | Description |
|---|---|
| Dictionary<int, IGeometry> |
GeometryCapacity
Gets the maximum number of Geometries that can be stored in this Geometry Group.
Declaration
int GeometryCapacity { get; }
Property Value
| Type | Description |
|---|---|
| int |
HasColors
Gets or sets whether the Geometry Group contains vertex color data.
Declaration
bool HasColors { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
HasInvalidNormals
Gets or sets whether the Geometry Group contains invalid normals.
Declaration
bool HasInvalidNormals { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
HasNormals
Gets or sets whether the Geometry Group contains valid normals.
Declaration
bool HasNormals { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
HasSkin
Gets or sets whether the Geometry Group has skinning information.
Declaration
bool HasSkin { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
HasTangents
Gets or sets whether the Geometry Group contains tangent data.
Declaration
bool HasTangents { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
HasUv1
Gets or sets whether the Geometry Group contains a first UV set (UV1).
Declaration
bool HasUv1 { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
HasUv2
Gets or sets whether the Geometry Group contains a second UV set (UV2).
Declaration
bool HasUv2 { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
HasUv3
Gets or sets whether the Geometry Group contains a third UV set (UV3).
Declaration
bool HasUv3 { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
HasUv4
Gets or sets whether the Geometry Group contains a fourth UV set (UV4).
Declaration
bool HasUv4 { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Mesh
Gets or sets the final Unity Mesh generated by this Geometry Group.
Declaration
Mesh Mesh { get; set; }
Property Value
| Type | Description |
|---|---|
| Mesh |
Normals
Gets or sets the normal data for all vertices in this Geometry Group.
Declaration
List<Vector3> Normals { get; set; }
Property Value
| Type | Description |
|---|---|
| List<Vector3> |
OriginalVertexIndices
Gets or sets the list that maps the current vertex indices to the original vertex indices.
Declaration
List<int> OriginalVertexIndices { get; set; }
Property Value
| Type | Description |
|---|---|
| List<int> |
Pivot
Gets/Sets this Geometry Group local pivot position.
Declaration
Vector3 Pivot { get; set; }
Property Value
| Type | Description |
|---|---|
| Vector3 |
Positions
Gets or sets the position data for all vertices in this Geometry Group.
Declaration
List<Vector3> Positions { get; set; }
Property Value
| Type | Description |
|---|---|
| List<Vector3> |
RawBoneWeights
Gets/Sets the Bone-Weights from this group.
Declaration
Dictionary<int, List<BoneWeight1>> RawBoneWeights { get; set; }
Property Value
| Type | Description |
|---|---|
| Dictionary<int, List<BoneWeight1>> |
Tangents
Gets or sets the tangent data for all vertices in this Geometry Group.
Declaration
List<Vector4> Tangents { get; set; }
Property Value
| Type | Description |
|---|---|
| List<Vector4> |
UVs1
Gets or sets the first UV set (UV1) data for all vertices in this Geometry Group.
Declaration
List<Vector2> UVs1 { get; set; }
Property Value
| Type | Description |
|---|---|
| List<Vector2> |
UVs2
Gets or sets the second UV set (UV2) data for all vertices in this Geometry Group.
Declaration
List<Vector2> UVs2 { get; set; }
Property Value
| Type | Description |
|---|---|
| List<Vector2> |
UVs3
Gets or sets the third UV set (UV3) data for all vertices in this Geometry Group.
Declaration
List<Vector2> UVs3 { get; set; }
Property Value
| Type | Description |
|---|---|
| List<Vector2> |
UVs4
Gets or sets the fourth UV set (UV4) data for all vertices in this Geometry Group.
Declaration
List<Vector2> UVs4 { get; set; }
Property Value
| Type | Description |
|---|---|
| List<Vector2> |
VerticesCapacity
Gets the maximum number of vertices that can be stored in this Geometry Group.
Declaration
int VerticesCapacity { get; }
Property Value
| Type | Description |
|---|---|
| int |
VerticesDataCount
Gets the total number of vertex data items in the Geometry Group.
Declaration
int VerticesDataCount { get; }
Property Value
| Type | Description |
|---|---|
| int |
Methods
AddBoneWeight(int, BoneWeight1)
Adds a new Bone Weight to this group.
Declaration
void AddBoneWeight(int vertexIndex, BoneWeight1 boneWeight1)
Parameters
| Type | Name | Description |
|---|---|---|
| int | vertexIndex | The original Vertex index. |
| BoneWeight1 | boneWeight1 | The Bone Weight data. |
AddVertex(AssetLoaderContext, int, Vector3, Vector3, Vector4, Color, Vector2, Vector2, Vector2, Vector2, BoneWeight)
Adds or gets an existing Vertex to/from this Geometry Group.
Declaration
int AddVertex(AssetLoaderContext assetLoaderContext, int vertexIndex, Vector3 position, Vector3 normal, Vector4 tangent, Color color, Vector2 uv1, Vector2 uv2, Vector2 uv3, Vector2 uv4, BoneWeight boneWeight)
Parameters
| Type | Name | Description |
|---|---|---|
| AssetLoaderContext | assetLoaderContext | The Asset Loader Context reference, containing model loading data. |
| int | vertexIndex | The original Vertex index. |
| Vector3 | position | The position of the vertex. |
| Vector3 | normal | The normal of the vertex. |
| Vector4 | tangent | The tangent of the vertex. |
| Color | color | The color of the vertex. |
| Vector2 | uv1 | The first UV set (UV1) coordinate. |
| Vector2 | uv2 | The second UV set (UV2) coordinate. |
| Vector2 | uv3 | The third UV set (UV3) coordinate. |
| Vector2 | uv4 | The fourth UV set (UV4) coordinate. |
| BoneWeight | boneWeight | The BoneWeight data. |
Returns
| Type | Description |
|---|---|
| int | The final vertex index in the Geometry Group. |
GenerateMesh(AssetLoaderContext, GameObject, IModel)
Generates the final Unity Mesh.
Declaration
IEnumerable GenerateMesh(AssetLoaderContext assetLoaderContext, GameObject meshGameObject, IModel meshModel)
Parameters
| Type | Name | Description |
|---|---|---|
| AssetLoaderContext | assetLoaderContext | The Asset Loader Context reference, containing model loading data. |
| GameObject | meshGameObject | The GameObject the Mesh will be attached to. |
| IModel | meshModel | The geometry model reference. |
Returns
| Type | Description |
|---|---|
| IEnumerable | An IEnumerable for asynchronous or deferred Mesh construction. |
GetCenter()
Computes the centroid (center) of all vertices in this Geometry Group.
Declaration
Vector3 GetCenter()
Returns
| Type | Description |
|---|---|
| Vector3 | The centroid of the vertex positions. |
GetGeometry<TGeometry>(AssetLoaderContext, int, bool, bool)
Gets a new or existing Geometry from this group.
Declaration
TGeometry GetGeometry<TGeometry>(AssetLoaderContext assetLoaderContext, int materialIndex, bool isQuad, bool hasBlendShapes) where TGeometry : class, IGeometry, new()
Parameters
| Type | Name | Description |
|---|---|---|
| AssetLoaderContext | assetLoaderContext | The Asset Loader Context reference, containing model loading data. |
| int | materialIndex | The Geometry Material index. |
| bool | isQuad | Indicates if the Geometry contains quad data. |
| bool | hasBlendShapes | Indicates if the Geometry uses blend-shapes. |
Returns
| Type | Description |
|---|---|
| TGeometry | A new or existing Geometry. |
Type Parameters
| Name | Description |
|---|---|
| TGeometry | A class that implements IGeometry. |
Setup(AssetLoaderContext, int, int)
Configures this Geometry Group with capacity and context information.
Declaration
void Setup(AssetLoaderContext assetLoaderContext, int verticesCapacity, int geometriesCapacity)
Parameters
| Type | Name | Description |
|---|---|---|
| AssetLoaderContext | assetLoaderContext | The Asset Loader Context reference, containing model loading data. |
| int | verticesCapacity | The maximum number of vertices in this group. |
| int | geometriesCapacity | The maximum number of Geometries in this group. |
TransferToBlendShape(IGeometryGroup, IBlendShapeKey, IList<int>)
Transfers this Geometry Group data to a Blend Shape, referencing another base Geometry Group.
Declaration
void TransferToBlendShape(IGeometryGroup baseGeometryGroup, IBlendShapeKey blendShapeKey, IList<int> originalVertexIndices)
Parameters
| Type | Name | Description |
|---|---|---|
| IGeometryGroup | baseGeometryGroup | The base Geometry Group to transfer from. |
| IBlendShapeKey | blendShapeKey | The blend shape key to apply the transfer. |
| IList<int> | originalVertexIndices | A list of original vertex indices used for mapping data. |