Class GraphicsBuffers
A container for graphics data. The buffers used in this class align with webGL requirements.
Inheritance
Inherited Members
Namespace: Elements.Geometry
Assembly: Hypar.Elements.dll
Syntax
public class GraphicsBuffers
Constructors
GraphicsBuffers()
Construct an empty graphics buffers object.
Declaration
public GraphicsBuffers()
Properties
CMax
The maximum color value as [r,g,b].
Declaration
public double[] CMax { get; }
Property Value
Type | Description |
---|---|
System.Double[] |
CMin
The minimum color value as [r,g,b].
Declaration
public double[] CMin { get; }
Property Value
Type | Description |
---|---|
System.Double[] |
Colors
A collection of sequential color values stored as sequential bytes.
Declaration
public List<byte> Colors { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<System.Byte> |
FacetCount
The number of facets represented by the buffer.
Declaration
public int FacetCount { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
IMax
The maximum index value.
Declaration
public ushort IMax { get; }
Property Value
Type | Description |
---|---|
System.UInt16 |
IMin
The minimum index value.
Declaration
public ushort IMin { get; }
Property Value
Type | Description |
---|---|
System.UInt16 |
Indices
A collection of indices stored as sequential bytes.
Declaration
public List<byte> Indices { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<System.Byte> |
NMax
The maximum normal of the data as [x,y,z].
Declaration
public double[] NMax { get; }
Property Value
Type | Description |
---|---|
System.Double[] |
NMin
The minimum normal of the data as [x,y,z].
Declaration
public double[] NMin { get; }
Property Value
Type | Description |
---|---|
System.Double[] |
Normals
A collection of sequential normal values stored as sequential bytes.
Declaration
public List<byte> Normals { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<System.Byte> |
UVMax
The maximum UV value as [u,v].
Declaration
public double[] UVMax { get; }
Property Value
Type | Description |
---|---|
System.Double[] |
UVMin
The maximum UV value as [u,v].
Declaration
public double[] UVMin { get; }
Property Value
Type | Description |
---|---|
System.Double[] |
UVs
A collection of UV values stored as sequential bytes.
Declaration
public List<byte> UVs { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<System.Byte> |
VertexCount
The number of vertices represented by the buffer.
Declaration
public int VertexCount { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Vertices
A collection of vertex positions stored as sequential bytes.
Declaration
public List<byte> Vertices { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<System.Byte> |
VMax
The maximum of the axis-aligned bounding box of the data as [x,y,z].
Declaration
public double[] VMax { get; }
Property Value
Type | Description |
---|---|
System.Double[] |
VMin
The minimum of the axis-aligned bounding box of the data as [x,y,z].
Declaration
public double[] VMin { get; }
Property Value
Type | Description |
---|---|
System.Double[] |
Methods
AddIndex(UInt16)
Add an index to the graphics buffers.
Declaration
public void AddIndex(ushort index)
Parameters
Type | Name | Description |
---|---|---|
System.UInt16 | index | The index to add. |
AddIndices(IList<UInt16>)
Add indices to the graphics buffers.
Declaration
public void AddIndices(IList<ushort> indices)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IList<System.UInt16> | indices | The indices to add. |
AddVertex(Vector3, Vector3, UV, Nullable<Color>)
Add a vertex to the graphics buffers.
Declaration
public void AddVertex(Vector3 position, Vector3 normal, UV uv, Color? color = null)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | The position of the vertex. |
Vector3 | normal | The normal of the vertex. |
UV | uv | The UV of the vertex. |
System.Nullable<Color> | color | The vertex color. |
AddVertex(Double, Double, Double, Double, Double, Double, Double, Double, Nullable<Color>)
Add a vertex to the graphics buffers.
Declaration
public void AddVertex(double x, double y, double z, double nx, double ny, double nz, double u, double v, Color? color)
Parameters
Type | Name | Description |
---|---|---|
System.Double | x | |
System.Double | y | |
System.Double | z | |
System.Double | nx | |
System.Double | ny | |
System.Double | nz | |
System.Double | u | |
System.Double | v | |
System.Nullable<Color> | color |
AddVertices(IList<(Vector3 position, Vector3 normal, UV uv, Nullable<Color> color)>)
Add vertices to the graphics buffers.
Declaration
public void AddVertices(IList<(Vector3 position, Vector3 normal, UV uv, Color? color)> vertices)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IList<System.ValueTuple<Vector3, Vector3, UV, System.Nullable<Color>>> | vertices |
Initialize(Int32, Int32)
Pre allocates the buffers according to the preallocation size.
Declaration
public void Initialize(int vertexCount = 100, int indexCount = 100)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | vertexCount | How many vertices are expected. |
System.Int32 | indexCount | How many indices are likely to be used. |