Abstract base class for IModelGeometry implementations.
abstract class
|
ModelGeometry
|
extends
|
ModelGeometryBase
|
The vertex index count.
public
abstract
property
|
IndexCount
{
get
}
|
||
type
|
int32
|
||
value
|
|
The
vertex
index
count.
Will
be
0
iff
ReadIndices
returns
null .
|
|
inherited
|
ModelGeometryBase.IndexCount
|
The resource handle that returns an IGeometryBuffer object that holds instance data to use for this model geometry object.
public
virtual
property
|
InstanceBuffer
{
get
}
|
||
type
|
IResourceHandle
|
||
value
|
The
instance
buffer
to
use
for
geometry
instancing
or
null
if
geometry
instancing
is
disabled
for
this
model
geometry
object.
|
||
inherited
|
ModelGeometryBase.InstanceBuffer
|
The vertex count.
public
abstract
property
|
VertexCount
{
get
}
|
||
type
|
int32
|
||
value
|
|
The vertex count. | |
inherited
|
ModelGeometryBase.VertexCount
|
The vertex format flags.
public
abstract
property
|
VertexFormat
{
get
}
|
||
type
|
ModelVertexFormat
|
||
value
|
The format flags. | ||
inherited
|
ModelGeometryBase.VertexFormat
|
An axis-aligned box.
public
static
method
|
Box
(Box3D box,
int32 normals = 0,
int32 texCoords = 0)
|
||
type
|
IModelGeometrySimple
|
||
params
|
box
|
The box coordinates. | |
normals
|
Generate
normal
vectors?
Defaults
to
0 .
>
0 :
Generate
normals
by
right-hand
rule
for
CCW
faces
(see
figure).
<
0 :
Generate
normals
by
right-hand
rule
for
CW
faces
(see
figure).
=
0 :
Do
not
generate
normals.
|
||
texCoords
|
[>=0]
|
The
texture
coordinate
repeat
count
per
face.
Set
to
0
to
disable
texture
coordinates.
Defaults
to
0 .
|
|
returns
|
|
The box model. |
Remarks:
The following figure shows the mapping from the given box to the 3D model:
121-----221 /| /| / | / | 122-----222 | | 111---|-211 | / | / |/ |/ 112-----212where
111
maps
to
X1,
Y1,
Z1
and
222
maps
to
X2,
Y2,
Z2.
public
static
method
|
Build
()
|
||
type
|
ModelGeometryBuilder
|
A sphere, built from an icosahedron by subdivision.
public
static
method
|
Sphere
(Vec3D center,
float64 radius,
int32 levels,
int32 levelsEdges)
|
||
type
|
IModelGeometrySimple
|
||
params
|
center
|
The sphere center. | |
radius
|
The sphere radius. If negative, the sphere will be mirrored at center, making the normals point inwards. | ||
levels
|
[>=0]
|
Subdivisions to perform for faces (see Triangles ). | |
levelsEdges
|
[0..levels]
|
Subdivisions to perform for edges (see Lines). |
[Pure]
|
||||
public
static
method
|
Wrap
(VertexArrays vertices,
int32[] indices)
|
|||
type
|
IModelGeometry
|
|||
params
|
vertices
|
|||
indices
|
Creates a new resource object, using the given graphics context.
[OwnerReturn]
|
||||
public
method
|
CreateResource
(Graphics graphics)
|
|||
type
|
IResource
|
|||
params
|
graphics
|
[not-null]
|
The graphics context to use. | |
returns
|
The
resource
object
or
null . |
|||
inherited
|
ModelGeometryBase.CreateResource
|
Remarks:
Resource objects may implement the IMemoryConsumption interface. In this case, the reported memory consumption will be interpreted as an estimate on how much GPU memory is consumed by the resource. This estimate can then be used for resource caching (e.g. CacheMemory).
Compares this object with the given one.
[Pure]
|
||||
public
method
|
Equals
(IResourceHandle other)
|
|||
type
|
bool
|
|||
params
|
other
|
The object to compare to. | ||
returns
|
true
if
this
object
is
equal
to
other,
false
if
not.
|
|||
inherited
|
ModelGeometryBase.Equals
|
[Pure]
|
||||
public
override
sealed
method
|
GetHashCode
()
|
|||
type
|
int32
|
|||
inherited
|
ModelGeometryBase.GetHashCode
|
Read vertex index data.
public
abstract
method
|
ReadIndices
()
|
||
type
|
int32[]
|
||
returns
|
The
vertex
index
data
or
null
iff
IndexCount
returns
0
(i.e.
the
geometry
is
not
indexed).
|
||
inherited
|
ModelGeometryBase.ReadIndices
|
Reads vertex data.
public
abstract
method
|
ReadVertices
()
|
||
type
|
VertexArrays
|
||
returns
|
|
The vertex data array. | |
inherited
|
ModelGeometryBase.ReadVertices
|
Configures geometry instancing for this model geometry.
public
virtual
method
|
UseGeometryInstancing
(IResourceHandle instanceBuffer)
|
||
type
|
IModelGeometry
|
||
params
|
instanceBuffer
|
The
resource
handle
that
returns
an
IVertexBuffer
object
that
holds
instance
data
to
use
for
this
model
geometry
object
or
null
to
disable
geometry
instancing.
The
instanceBuffer
value
will
be
returned
by
the
IModelGeometry
property
of
the
returned
model
geometry
object.
|
|
returns
|
|
The resulting model geometry. | |
inherited
|
ModelGeometryBase.UseGeometryInstancing
|
See also:
IModelGeometry