CSEngine
Loading...
Searching...
No Matches
CSE::DAEAnimationLoader Class Reference

Public Member Functions

bool Load (const char *path, std::string name)
 
AnimationDataGetAnimation () const
 

Detailed Description

Definition at line 45 of file DAEAnimationLoader.h.

Constructor & Destructor Documentation

◆ ~DAEAnimationLoader()

DAEAnimationLoader::~DAEAnimationLoader ( )

Definition at line 21 of file DAEAnimationLoader.cpp.

21 {
22 SAFE_DELETE(m_root);
23 if(m_animationData == nullptr) return;
24 for (auto frame : m_animationData->keyFrames) {
25 for (auto joint : frame->jointTransforms) {
26 SAFE_DELETE(joint);
27 }
28 frame->jointTransforms.clear();
29 SAFE_DELETE(frame);
30 }
31 m_animationData->keyFrames.clear();
32 SAFE_DELETE(m_animationData);
33}

Member Function Documentation

◆ GetAnimation()

AnimationData * CSE::DAEAnimationLoader::GetAnimation ( ) const
inline

Definition at line 53 of file DAEAnimationLoader.h.

53 {
54 return m_animationData;
55 }

◆ Load()

bool DAEAnimationLoader::Load ( const char *  path,
std::string  name 
)

Definition at line 35 of file DAEAnimationLoader.cpp.

35 {
36 m_name = std::move(name);
37
38 m_root = XFILE(path).getRoot();
39 XNode collada = m_root->getChild("COLLADA");
40
41#ifdef __EMSCRIPTEN__
42 if(!collada.hasChild("library_animations")) return false;
43 if(!collada.hasChild("library_visual_scenes")) return false;
44#endif
45 m_animation = collada.getChild("library_animations");
46 m_joint = collada.getChild("library_visual_scenes");
47#ifdef __EMSCRIPTEN__
48 if(!m_animation.getChild("animation").hasChild("source")) return false;
49 if(!m_joint.getChild("visual_scene").hasChild("node")) return false;
50#endif
51 LoadAnimation();
52 return true;
53}
Definition XML.h:77
Definition XML.h:43

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