Class Model
Represents a 3D model in the game.
Inherited Members
Namespace: Genesis.Core.GameElements
Assembly: Genesis.dll
Syntax
public class Model : GameElement
Constructors
Model(string, Vec3, string)
Constructs a new instance of the Model class.
Declaration
public Model(string name, Vec3 location, string filename)
Parameters
Type | Name | Description |
---|---|---|
string | name | |
Vec3 | location | |
string | filename |
Properties
AnimationSpeed
Gets or sets the speed of animation playback.
Declaration
public float AnimationSpeed { get; set; }
Property Value
Type | Description |
---|---|
float |
Animations
Gets or sets the list of animations associated with the model.
Declaration
public List<Animation> Animations { get; set; }
Property Value
Type | Description |
---|---|
List<Animation> |
Animator
Gets or sets the animator responsible for controlling animations.
Declaration
public Animator Animator { get; set; }
Property Value
Type | Description |
---|---|
Animator |
BoneCounter
Gets or sets the counter for bones in the model.
Declaration
public int BoneCounter { get; set; }
Property Value
Type | Description |
---|---|
int |
BoneInfoMap
Gets or sets the mapping of bone names to bone information.
Declaration
public Dictionary<string, boneinfo> BoneInfoMap { get; set; }
Property Value
Type | Description |
---|---|
Dictionary<string, boneinfo> |
FileDirectory
Gets or sets the directory of the model file.
Declaration
public string FileDirectory { get; set; }
Property Value
Type | Description |
---|---|
string |
FileName
Gets or sets the name of the model file.
Declaration
public string FileName { get; set; }
Property Value
Type | Description |
---|---|
string |
Materials
Gets or sets the list of materials used by the model.
Declaration
public List<Material> Materials { get; set; }
Property Value
Type | Description |
---|---|
List<Material> |
Meshes
Gets or sets the list of meshes composing the model.
Declaration
public List<ModelMesh> Meshes { get; set; }
Property Value
Type | Description |
---|---|
List<ModelMesh> |
Shader
Gets or sets the shader program used for rendering the model.
Declaration
public ShaderProgram Shader { get; set; }
Property Value
Type | Description |
---|---|
ShaderProgram |
Methods
ExtractAnimations(Scene)
Extracts animations from the imported model.
Declaration
public void ExtractAnimations(Scene scene)
Parameters
Type | Name | Description |
---|---|---|
Scene | scene |
ExtractMaterials(Scene)
Extracts materials information from the imported model.
Declaration
public void ExtractMaterials(Scene scene)
Parameters
Type | Name | Description |
---|---|---|
Scene | scene |
ExtractMeshes(Scene)
Extracts mesh data from the imported model.
Declaration
public void ExtractMeshes(Scene scene)
Parameters
Type | Name | Description |
---|---|---|
Scene | scene |
FindAnimation(string)
Finds an animation with the specified name.
Declaration
public Animation FindAnimation(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name |
Returns
Type | Description |
---|---|
Animation |
Init(Game, IRenderDevice)
Initializes the model within the game environment.
Declaration
public override void Init(Game game, IRenderDevice renderDevice)
Parameters
Type | Name | Description |
---|---|---|
Game | game | |
IRenderDevice | renderDevice |
Overrides
OnDestroy(Game)
Cleans up resources associated with the model when destroyed.
Declaration
public override void OnDestroy(Game game)
Parameters
Type | Name | Description |
---|---|---|
Game | game |
Overrides
OnRender(Game, IRenderDevice)
Renders the model within the game environment.
Declaration
public override void OnRender(Game game, IRenderDevice renderDevice)
Parameters
Type | Name | Description |
---|---|---|
Game | game | |
IRenderDevice | renderDevice |
Overrides
OnUpdate(Game, IRenderDevice)
Updates the model within the game environment.
Declaration
public override void OnUpdate(Game game, IRenderDevice renderDevice)
Parameters
Type | Name | Description |
---|---|---|
Game | game | |
IRenderDevice | renderDevice |
Overrides
PlayAnimation(string)
Plays the specified animation on the model.
Declaration
public void PlayAnimation(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name |