Interface IGeometry
Represents a TriLib Geometry. There may be multiple Geometries within a single CommonGeometryGroup (or any other group implementing geometry collections).
Namespace: TriLibCore.Interfaces
Assembly: TriLibCore.dll
Syntax
public interface IGeometry
Properties
GeometryGroup
Gets or sets the parent CommonGeometryGroup that contains this Geometry.
Declaration
CommonGeometryGroup GeometryGroup { get; set; }
Property Value
| Type | Description |
|---|---|
| CommonGeometryGroup |
Index
Gets or sets the index of this Geometry within its parent Geometry Group.
Declaration
int Index { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
IsQuad
Gets or sets a value indicating whether this Geometry contains quadrilateral faces (quads) instead of triangular faces.
Declaration
bool IsQuad { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
MaterialIndex
Gets or sets the material index used by this Geometry.
Declaration
int MaterialIndex { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
OriginalIndex
Gets or sets the original Geometry index within the parent Geometry Group. Sometimes a Geometry can be duplicated, and this field is used to track its original index.
Declaration
int OriginalIndex { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
VertexDataIndices
Gets or sets the list of indices into the Geometry Group's vertex data. Each element of this list corresponds to a vertex position entry (and optionally normal, tangent, UV, etc.).
Declaration
List<int> VertexDataIndices { get; set; }
Property Value
| Type | Description |
|---|---|
| List<int> |
Methods
AddVertex(AssetLoaderContext, int, Vector3, Vector3, Vector4, Color, Vector2, Vector2, Vector2, Vector2, BoneWeight)
Adds a new vertex to this Geometry, defining its position, normal, tangent, color, UV coordinates, and bone weight data.
Declaration
void AddVertex(AssetLoaderContext assetLoaderContext, int originalVertexIndex, Vector3 position, Vector3 normal = null, Vector4 tangent = null, Color color = null, Vector2 uv0 = null, Vector2 uv1 = null, Vector2 uv2 = null, Vector2 uv3 = null, BoneWeight boneWeight = null)
Parameters
| Type | Name | Description |
|---|---|---|
| AssetLoaderContext | assetLoaderContext | The AssetLoaderContext that holds information about the model-loading process. |
| int | originalVertexIndex | The original vertex index. |
| Vector3 | position | The position vector for the new vertex. |
| Vector3 | normal | The normal vector for the new vertex. |
| Vector4 | tangent | The tangent vector for the new vertex. |
| Color | color | The color of the new vertex. |
| Vector2 | uv0 | The first UV set coordinate. |
| Vector2 | uv1 | The second UV set coordinate. |
| Vector2 | uv2 | The third UV set coordinate. |
| Vector2 | uv3 | The fourth UV set coordinate. |
| BoneWeight | boneWeight | The bone weight data for skinning. |
Setup(CommonGeometryGroup, int, bool, bool, bool)
Configures this Geometry with its parent group, material index, and other properties that affect how its vertices and faces are handled.
Declaration
void Setup(CommonGeometryGroup geometryGroup, int materialIndex, bool isQuad, bool hasBlendShapes, bool isPointCloud)
Parameters
| Type | Name | Description |
|---|---|---|
| CommonGeometryGroup | geometryGroup | The parent geometry group to which this Geometry belongs. |
| int | materialIndex | The index of the material associated with this Geometry. |
| bool | isQuad | Whether this Geometry uses quadrilateral faces. |
| bool | hasBlendShapes | Whether this Geometry includes blend shape data. |
| bool | isPointCloud | Whether this Geometry is a point cloud (vertices only, no faces). |