VertexWriter

Description

sealed class Tinman.Engine.Rendering.Util.VertexWriter

Helper class for writing vertex data to a buffer in a specific format.

The following methods may be used to specify per-vertex data:

The Out method creates a new vertex, using the data that has been specified with the above methods. Use the ToArrays, ToBuffer and ToBytes methods in order to output the created vertices to the respective format.

Public / Constructors

Vertex​Writer


public constructor VertexWriter → ()

Creates a new instance of VertexWriter.

Public / Methods

C

4 overloads


public method C1 → (1)

argb32 in : int32

The vertex color, as a 32-bit A8R8G8B compressed sRGB color value.

returns → VertexWriter

this

Specifies a vertex color.


public method C2 → (1)

argb64 in : int64

The vertex color, as a 64-bit A16R16G16B16 linear sRGB color value.

returns → VertexWriter

this

Specifies a vertex color.

See also

Colors


public method C3 → (1)

color in : ColorF

The color value.

returns → VertexWriter

this

Specifies a vertex color.


public method C4 → (4)

in : float32

Red channel value (linear sRGB).

in : float32

Green channel value (linear sRGB).

in : float32

Blue channel value (linear sRGB).

opt : float32 = 1

Alpha channel value.

returns → VertexWriter

this

Specifies a vertex color.

Clear


public method Clear → ()

Clears all vertex data from this writer and re-starts at vertex index zero.

G

3 overloads


public method G1 → (1)

in : Vec3F

The vertex tangent vector.

returns → VertexWriter

this

Specifies a vertex tangent vector.

The given vector will be normalized if necessary.


public method G2 → (1)

in : Vec3D

The vertex tangent vector.

returns → VertexWriter

this

Specifies a vertex tangent vector.

The given vector will be normalized if necessary.


public method G3 → (3)

in : float64

X-component of vertex tangent vector.

in : float64

Y-component of vertex tangent vector.

in : float64

Z-component of vertex tangent vector.

returns → VertexWriter

this

Specifies a vertex tangent vector.

The given vector will be normalized if necessary.

N

3 overloads


public method N1 → (1)

in : Vec3F

The vertex normal vector.

returns → VertexWriter

this

Specifies a vertex normal vector.

The given vector will be normalized if necessary.


public method N2 → (1)

in : Vec3D

The vertex normal vector.

returns → VertexWriter

this

Specifies a vertex normal vector.

The given vector will be normalized if necessary.


public method N3 → (3)

in : float64

X-component of vertex normal vector.

in : float64

Y-component of vertex normal vector.

in : float64

Z-component of vertex normal vector.

returns → VertexWriter

this

Specifies a vertex normal vector.

The given vector will be normalized if necessary.

Ordinal


public method Ordinal → (1)

usage in : VertexElementUsage

The vertex element usage.

returns → int32

The usage ordinal in the current vertex.

Returns the ordinal of the given vertex element usage (see VertexElementUsage) that will be specified next for the current vertex.

Out


public method Out → ()

Finishes the current vertex and begins to write the next one.

P

3 overloads


public method P1 → (1)

in : Vec3F

The vertex position.

returns → VertexWriter

this

Specifies a vertex position.


public method P2 → (1)

in : Vec3D

The vertex position.

returns → VertexWriter

this

Specifies a vertex position.


public method P3 → (3)

in : float64

X-coordinate of vertex position.

in : float64

Y-coordinate of vertex position.

in : float64

Z-coordinate of vertex position.

returns → VertexWriter

this

Specifies a vertex position.

T

10 overloads


public method T1 → (1)

in : Vec2F

The texture coordinates.

returns → VertexWriter

this

Specifies a set of texture coordinates.


public method T2 → (1)

in : Vec2D

The texture coordinates.

returns → VertexWriter

this

Specifies a set of texture coordinates.


public method T3 → (1)

in : Vec3F

The texture coordinates.

returns → VertexWriter

this

Specifies a set of texture coordinates.


public method T4 → (1)

in : Vec3D

The texture coordinates.

returns → VertexWriter

this

Specifies a set of texture coordinates.


public method T5 → (1)

in : Vec4F

The texture coordinates.

returns → VertexWriter

this

Specifies a set of texture coordinates.


public method T6 → (1)

in : Vec4D

The texture coordinates.

returns → VertexWriter

this

Specifies a set of texture coordinates.


public method T7 → (1)

in : float64

X-component of texture coordinates.

returns → VertexWriter

this

Specifies a set of texture coordinates.


public method T8 → (2)

in : float64

X-component of texture coordinates.

in : float64

Y-component of texture coordinates.

returns → VertexWriter

this

Specifies a set of texture coordinates.


public method T9 → (3)

in : float64

X-component of texture coordinates.

in : float64

Y-component of texture coordinates.

in : float64

Z-component of texture coordinates.

returns → VertexWriter

this

Specifies a set of texture coordinates.


public method T10 → (4)

in : float64

X-component of texture coordinates.

in : float64

Y-component of texture coordinates.

in : float64

Z-component of texture coordinates.

in : float64

W-component of texture coordinates.

returns → VertexWriter

this

Specifies a set of texture coordinates.

To​Arrays


public method ToArrays → ()

returns → VertexArrays

The resulting vertex arrays.

Returns a vertex array collection that contains the vertex data that has been written so far.

To​Buffer


[OwnerReturn]
public method ToBuffer → (2)

elements in : VertexElements

[not-null]
The vertex buffer format.

factory in : IBufferFactory

[not-null]
The buffer factory to use.

returns → IVertexBuffer

The created vertex buffer.

Returns a static vertex buffer of the given format that contains the vertex data that has been written so far.

RenderException

If a graphics subsystem error has occurred.

To​Bytes


[OwnerReturn]
public method ToBytes → (1)

elements in : VertexElements

[not-null]
The vertex buffer format.

returns → ByteBuffer

The vertex buffer content.

Returns a byte buffer that contains the vertex buffer content in the given format of the vertex data that has been written so far.

Public / Attributes

Index


public attribute Index → (get)

value : int32

[>=0]
The vertex index.

Index of current vertex.

The current vertex will receive the written data until Out is called.