Struct PointerVertexData
Represents a lightweight IVertexData implementation that points into a CommonGeometryGroup vertex attribute storage.
Implements
Namespace: TriLibCore.Geometries
Assembly: TriLibCore.Source.dll
Syntax
public struct PointerVertexData : IVertexData
Remarks
This type is primarily used during vertex merging. When Added is false,
getters read from the geometry group's temporary staging fields (Temp*). After a vertex is
committed and VertexDataIndex becomes valid, getters/setters operate directly
on the underlying lists stored in the CommonGeometryGroup.
Constructors
PointerVertexData(CommonGeometryGroup, int)
Initializes a new instance of the PointerVertexData struct.
Declaration
public PointerVertexData(CommonGeometryGroup commonGeometryGroup, int vertexDataIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| CommonGeometryGroup | commonGeometryGroup | The owning geometry group that stores the vertex attribute lists. |
| int | vertexDataIndex | The vertex data index into the group lists. Use |
Fields
VertexDataIndex
Gets or sets the vertex data index into the owning CommonGeometryGroup lists.
A value of -1 indicates that this instance references the temporary staging data.
Declaration
public int VertexDataIndex
Field Value
| Type | Description |
|---|---|
| int |
Properties
Added
Gets a value indicating whether this instance points to a committed vertex entry.
Declaration
public bool Added { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
Equals(object)
Determines whether this instance is equal to another object.
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj | The object to compare. |
Returns
| Type | Description |
|---|---|
| bool |
|
Overrides
Equals(PointerVertexData)
Determines whether this instance is equal to another PointerVertexData instance by comparing only the attributes that are enabled in the owning geometry group.
Declaration
public bool Equals(PointerVertexData other)
Parameters
| Type | Name | Description |
|---|---|---|
| PointerVertexData | other | The other instance to compare. |
Returns
| Type | Description |
|---|---|
| bool |
|
GetBoneWeight(IGeometryGroup)
Gets the vertex bone weight.
Declaration
public BoneWeight GetBoneWeight(IGeometryGroup geometryGroup)
Parameters
| Type | Name | Description |
|---|---|---|
| IGeometryGroup | geometryGroup | The geometry group requesting the operation. |
Returns
| Type | Description |
|---|---|
| BoneWeight | The bone weight value, or |
Remarks
This method is currently not implemented for PointerVertexData and returns default.
GetColor(IGeometryGroup)
Gets the vertex color.
Declaration
public Color GetColor(IGeometryGroup geometryGroup)
Parameters
| Type | Name | Description |
|---|---|---|
| IGeometryGroup | geometryGroup | The geometry group requesting the operation. |
Returns
| Type | Description |
|---|---|
| Color | The vertex color, or |
GetHashCode()
Returns a hash code based on the enabled attributes in the owning geometry group.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int | The computed hash code. |
Overrides
GetNormal(IGeometryGroup)
Gets the vertex normal.
Declaration
public Vector3 GetNormal(IGeometryGroup geometryGroup)
Parameters
| Type | Name | Description |
|---|---|---|
| IGeometryGroup | geometryGroup | The geometry group requesting the operation. |
Returns
| Type | Description |
|---|---|
| Vector3 | The vertex normal, or |
GetPosition(IGeometryGroup)
Gets the vertex position.
Declaration
public Vector3 GetPosition(IGeometryGroup geometryGroup)
Parameters
| Type | Name | Description |
|---|---|---|
| IGeometryGroup | geometryGroup | The geometry group requesting the operation. |
Returns
| Type | Description |
|---|---|
| Vector3 | The vertex position. |
GetTangent(IGeometryGroup)
Gets the vertex tangent.
Declaration
public Vector4 GetTangent(IGeometryGroup geometryGroup)
Parameters
| Type | Name | Description |
|---|---|---|
| IGeometryGroup | geometryGroup | The geometry group requesting the operation. |
Returns
| Type | Description |
|---|---|
| Vector4 | The vertex tangent, or |
GetUV1(IGeometryGroup)
Gets the UV0 value (first UV channel).
Declaration
public Vector2 GetUV1(IGeometryGroup geometryGroup)
Parameters
| Type | Name | Description |
|---|---|---|
| IGeometryGroup | geometryGroup | The geometry group requesting the operation. |
Returns
| Type | Description |
|---|---|
| Vector2 | The UV value, or |
GetUV2(IGeometryGroup)
Gets the UV1 value (second UV channel).
Declaration
public Vector2 GetUV2(IGeometryGroup geometryGroup)
Parameters
| Type | Name | Description |
|---|---|---|
| IGeometryGroup | geometryGroup | The geometry group requesting the operation. |
Returns
| Type | Description |
|---|---|
| Vector2 | The UV value, or |
GetUV3(IGeometryGroup)
Gets the UV2 value (third UV channel).
Declaration
public Vector2 GetUV3(IGeometryGroup geometryGroup)
Parameters
| Type | Name | Description |
|---|---|---|
| IGeometryGroup | geometryGroup | The geometry group requesting the operation. |
Returns
| Type | Description |
|---|---|
| Vector2 | The UV value, or |
GetUV4(IGeometryGroup)
Gets the UV3 value (fourth UV channel).
Declaration
public Vector2 GetUV4(IGeometryGroup geometryGroup)
Parameters
| Type | Name | Description |
|---|---|---|
| IGeometryGroup | geometryGroup | The geometry group requesting the operation. |
Returns
| Type | Description |
|---|---|
| Vector2 | The UV value, or |
GetUsesBoneWeight(IGeometryGroup)
Gets a value indicating whether this vertex data instance uses bone weights.
Declaration
public bool GetUsesBoneWeight(IGeometryGroup geometryGroup)
Parameters
| Type | Name | Description |
|---|---|---|
| IGeometryGroup | geometryGroup | The geometry group requesting the operation. |
Returns
| Type | Description |
|---|---|
| bool |
|
GetVertexIndex(IGeometryGroup)
Gets the original vertex index.
Declaration
public int GetVertexIndex(IGeometryGroup geometryGroup)
Parameters
| Type | Name | Description |
|---|---|---|
| IGeometryGroup | geometryGroup | The geometry group requesting the operation. |
Returns
| Type | Description |
|---|---|
| int | The original vertex index. |
SetBoneWeight(BoneWeight, IGeometryGroup)
Sets the vertex bone weight.
Declaration
public void SetBoneWeight(BoneWeight value, IGeometryGroup geometryGroup)
Parameters
| Type | Name | Description |
|---|---|---|
| BoneWeight | value | The bone weight value. |
| IGeometryGroup | geometryGroup | The geometry group requesting the operation. |
Remarks
This method is currently not implemented for PointerVertexData.
SetColor(Color, IGeometryGroup)
Sets the vertex color.
Declaration
public void SetColor(Color value, IGeometryGroup geometryGroup)
Parameters
| Type | Name | Description |
|---|---|---|
| Color | value | The color value. |
| IGeometryGroup | geometryGroup | The geometry group requesting the operation. |
SetNormal(Vector3, IGeometryGroup)
Sets the vertex normal.
Declaration
public void SetNormal(Vector3 value, IGeometryGroup geometryGroup)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | value | The normal value. |
| IGeometryGroup | geometryGroup | The geometry group requesting the operation. |
SetPosition(Vector3, IGeometryGroup)
Sets the vertex position.
Declaration
public void SetPosition(Vector3 value, IGeometryGroup geometryGroup)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | value | The position value. |
| IGeometryGroup | geometryGroup | The geometry group requesting the operation. |
SetTangent(Vector4, IGeometryGroup)
Sets the vertex tangent.
Declaration
public void SetTangent(Vector4 value, IGeometryGroup geometryGroup)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector4 | value | The tangent value. |
| IGeometryGroup | geometryGroup | The geometry group requesting the operation. |
SetUV1(Vector2, IGeometryGroup)
Sets the UV0 value (first UV channel).
Declaration
public void SetUV1(Vector2 value, IGeometryGroup geometryGroup)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | value | The UV value. |
| IGeometryGroup | geometryGroup | The geometry group requesting the operation. |
SetUV2(Vector2, IGeometryGroup)
Sets the UV1 value (second UV channel).
Declaration
public void SetUV2(Vector2 value, IGeometryGroup geometryGroup)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | value | The UV value. |
| IGeometryGroup | geometryGroup | The geometry group requesting the operation. |
SetUV3(Vector2, IGeometryGroup)
Sets the UV2 value (third UV channel).
Declaration
public void SetUV3(Vector2 value, IGeometryGroup geometryGroup)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | value | The UV value. |
| IGeometryGroup | geometryGroup | The geometry group requesting the operation. |
SetUV4(Vector2, IGeometryGroup)
Sets the UV3 value (fourth UV channel).
Declaration
public void SetUV4(Vector2 value, IGeometryGroup geometryGroup)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | value | The UV value. |
| IGeometryGroup | geometryGroup | The geometry group requesting the operation. |
SetVertexIndex(int, IGeometryGroup)
Sets the original vertex index.
Declaration
public void SetVertexIndex(int value, IGeometryGroup geometryGroup)
Parameters
| Type | Name | Description |
|---|---|---|
| int | value | The original vertex index. |
| IGeometryGroup | geometryGroup | The geometry group requesting the operation. |