|
persona-3-dual
A DS demake of Persona 3
|
Loads, animates, and renders a model in the DS geometry engine. More...
#include <AnimationController.hpp>

Public Member Functions | |
| bool | loadModel (const char *filepath) |
| Loads an MDL2 or legacy MDL1 model file. | |
| bool | loadTextures (int count, const unsigned int **bitmaps, const int *widths, const int *heights, const bool *isRGBA) |
| Uploads model textures to VRAM after loadModel(). | |
| void | unloadTextures () |
| Deletes all model texture objects from VRAM. | |
| void | set (int animIndex, bool loop=true) |
| Selects an animation. | |
| void | play () |
| Starts the selected animation. | |
| void | stop () |
| Stops playback and resets the selected animation frame. | |
| void | pause () |
| Finishes the current animation at its next boundary. | |
| void | setAnimationSpeed (ae::q20_12_t speedMultiplier=ae::q20_12_t{1.0}) |
| Sets animation playback speed. | |
| void | update () |
| Advances the selected animation by one frame tick. | |
| void | render () |
| Renders the model hierarchy using the current animation frame. | |
| bool | isAnimationPlaying () const |
| int | getCurrentAnimIndex () const |
Static Public Member Functions | |
| static void | create () |
| Creates the singleton instance if it does not exist. | |
| static void | destroy () |
| Destroys the singleton instance and unloads model textures. | |
| static AnimationController * | getInstance () |
Private Member Functions | |
| AnimationController () | |
| ~AnimationController () | |
| Releases texture objects owned by the controller. | |
| void | renderNode (int nodeId) |
| Keyframe | getInterpolatedFrame (const AnimTrack &track, int timeFP, int nodeId) |
Static Private Member Functions | |
| static int | textureSizeToEnum (int px) |
Private Attributes | |
| std::vector< AnimNode > | modelNodes |
| std::vector< Animation > | animations |
| std::vector< int > | trackIndices |
| std::vector< int > | rootNodes |
| std::vector< int > | textureIDs |
| int | currentAnimIndex = -1 |
| int | currentFrameFP = 0 |
| int | animSpeedFP = 128 |
| bool | isPlaying = false |
| bool | isFinishing = false |
| bool | isLooping = true |
Static Private Attributes | |
| static AnimationController * | instance = nullptr |
Loads, animates, and renders a model in the DS geometry engine.
Model files provide node hierarchies, animation tracks, and display lists. Texture data is supplied separately by generated model helpers and uploaded to VRAM through this controller.
Definition at line 16 of file AnimationController.hpp.
|
private |
|
private |
Releases texture objects owned by the controller.
Definition at line 38 of file AnimationController.cpp.

|
static |
Creates the singleton instance if it does not exist.
Definition at line 8 of file AnimationController.cpp.


|
static |
Destroys the singleton instance and unloads model textures.
Definition at line 16 of file AnimationController.cpp.
|
inline |
Definition at line 83 of file AnimationController.hpp.
|
static |
Definition at line 25 of file AnimationController.cpp.

|
private |
Definition at line 345 of file AnimationController.cpp.


|
inline |
Definition at line 78 of file AnimationController.hpp.
| bool AnimationController::loadModel | ( | const char * | filepath | ) |
Loads an MDL2 or legacy MDL1 model file.
| filepath | Path to the compiled model binary. |
Definition at line 96 of file AnimationController.cpp.

| bool AnimationController::loadTextures | ( | int | count, |
| const unsigned int ** | bitmaps, | ||
| const int * | widths, | ||
| const int * | heights, | ||
| const bool * | isRGBA ) |
Uploads model textures to VRAM after loadModel().
| count | Number of texture slots. |
| bitmaps | Grit-generated bitmap data, one pointer per slot. |
| widths | Texture widths in pixels. |
| heights | Texture heights in pixels. |
| isRGBA | true for RGBA textures, false for RGB textures. |
Definition at line 225 of file AnimationController.cpp.

| void AnimationController::pause | ( | ) |
Finishes the current animation at its next boundary.
Definition at line 306 of file AnimationController.cpp.
| void AnimationController::play | ( | ) |
Starts the selected animation.
Definition at line 283 of file AnimationController.cpp.
| void AnimationController::render | ( | ) |
Renders the model hierarchy using the current animation frame.
Definition at line 407 of file AnimationController.cpp.

|
private |
Definition at line 424 of file AnimationController.cpp.


| void AnimationController::set | ( | int | animIndex, |
| bool | loop = true ) |
Selects an animation.
| animIndex | Animation index in the loaded model. |
| loop | Whether playback should loop when it reaches the end. |
Definition at line 268 of file AnimationController.cpp.

|
inline |
Sets animation playback speed.
| speedMultiplier | Multiplier relative to the default speed. |
Definition at line 66 of file AnimationController.hpp.
| void AnimationController::stop | ( | ) |
Stops playback and resets the selected animation frame.
Definition at line 298 of file AnimationController.cpp.
|
staticprivate |
| void AnimationController::unloadTextures | ( | ) |
Deletes all model texture objects from VRAM.
Definition at line 257 of file AnimationController.cpp.

| void AnimationController::update | ( | ) |
Advances the selected animation by one frame tick.
Definition at line 311 of file AnimationController.cpp.
|
private |
Definition at line 99 of file AnimationController.hpp.
|
private |
Definition at line 108 of file AnimationController.hpp.
|
private |
Definition at line 106 of file AnimationController.hpp.
|
private |
Definition at line 107 of file AnimationController.hpp.
|
staticprivate |
Definition at line 92 of file AnimationController.hpp.
|
private |
Definition at line 110 of file AnimationController.hpp.
|
private |
Definition at line 111 of file AnimationController.hpp.
|
private |
Definition at line 109 of file AnimationController.hpp.
|
private |
Definition at line 98 of file AnimationController.hpp.
|
private |
Definition at line 101 of file AnimationController.hpp.
|
private |
Definition at line 104 of file AnimationController.hpp.
|
private |
Definition at line 100 of file AnimationController.hpp.