Helper class for writing vertex data to a buffer in a specific format.
sealed class
|
VertexWriter
|
Index of current vertex.
public
property
|
Index
{
get
}
|
||
type
|
int32
|
||
value
|
|
The vertex index. |
Remarks:
The current vertex will receive the written data until Out is called.
Creates a new instance of VertexWriter.
public
constructor
|
VertexWriter
()
|
Specifies a vertex color.
public
method
|
C
(int32 argb32)
|
||
type
|
VertexWriter
|
||
params
|
argb32
|
The vertex color, as a 32-bit A8R8G8B compressed sRGB color value. |
Specifies a vertex color.
public
method
|
C
(int64 argb64)
|
||
type
|
VertexWriter
|
||
params
|
argb64
|
The vertex color, as a 64-bit A16R16G16B16 linear sRGB color value. |
Specifies a vertex color.
public
method
|
C
(ColorF color)
|
||
type
|
VertexWriter
|
||
params
|
color
|
The color value. |
Specifies a vertex color.
public
method
|
C
(float32 r,
float32 g,
float32 b,
float32 a = 1)
|
||
type
|
VertexWriter
|
||
params
|
r
|
Red channel value (linear sRGB). | |
g
|
Green channel value (linear sRGB). | ||
b
|
Blue channel value (linear sRGB). | ||
a
|
Alpha
channel
value.
Defaults
to
1 . |
public
method
|
Clear
()
|
Specifies a vertex tangent vector.
public
method
|
G
(Vec3F v)
|
||
type
|
VertexWriter
|
||
params
|
v
|
The vertex tangent vector. |
Remarks:
The given vector will be normalized if necessary.
Specifies a vertex tangent vector.
public
method
|
G
(Vec3D v)
|
||
type
|
VertexWriter
|
||
params
|
v
|
The vertex tangent vector. |
Remarks:
The given vector will be normalized if necessary.
Specifies a vertex tangent vector.
public
method
|
G
(float64 x,
float64 y,
float64 z)
|
||
type
|
VertexWriter
|
||
params
|
x
|
X-component of vertex tangent vector. | |
y
|
Y-component of vertex tangent vector. | ||
z
|
Z-component of vertex tangent vector. |
Remarks:
The given vector will be normalized if necessary.
Specifies a vertex normal vector.
public
method
|
N
(Vec3F v)
|
||
type
|
VertexWriter
|
||
params
|
v
|
The vertex normal vector. |
Remarks:
The given vector will be normalized if necessary.
Specifies a vertex normal vector.
public
method
|
N
(Vec3D v)
|
||
type
|
VertexWriter
|
||
params
|
v
|
The vertex normal vector. |
Remarks:
The given vector will be normalized if necessary.
Specifies a vertex normal vector.
public
method
|
N
(float64 x,
float64 y,
float64 z)
|
||
type
|
VertexWriter
|
||
params
|
x
|
X-component of vertex normal vector. | |
y
|
Y-component of vertex normal vector. | ||
z
|
Z-component of vertex normal vector. |
Remarks:
The given vector will be normalized if necessary.
Returns the ordinal of the given vertex element usage (see VertexElementUsage) that will be specified next for the current vertex.
public
method
|
Ordinal
(VertexElementUsage usage)
|
||
type
|
int32
|
||
params
|
usage
|
The vertex element usage. | |
returns
|
|
The usage ordinal in the current vertex. |
Finishes the current vertex and begins to write the next one.
public
method
|
Out
()
|
Specifies a vertex position.
public
method
|
P
(Vec3F v)
|
||
type
|
VertexWriter
|
||
params
|
v
|
The vertex position. |
Specifies a vertex position.
public
method
|
P
(Vec3D v)
|
||
type
|
VertexWriter
|
||
params
|
v
|
The vertex position. |
Specifies a vertex position.
public
method
|
P
(float64 x,
float64 y,
float64 z)
|
||
type
|
VertexWriter
|
||
params
|
x
|
X-coordinate of vertex position. | |
y
|
Y-coordinate of vertex position. | ||
z
|
Z-coordinate of vertex position. |
Specifies a set of texture coordinates.
public
method
|
T
(Vec2F v)
|
||
type
|
VertexWriter
|
||
params
|
v
|
The texture coordinates. |
Specifies a set of texture coordinates.
public
method
|
T
(Vec2D v)
|
||
type
|
VertexWriter
|
||
params
|
v
|
The texture coordinates. |
Specifies a set of texture coordinates.
public
method
|
T
(Vec3F v)
|
||
type
|
VertexWriter
|
||
params
|
v
|
The texture coordinates. |
Specifies a set of texture coordinates.
public
method
|
T
(Vec3D v)
|
||
type
|
VertexWriter
|
||
params
|
v
|
The texture coordinates. |
Specifies a set of texture coordinates.
public
method
|
T
(Vec4F v)
|
||
type
|
VertexWriter
|
||
params
|
v
|
The texture coordinates. |
Specifies a set of texture coordinates.
public
method
|
T
(Vec4D v)
|
||
type
|
VertexWriter
|
||
params
|
v
|
The texture coordinates. |
Specifies a set of texture coordinates.
public
method
|
T
(float64 x)
|
||
type
|
VertexWriter
|
||
params
|
x
|
X-component of texture coordinates. |
Specifies a set of texture coordinates.
public
method
|
T
(float64 x,
float64 y)
|
||
type
|
VertexWriter
|
||
params
|
x
|
X-component of texture coordinates. | |
y
|
Y-component of texture coordinates. |
Specifies a set of texture coordinates.
public
method
|
T
(float64 x,
float64 y,
float64 z)
|
||
type
|
VertexWriter
|
||
params
|
x
|
X-component of texture coordinates. | |
y
|
Y-component of texture coordinates. | ||
z
|
Z-component of texture coordinates. |
Specifies a set of texture coordinates.
public
method
|
T
(float64 x,
float64 y,
float64 z,
float64 w)
|
||
type
|
VertexWriter
|
||
params
|
x
|
X-component of texture coordinates. | |
y
|
Y-component of texture coordinates. | ||
z
|
Z-component of texture coordinates. | ||
w
|
W-component of texture coordinates. |
Returns a vertex array collection that contains the vertex data that has been written so far.
public
method
|
ToArrays
()
|
||
type
|
VertexArrays
|
||
returns
|
|
The resulting vertex arrays. |
Remarks:
The returned vertex array contains the following data:
The mapping from the given VertexElements to vertex array PositionReturns a static vertex buffer of the given format that contains the vertex data that has been written so far.
[OwnerReturn]
|
||||
public
method
|
ToBuffer
(VertexElements elements,
IGraphicsContext context)
|
|||
type
|
IVertexBuffer
|
|||
params
|
elements
|
[not-null]
|
The vertex buffer format. | |
context
|
[not-null]
|
The buffer factory to use. | ||
returns
|
|
The created vertex buffer. |
Returns a byte buffer that contains the vertex buffer content in the given format of the vertex data that has been written so far.
[OwnerReturn]
|
||||
public
method
|
ToBytes
(VertexElements elements)
|
|||
type
|
ByteBuffer
|
|||
params
|
elements
|
[not-null]
|
The vertex buffer format. | |
returns
|
|
The vertex buffer content. |