Class CommonGeometryGroup
Represents a TriLib Geometry Group. A Geometry Group contains child Geometries.
Inheritance
CommonGeometryGroup
Assembly: TriLibCore.dll
Syntax
public class CommonGeometryGroup : IGeometryGroup, IObject
Constructors
CommonGeometryGroup()
Declaration
public CommonGeometryGroup()
Fields
TempColor
Declaration
Field Value
TempNormal
Declaration
public Vector3 TempNormal
Field Value
TempPosition
Declaration
public Vector3 TempPosition
Field Value
TempTangent
Declaration
public Vector4 TempTangent
Field Value
TempUV1
Declaration
Field Value
TempUV2
Declaration
Field Value
TempUV3
Declaration
Field Value
TempUV4
Declaration
Field Value
TempVertexIndex
Declaration
public int TempVertexIndex
Field Value
Properties
BlendShapeKeys
Gets/Sets the Blend-Shape keys in this group.
Declaration
public List<IBlendShapeKey> BlendShapeKeys { get; set; }
Property Value
Colors
Declaration
public List<Color> Colors { get; set; }
Property Value
Type |
Description |
List<Color> |
|
GeometriesData
Gets/Sets the Geometries in this group.
Declaration
public Dictionary<int, IGeometry> GeometriesData { get; }
Property Value
GeometryCapacity
Declaration
public int GeometryCapacity { get; set; }
Property Value
HasColors
Declaration
public bool HasColors { get; set; }
Property Value
HasInvalidNormals
Declaration
public bool HasInvalidNormals { get; set; }
Property Value
HasNormals
Declaration
public bool HasNormals { get; set; }
Property Value
HasSkin
Declaration
public bool HasSkin { get; set; }
Property Value
HasTangents
Declaration
public bool HasTangents { get; set; }
Property Value
HasUv1
Declaration
public bool HasUv1 { get; set; }
Property Value
HasUv2
Declaration
public bool HasUv2 { get; set; }
Property Value
HasUv3
Declaration
public bool HasUv3 { get; set; }
Property Value
HasUv4
Declaration
public bool HasUv4 { get; set; }
Property Value
Mesh
Declaration
public Mesh Mesh { get; set; }
Property Value
Name
Gets/Sets the Object name.
Declaration
public string Name { get; set; }
Property Value
Normals
Declaration
public List<Vector3> Normals { get; set; }
Property Value
Type |
Description |
List<Vector3> |
|
OriginalVertexIndices
Declaration
public List<int> OriginalVertexIndices { get; set; }
Property Value
Pivot
Gets/Sets this Geometry Group local pivot position.
Declaration
public Vector3 Pivot { get; set; }
Property Value
Positions
Declaration
public List<Vector3> Positions { get; set; }
Property Value
Type |
Description |
List<Vector3> |
|
RawBoneWeights
Gets/Sets the Bone-Weights from this group.
Declaration
public Dictionary<int, List<BoneWeight1>> RawBoneWeights { get; set; }
Property Value
Tangents
Declaration
public List<Vector4> Tangents { get; set; }
Property Value
Type |
Description |
List<Vector4> |
|
UVs1
Declaration
public List<Vector2> UVs1 { get; set; }
Property Value
Type |
Description |
List<Vector2> |
|
UVs2
Declaration
public List<Vector2> UVs2 { get; set; }
Property Value
Type |
Description |
List<Vector2> |
|
UVs3
Declaration
public List<Vector2> UVs3 { get; set; }
Property Value
Type |
Description |
List<Vector2> |
|
UVs4
Declaration
public List<Vector2> UVs4 { get; set; }
Property Value
Type |
Description |
List<Vector2> |
|
Used
Gets/Sets the flag indicating whether this object used somewhere.
Declaration
public bool Used { get; set; }
Property Value
VerticesCapacity
Declaration
public int VerticesCapacity { get; set; }
Property Value
VerticesDataCount
Declaration
public int VerticesDataCount { get; }
Property Value
Methods
AddBoneWeight(int, BoneWeight1)
Adds a new Bone Weight to this group.
Declaration
public 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
public 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 |
|
int |
vertexIndex |
|
Vector3 |
position |
|
Vector3 |
normal |
|
Vector4 |
tangent |
|
Color |
color |
|
Vector2 |
uv1 |
|
Vector2 |
uv2 |
|
Vector2 |
uv3 |
|
Vector2 |
uv4 |
|
BoneWeight |
boneWeight |
|
Returns
Create(bool, bool, bool, bool, bool, bool, bool, bool, bool)
Declaration
public static CommonGeometryGroup Create(bool hasNormal, bool hasTangent, bool hasColor, bool hasUV0, bool hasUV1, bool hasUV2, bool hasUV3, bool hasSkin, bool useHalfPrecision = false)
Parameters
Returns
GenerateMesh(AssetLoaderContext, GameObject, IModel)
Generates the final Unity Mesh.
Declaration
public IEnumerable GenerateMesh(AssetLoaderContext assetLoaderContext, GameObject meshGameObject, IModel meshModel)
Parameters
Type |
Name |
Description |
AssetLoaderContext |
assetLoaderContext |
The Asset Loader Context reference. Asset Loader Context contains the Model loading data.
|
GameObject |
meshGameObject |
The GameObject the Mesh belongs to.
|
IModel |
meshModel |
The geometry model.
|
Returns
GetCenter()
Declaration
public Vector3 GetCenter()
Returns
GetGeometry<TGeometry>(AssetLoaderContext, int, bool, bool)
Gets a new or existing Geometry from this group.
Declaration
public virtual 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. Asset Loader Context contains the Model loading data.
|
int |
materialIndex |
The Geometry Material index.
|
bool |
isQuad |
Does the Geometry contains quad data?
|
bool |
hasBlendShapes |
Does the geometry uses blend-shapes?
|
Returns
Type |
Description |
TGeometry |
The new or existing Geometry.
|
Type Parameters
Name |
Description |
TGeometry |
|
GetHalfPrecision()
Declaration
public bool GetHalfPrecision()
Returns
SetHalfPrecision(bool)
Declaration
public void SetHalfPrecision(bool value)
Parameters
Type |
Name |
Description |
bool |
value |
|
Setup(AssetLoaderContext, int, int)
Configures this Geometry Group.
Declaration
public virtual void Setup(AssetLoaderContext assetLoaderContext, int verticesCapacity, int geometriesCapacity)
Parameters
Type |
Name |
Description |
AssetLoaderContext |
assetLoaderContext |
The Asset Loader Context reference. Asset Loader Context contains the 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>)
Declaration
public void TransferToBlendShape(IGeometryGroup baseGeometryGroup, IBlendShapeKey blendShapeKey, IList<int> originalVertexIndices)
Parameters
Implements
Extension Methods