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.
Implements
Inherited Members
Namespace: PopcorningGuineaPig.Engine.Gameplay
Assembly: PopcorningGuineaPig.Engine.dll
Syntax
public sealed class AnimatedModelData : IDisposable
Constructors
| Edit this page View SourceAnimatedModelData(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 SourceAnimationCount
Number of skeletal animations loaded from the GLB file.
Declaration
public int AnimationCount { get; }
Property Value
| Type | Description |
|---|---|
| int |
Animations
The loaded skeletal animations (shared bone/keyframe data).
Declaration
public ModelAnimation[] Animations { get; }
Property Value
| Type | Description |
|---|---|
| ModelAnimation[] |
CustomShader
Reserved for future GPU skinning shader assignment (Story 13.6).
Declaration
public Shader? CustomShader { get; set; }
Property Value
| Type | Description |
|---|---|
| Shader? |
FilePath
Original file path used to load this model (cache key).
Declaration
public string FilePath { get; }
Property Value
| Type | Description |
|---|---|
| string |
IsValid
True if the model loaded successfully (MeshCount > 0).
Declaration
public bool IsValid { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Model
The loaded Raylib Model struct (shared GPU mesh/material data).
Declaration
public Model Model { get; }
Property Value
| Type | Description |
|---|---|
| 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.
Declaration
public bool UsesGpuSkinning { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
| Edit this page View SourceDispose()
Disposes the model data by delegating to Unload(). Follows the ModelThumbnailRenderer dispose pattern.
Declaration
public void Dispose()
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. |
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. |
Unload()
Unloads the Model and all ModelAnimations, freeing GPU resources. Safe to call on invalid or already-disposed instances.
Declaration
public void Unload()