Default implementation of the IModel interface.
sealed class
|
Model
|
implements
|
IModel
|
The primitive batch of this model in the geometry buffer.
public
property
|
Batch
{
get
set
}
|
||
type
|
PrimitiveBatch
|
||
value
|
The primitive batch or None. | ||
implements
|
IModel.Batch
|
See also:
IModel.GeometryThe number of child models.
public
property
|
ChildCount
{
get
}
|
||
type
|
int32
|
||
value
|
|
The child model count. | |
implements
|
IModel.ChildCount
|
The collider object for this model.
public
property
|
Collider
{
get
}
|
||
type
|
ModelCollider
|
||
value
|
|
The collider object. | |
implements
|
IModel.Collider
|
The model flags.
public
property
|
Flags
{
get
set
}
|
||
type
|
ModelFlags
|
||
value
|
The model flags. | ||
implements
|
IModel.Flags
|
Returns the number of animation keyframes.
public
property
|
FrameCount
{
get
}
|
||
type
|
int32
|
||
value
|
|
The number of animation keyframes. | |
implements
|
IModel.FrameCount
|
The geometry of this model.
public
property
|
Geometry
{
get
set
}
|
||
type
|
IModelGeometry
|
||
value
|
The
geometry
or
null . |
||
implements
|
IModel.Geometry
|
See also:
IModel.BatchThe material of this model.
public
property
|
Material
{
get
set
}
|
||
type
|
IMaterial
|
||
value
|
The
material
or
null . |
||
implements
|
IModel.Material
|
Remarks:
If
the
material
of
a
model
is
null
,
the
material
of
the
parent
model
will
be
used.
The name of this model.
public
property
|
Name
{
get
set
}
|
||
type
|
string
|
||
value
|
The
model
name,
will
either
be
null
or
non-empty. |
||
implements
|
IModel.Name
|
The unit of measure in which model-space coordinates are expressed.
public
property
|
Unit
{
get
set
}
|
||
type
|
UnitOfMeasure
|
||
value
|
The
model-space
unit
of
measure
or
null . |
||
implements
|
IModel.Unit
|
Remarks:
If
the
unit
of
measure
of
a
model
is
null
,
the
unit
of
measure
of
the
parent
model
will
be
used.
If
the
model
does
not
have
a
parent,
metres
will
be
used
(see
Metre).
assumed
Defaults
to
null
.
Loads a 3D model from a file using Any.
public
static
method
|
Load
(Path file)
|
||
type
|
IModel
|
||
params
|
file
|
[not-null]
|
The file path. |
returns
|
|
The read model. |
Loads a 3D model from a file using Any.
public
static
method
|
Load
(IFileData file)
|
||
type
|
IModel
|
||
params
|
file
|
[not-null]
|
The file data. |
returns
|
|
The read model. |
Creates a new instance of Model.
public
constructor
|
Model
(string name = null)
|
||
params
|
name
|
Initial
value
for
Name.
Defaults
to
null . |
Creates a new instance of Model.
public
constructor
|
Model
(IModelGeometry geometry,
PrimitiveBatch batch,
IMaterial material = null,
ModelFlags flags = ModelFlags.Lighting
|
ModelFlags.FrontFaces,
string name = null)
|
||
params
|
geometry
|
[not-null]
|
Initial value for Geometry. |
batch
|
Initial value for Batch. | ||
material
|
Initial
value
for
Material.
Defaults
to
null .
|
||
flags
|
Initial value for Flags. Defaults to Lighting | FrontFaces. | ||
name
|
Initial
value
for
Name.
Defaults
to
null . |
Reads a 3D model from a file using Any.
[OwnerReturn]
|
||||
public
static
method
|
Read
(Path file)
|
|||
type
|
IModelReader
|
|||
params
|
file
|
[not-null]
|
The file path. | |
returns
|
|
The model reader. |
Reads a 3D model from a file using Any.
[OwnerReturn]
|
||||
public
static
method
|
Read
(IFileData file)
|
|||
type
|
IModelReader
|
|||
params
|
file
|
[not-null]
|
The file data. | |
returns
|
|
The model reader. |
Adds a child model.
public
method
|
ChildAdd
(IModel child)
|
||
type
|
Model
|
||
params
|
child
|
[not-null]
|
The model to add as a child. |
returns
|
|
this |
Adds a child model.
public
method
|
ChildAdd
(IModel child,
Mat4F transform)
|
||
type
|
Model
|
||
params
|
child
|
[not-null]
|
The model to add as a child. |
transform
|
The child-to-parent transformation to use. | ||
returns
|
|
this |
Returns the index-th child model.
[Pure]
|
||||
public
method
|
ChildModelAt
(int32 index)
|
|||
type
|
IModel
|
|||
params
|
index
|
[0..ChildCount-1]
|
The child model index. | |
returns
|
|
The child model. | ||
implements
|
IModel.ChildModelAt
|
Removes a child model.
public
method
|
ChildRemove
(IModel child)
|
||
params
|
child
|
[not-null]
|
The model to remove. |
Remarks:
If the given model is not a child of this model, the method silently returns.
Returns the child-to-parent transformation matrix of the index-th child model.
[Pure]
|
||||
public
method
|
ChildTransformAt
(int32 index)
|
|||
type
|
Mat4F
|
|||
params
|
index
|
[0..ChildCount-1]
|
The child model index. | |
returns
|
The transformation matrix. | |||
implements
|
IModel.ChildTransformAt
|
Remarks:
The transformation matrix uses the unit of measure of the parent model (see Unit).
Invalidates the current ModelCollider instance for this model.
public
method
|
ColliderDirty
()
|
Remarks:
Call this method when the model structure has been modified. A new model collider will be created the next time the Collider property is get.
Adds the given animation keyframe.
public
method
|
FrameAdd
(Mat4F frame)
|
||
params
|
frame
|
The keyframe transformation. |
Returns the index-th animation keyframe.
[Pure]
|
||||
public
method
|
FrameAt
(int32 index)
|
|||
type
|
Mat4F
|
|||
params
|
index
|
The keyframe index. | ||
returns
|
The animation keyframe. | |||
implements
|
IModel.FrameAt
|
Configures geometry instancing for this model.
public
method
|
UseGeometryInstancing
(IResourceHandle instanceBuffer)
|
||
type
|
IModel
|
||
params
|
instanceBuffer
|
The
resource
handle
that
returns
an
IVertexBuffer
object
that
holds
instance
data
to
use
for
this
model
object
or
null
to
disable
geometry
instancing.
The
instanceBuffer
value
will
be
returned
by
the
InstanceBuffer
property
of
the
geometry
objects
of
the
returned
model
and
all
its
descendants.
|
|
returns
|
|
The resulting model. | |
implements
|
IModel.UseGeometryInstancing
|
See also:
IModelGeometry.InstanceBuffer