Popcorning Guinea Pig
Search Results for

    Show / Hide Table of Contents

    Class AnimatedModelData

    Shared data for an animated GLB model (Flyweight intrinsic state). Loads the Raylib Model and all skeletal ModelAnimations once per unique file path. Instances share this data via AnimatedModelInstance structs.

    Inheritance
    object
    AnimatedModelData
    Implements
    IDisposable
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: PopcorningGuineaPig.Engine.Gameplay
    Assembly: PopcorningGuineaPig.Engine.dll
    Syntax
    public sealed class AnimatedModelData : IDisposable

    Constructors

    | Edit this page View Source

    AnimatedModelData(string)

    Loads a GLB model and its skeletal animations from the given file path. Raylib returns default (empty) structs for missing/corrupt files — no exceptions are thrown.

    Declaration
    public AnimatedModelData(string filePath)
    Parameters
    Type Name Description
    string filePath

    Properties

    | Edit this page View Source

    AnimationCount

    Number of skeletal animations loaded from the GLB file.

    Declaration
    public int AnimationCount { get; }
    Property Value
    Type Description
    int
    | Edit this page View Source

    Animations

    The loaded skeletal animations (shared bone/keyframe data).

    Declaration
    public ModelAnimation[] Animations { get; }
    Property Value
    Type Description
    ModelAnimation[]
    | Edit this page View Source

    CustomShader

    Reserved for future GPU skinning shader assignment (Story 13.6).

    Declaration
    public Shader? CustomShader { get; set; }
    Property Value
    Type Description
    Shader?
    | Edit this page View Source

    FilePath

    Original file path used to load this model (cache key).

    Declaration
    public string FilePath { get; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    IsValid

    True if the model loaded successfully (MeshCount > 0).

    Declaration
    public bool IsValid { get; }
    Property Value
    Type Description
    bool
    | Edit this page View Source

    Model

    The loaded Raylib Model struct (shared GPU mesh/material data).

    Declaration
    public Model Model { get; }
    Property Value
    Type Description
    Model
    | Edit this page View Source

    UsesGpuSkinning

    True when this model is rigged and its materials draw through PopcorningGuineaPig.Engine.Gameplay.SkinningShader. False for static props, and for rigged models loaded without a GL context.

    Declaration
    public bool UsesGpuSkinning { get; }
    Property Value
    Type Description
    bool

    Methods

    | Edit this page View Source

    Dispose()

    Disposes the model data by delegating to Unload(). Follows the ModelThumbnailRenderer dispose pattern.

    Declaration
    public void Dispose()
    | Edit this page View Source

    FindAnimationIndex(string)

    Finds the index of an animation by name.

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

    The animation name to search for.

    Returns
    Type Description
    int

    The animation index, or -1 if not found.

    | Edit this page View Source

    GetAnimationName(int)

    Gets the name of an animation by index.

    Declaration
    public string? GetAnimationName(int index)
    Parameters
    Type Name Description
    int index

    The animation index.

    Returns
    Type Description
    string

    The animation name, or null if invalid index.

    | Edit this page View Source

    Unload()

    Unloads the Model and all ModelAnimations, freeing GPU resources. Safe to call on invalid or already-disposed instances.

    Declaration
    public void Unload()

    Implements

    IDisposable
    • Edit this page
    • View Source
    In this article
    Back to top © 2024 Popcorning Guinea Pig Game Engine. A custom C# game engine for indie developers.