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.
public sealed class AnimatedModelData : IDisposable
- Inheritance
-
AnimatedModelData
- Implements
- Inherited Members
Constructors
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.
public AnimatedModelData(string filePath)
Parameters
filePathstring
Properties
AnimationCount
Number of skeletal animations loaded from the GLB file.
public int AnimationCount { get; }
Property Value
Animations
The loaded skeletal animations (shared bone/keyframe data).
public ModelAnimation[] Animations { get; }
Property Value
- ModelAnimation[]
CustomShader
Reserved for future GPU skinning shader assignment (Story 13.6).
public Shader? CustomShader { get; set; }
Property Value
- Shader?
FilePath
Original file path used to load this model (cache key).
public string FilePath { get; }
Property Value
IsValid
True if the model loaded successfully (MeshCount > 0).
public bool IsValid { get; }
Property Value
Model
The loaded Raylib Model struct (shared GPU mesh/material data).
public Model Model { get; }
Property Value
- Model
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.
public bool UsesGpuSkinning { get; }
Property Value
Methods
Dispose()
Disposes the model data by delegating to Unload(). Follows the ModelThumbnailRenderer dispose pattern.
public void Dispose()
FindAnimationIndex(string)
Finds the index of an animation by name.
public int FindAnimationIndex(string name)
Parameters
namestringThe animation name to search for.
Returns
- int
The animation index, or -1 if not found.
GetAnimationName(int)
Gets the name of an animation by index.
public string? GetAnimationName(int index)
Parameters
indexintThe animation index.
Returns
- string
The animation name, or null if invalid index.
Unload()
Unloads the Model and all ModelAnimations, freeing GPU resources. Safe to call on invalid or already-disposed instances.
public void Unload()