Class Model
This class represent a 3D scene model.
Inherited Members
Namespace: Evergine.Framework.Graphics
Assembly: Evergine.Framework.dll
Syntax
public class Model : ILoadable, IDisposable, IDependencyObject
Constructors
Model()
Initializes a new instance of the Model class.
Declaration
public Model()
Model(string, Mesh)
Initializes a new instance of the Model class. Create simple model based on a single mesh.
Declaration
public Model(string name, Mesh mesh)
Parameters
Type | Name | Description |
---|---|---|
string | name | Mesh name. |
Mesh | mesh | Mesh instance. |
Fields
BoundingBox
The bounding box.
Declaration
public BoundingBox? BoundingBox
Field Value
Type | Description |
---|---|
BoundingBox? |
BufferData
Gets the list of buffer data content.
Declaration
public BufferContent[] BufferData
Field Value
Type | Description |
---|---|
BufferContent[] |
Buffers
Gets the mesh buffers.
Declaration
public Buffer[] Buffers
Field Value
Type | Description |
---|---|
Buffer[] |
Materials
Material list.
Declaration
public List<(string, Guid)> Materials
Field Value
Type | Description |
---|---|
List<(string, Guid)> |
Source
The model source.
Declaration
public ModelSource Source
Field Value
Type | Description |
---|---|
ModelSource |
Properties
AllNodes
Gets or sets all nodes collection.
Declaration
public NodeContent[] AllNodes { get; set; }
Property Value
Type | Description |
---|---|
NodeContent[] |
Animations
Gets or sets the animation list.
Declaration
public Dictionary<string, AnimationClip> Animations { get; set; }
Property Value
Type | Description |
---|---|
Dictionary<string, AnimationClip> |
Dependencies
Gets the dependency list.
Declaration
public Lazy<List<IDependencyLink>> Dependencies { get; }
Property Value
Type | Description |
---|---|
Lazy<List<IDependencyLink>> |
Id
Gets or sets the asset Id.
Declaration
public Guid Id { get; set; }
Property Value
Type | Description |
---|---|
Guid | The asset path. |
LOD
Gets or sets the LOD.
Declaration
public LODContent[] LOD { get; set; }
Property Value
Type | Description |
---|---|
LODContent[] |
MeshContainers
Gets or sets the mesh containers.
Declaration
public MeshContainer[] MeshContainers { get; set; }
Property Value
Type | Description |
---|---|
MeshContainer[] |
ReaderVersion
Gets the reader version.
Declaration
public Version ReaderVersion { get; }
Property Value
Type | Description |
---|---|
Version | The reader version. |
RootNodes
Gets or sets the root nodes.
Declaration
public int[] RootNodes { get; set; }
Property Value
Type | Description |
---|---|
int[] |
Skins
Gets or sets the skins of the model.
Declaration
public SkinContent[] Skins { get; set; }
Property Value
Type | Description |
---|---|
SkinContent[] |
Methods
Dispose()
Declaration
public void Dispose()
FindMeshContainerByName(string)
Find a mesh by name.
Declaration
public MeshContainer FindMeshContainerByName(string meshName)
Parameters
Type | Name | Description |
---|---|---|
string | meshName | mesh name. |
Returns
Type | Description |
---|---|
MeshContainer | The mesh name. |
InstantiateModelHierarchy(AssetsService)
Instantiate model hierarchy.
Declaration
public Entity InstantiateModelHierarchy(AssetsService assetsService)
Parameters
Type | Name | Description |
---|---|---|
AssetsService | assetsService | Assets Service. |
Returns
Type | Description |
---|---|
Entity | The entity hierarchy. |
InstantiateModelHierarchy(string, AssetsService)
Instantiate model hierarchy.
Declaration
public Entity InstantiateModelHierarchy(string entityName, AssetsService assetsService)
Parameters
Type | Name | Description |
---|---|---|
string | entityName | The entity name. |
AssetsService | assetsService | Assets Service. |
Returns
Type | Description |
---|---|
Entity | The entity hierarchy. |
Invalidate(ILoadable)
Invalidates this instance and raise the Invalidated event with the new ILoadable instance.
Declaration
public void Invalidate(ILoadable newInstance)
Parameters
Type | Name | Description |
---|---|---|
ILoadable | newInstance | The new ILoadable instance. |
RefreshBoundingBox()
Compute bounding box.
Declaration
public void RefreshBoundingBox()
ReleaseCPUBuffer()
Retain the CPU buffer in memory.
Declaration
public void ReleaseCPUBuffer()
ReleaseUnusedMemory()
Release unused memory.
Declaration
public void ReleaseUnusedMemory()
RetainCPUBuffer()
Retain the CPU buffer in memory.
Declaration
public void RetainCPUBuffer()
Events
Invalidated
Occurs when this instance has been invalidated and all references must be reloaded.
Declaration
public event EventHandler<ILoadable> Invalidated
Event Type
Type | Description |
---|---|
EventHandler<ILoadable> |