Skylicht Engine
Loading...
Searching...
No Matches
Skylicht::CAnimationManager Class Reference

Singleton manager for loading, caching, and exporting animations. More...

#include <Animation/CAnimationManager.h>

Public Member Functions

CAnimationcreateAnimation (const char *name)
 Creates or retrieves a named animation container.
CAnimationgetAnimation (const char *animName)
 Gets a named animation container.
CAnimationCliploadAnimation (const char *resource)
 Loads an animation clip from a file.
CAnimationCliploadAnimation (const char *resource, IAnimationImporter *importer)
 Loads an animation clip using a specific importer.
bool exportAnimation (CAnimationClip *clip, const char *output)
 Exports an animation clip to a file.
bool exportAnimation (CAnimationClip *clip, const char *output, IAnimationExporter *exporter)
 Exports an animation clip using a specific exporter.
void releaseAllClips ()
 Releases all cached animation clips.
void releaseAllAnimations ()
 Releases all cached animation containers.

Protected Attributes

std::map< std::string, CAnimationClip * > m_clips
 Cached animation clips indexed by resource path.
std::map< std::string, CAnimation * > m_animations
 Cached animation containers indexed by name.

Detailed Description

Singleton manager for loading, caching, and exporting animations.

Example: Loading and playing an animation

// Load animation clip from file (.dae, .fbx, or .sanim)
CAnimationClip* clip = CAnimationManager::getInstance()->loadAnimation("Hero@Idle.sanim");
if (clip)
{
// Apply to a skeleton
skeleton->setAnimation(clip, true);
}
Represents an animation clip containing multiple animation tracks for different entities.
Definition CAnimationClip.h:41

Member Function Documentation

◆ createAnimation()

CAnimation * Skylicht::CAnimationManager::createAnimation ( const char * name)

Creates or retrieves a named animation container.

Parameters
nameThe unique name for the container.
Returns
Pointer to CAnimation.

◆ exportAnimation() [1/2]

bool Skylicht::CAnimationManager::exportAnimation ( CAnimationClip * clip,
const char * output )

Exports an animation clip to a file.

Parameters
clipPointer to the clip to export.
outputDestination file path.
Returns
True on success, false on failure.

◆ exportAnimation() [2/2]

bool Skylicht::CAnimationManager::exportAnimation ( CAnimationClip * clip,
const char * output,
IAnimationExporter * exporter )

Exports an animation clip using a specific exporter.

Parameters
clipPointer to the clip to export.
outputDestination file path.
exporterPointer to the exporter implementation.
Returns
True on success, false on failure.

◆ getAnimation()

CAnimation * Skylicht::CAnimationManager::getAnimation ( const char * animName)
inline

Gets a named animation container.

Parameters
animNameThe name of the container.
Returns
Pointer to CAnimation, or NULL if not found.

◆ loadAnimation() [1/2]

CAnimationClip * Skylicht::CAnimationManager::loadAnimation ( const char * resource)

Loads an animation clip from a file.

Parameters
resourcePath to the animation file (.dae, .fbx, .sanim).
Returns
Pointer to the loaded CAnimationClip, or NULL on failure.

◆ loadAnimation() [2/2]

CAnimationClip * Skylicht::CAnimationManager::loadAnimation ( const char * resource,
IAnimationImporter * importer )

Loads an animation clip using a specific importer.

Parameters
resourcePath or identifier for the animation resource.
importerPointer to the importer implementation.
Returns
Pointer to the loaded CAnimationClip, or NULL on failure.

The documentation for this class was generated from the following file: