GFX
  • Docs
  • API
Search Results for

    Show / Hide Table of Contents
    • Genesis.Core
      • AssetManager
      • DirectionalLight
      • Game
      • GameElement
      • GameEventHandler
      • IGameBehavior
      • Input
      • Input.Keys
      • Layer
      • Light
      • Light2D
      • PointLight
      • Scene
      • Scene2D
      • Scene3D
      • SceneEventHandler
      • SceneSizeEvenHandler
      • Storage
      • Utils
      • Window
      • Window.WindowEventHandler
      • WindowUtilities
      • WindowUtilities.POINT
      • WindowUtilities.RECT
    • Genesis.Core.Behaviors
      • AnimationBehavior
      • CameraFlags
      • CharacterController2D
      • ControllerPreset
      • MoveDirection
      • MovementFlags
      • SpriteMovementController
    • Genesis.Core.Behaviors.Physics2D
      • BoxCollider
      • BoxRigidBody
      • BoxTrigger2D
      • BufferedSpriteCollider
      • PhysicsBox2D
      • PhysicsPolygon2D
      • Rigidbody2D
    • Genesis.Core.Behaviors.Physics3D
      • BoxCollider
      • BoxRigidBody
      • BoxTrigger
      • CapsuleCollider
      • CapsuleRigidBody
      • CompoundMeshCollider
      • ConvexHullBehavior
      • ConvexHullCollider
      • MeshCollider
      • QubeConvexHull
      • SphereCollider
      • SphereRigidBody
      • SphereTrigger
      • StaticMeshBehavior
    • Genesis.Core.Behaviors._3D
      • Stance
      • ThirdpersonCharacterController
    • Genesis.Core.GameElements
      • BufferedSprite
      • CameraElement
      • Element3D
      • Empty
      • FindPathAsynchResult
      • GridCell
      • Model
      • NavMesh
      • Obstacle
      • ParticleBuffers
      • ParticleDeffinition
      • ParticleEmitter
      • Qube
      • RectElement
      • Skybox
      • Sphere
      • Sprite
      • SpriteShapeDeffinition
      • Terrain2D
      • Terrain3D
      • TerrainData
      • Waypoint
    • Genesis.Graphics
      • Animation
      • AnimationCallback
      • AnimationCallback.AnimationEvent
      • Camera
      • CameraType
      • Face
      • Font
      • Framebuffer
      • Frustum
      • Glyphe
      • IRenderDevice
      • InstancedElement
      • InstancedMesh
      • Material
      • MaterialBuffer
      • Mesh
      • PerspectiveCamera
      • RenderInstanceContainer
      • RenderSettings
      • Shader
      • ShaderProgram
      • SpriteSheet
      • TexCoords
      • Texture
      • Viewport
    • Genesis.Graphics.Animation3D
      • Animation
      • Animator
      • AssimpNodeData
      • Bone
      • KeyPosition
      • KeyRotation
      • KeyScale
      • ModelMesh
      • boneinfo
      • vertex
    • Genesis.Graphics.Physics
      • BulletDebugRenderer
    • Genesis.Graphics.RenderDevice
      • GLRenderer
      • LegacyRenerer
    • Genesis.Graphics.Shaders.OpenGL
      • AnimatedModelShader
      • BasicShader
      • BorderCircleShader
      • DiffuseLightning
      • DiffuseNormalLightning
      • DiffuseNormalShader
      • DiffuseShader
      • DiffuseSolidShader
      • Element3DShader
      • FXScreenSpaceShadowShader
      • InstanceShader2D
      • InstancedShader
      • Light2DShader
      • LightmapShader
      • MVPRectShader
      • MVPShader
      • MVPSolidShader
      • ParticleShader
      • ScreenShader
      • SkyboxShader
      • SolidShapeShader
      • SpecularShader
      • SpriteShader
      • TerrainShader
      • WireframeShader
    • Genesis.Graphics.Shapes
      • BufferedSpriteShape
      • CircleShape
      • FrameShape
      • GlypheShape
      • Light2DShape
      • LineShape
      • PlaneShape
      • QubeShape
      • RectShape
      • Shape
      • SphereShape
      • SpriteShape
    • Genesis.Math
      • Matrix4x4
      • NoisePoint
      • PerlinNoise
      • Rect
      • Vec3
    • Genesis.Physics
      • Aabb
      • ColliderBehavior2D
      • ColliderBehavior3D
      • CollisionGroup
      • CollisionGroupExtensions
      • HitResult
      • HitResult2D
      • MatrixSet
      • MouseRay2
      • PhysicHandler
      • PhysicHandlerEvent
      • PhysicPropeterys
      • PhysicsBehavior
      • PhysicsBehaviorEvent
      • PhysicsHandler2D
      • PhysicsHandler3D
      • Ray2D
      • Raycast
      • Raycast2D
      • RigidBodyBehavior2D
      • RigidBodyBehavior3D
      • TriggerBehavior2D
      • TriggerBehavior3D
    • Genesis.UI
      • Button
      • Canvas
      • GridView
      • ImageButton
      • Label
      • ListItem
      • ListItemBehavior
      • ListSelector
      • ListSelectorBehavior
      • Panel
      • ProgressBar
      • UIEvent
      • UIParseHandler
      • UIParser
      • Widget
      • WidgetAnchor
    • Genesis.UI.Items
      • GridViewImageIcon
      • IItem

    Class Model

    Represents a 3D model in the game.

    Inheritance
    object
    GameElement
    Model
    Inherited Members
    GameElement.AddBehavior<T>(T)
    GameElement.AddBehavior(IGameBehavior)
    GameElement.GetBehavior<T>()
    GameElement.GetBehaviors<T>()
    GameElement.AddChild(GameElement)
    GameElement.GetInstance(GameElement)
    GameElement.HasTag(string)
    GameElement.Name
    GameElement.Tag
    GameElement.Location
    GameElement.Rotation
    GameElement.Size
    GameElement.Behaviors
    GameElement.Scene
    GameElement.Enabled
    GameElement.Propertys
    GameElement.Children
    GameElement.Parent
    GameElement.UUID
    GameElement.CastShadows
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    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

    AnimationCallbacks

    Gets or sets the list of animation callbacks.

    Declaration
    public List<AnimationCallback> AnimationCallbacks { get; set; }
    Property Value
    Type Description
    List<AnimationCallback>

    A list of AnimationCallback objects representing the callbacks to be triggered at specific frames of animations.

    Remarks

    This property holds the callbacks that are associated with specific frames of animations. These callbacks are checked and potentially triggered during the animation update process.

    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

    AddAnimationCallback(string, int, AnimationEvent)

    Adds a callback to be triggered at a specific frame of a specified animation.

    Declaration
    public void AddAnimationCallback(string name, int frame, AnimationCallback.AnimationEvent callback)
    Parameters
    Type Name Description
    string name

    The name of the animation to which the callback should be added.

    int frame

    The frame at which the callback should be triggered.

    AnimationCallback.AnimationEvent callback

    The callback event to be triggered at the specified frame.

    Remarks

    This method registers a new animation callback by adding it to the list of animation callbacks.

    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

    GetAnimationLength(string)

    Gets the keyframe length of the specified animation by its name.

    Declaration
    public int GetAnimationLength(string name)
    Parameters
    Type Name Description
    string name

    The name of the animation.

    Returns
    Type Description
    int

    The keyframe length of the specified animation if it exists; otherwise, returns -1.

    Remarks

    This method searches for an animation by its name and returns its keyframe length.

    GetCurrentAnimationFrame()

    Gets the current keyframe index of the animation being played by the animator.

    Declaration
    public int GetCurrentAnimationFrame()
    Returns
    Type Description
    int

    The current keyframe index if an animation is being played; otherwise, returns -1.

    Remarks

    This method checks if there is a current animation being played by the animator and retrieves the keyframe index based on the current time of the 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
    GameElement.Init(Game, IRenderDevice)

    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
    GameElement.OnDestroy(Game)

    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
    GameElement.OnRender(Game, IRenderDevice)

    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
    GameElement.OnUpdate(Game, IRenderDevice)

    PlayAnimation(string)

    Plays the specified animation on the model.

    Declaration
    public void PlayAnimation(string name)
    Parameters
    Type Name Description
    string name

    StopAnimation()

    Stops the currently playing animation.

    Declaration
    public void StopAnimation()
    Remarks

    This method sets the animator's play state to false, effectively pausing the animation.

    In this article
    Back to top Generated by DocFX