Skylicht Engine
Toggle main menu visibility
Loading...
Searching...
No Matches
Importer
Collada
CColladaAnimLoader.h
1
/*
2
!@
3
MIT License
4
5
Copyright (c) 2019 Skylicht Technology CO., LTD
6
7
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files
8
(the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify,
9
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
10
subject to the following conditions:
11
12
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
13
14
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
16
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
17
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19
20
This file is part of the "Skylicht Engine".
21
https://github.com/skylicht-lab/skylicht-engine
22
!#
23
*/
24
25
#pragma once
26
27
#include "Importer/IAnimationImporter.h"
28
29
namespace
Collada
30
{
31
struct
SNodeParam
;
32
}
33
34
using namespace
Collada;
35
36
namespace
Skylicht
37
{
38
class
CAnimationClip
;
39
struct
SEntityAnim
;
40
41
class
SKYLICHT_API CColladaAnimLoader :
public
IAnimationImporter
42
{
43
protected
:
44
bool
m_zUp;
45
bool
m_flipOx;
46
47
std::string m_unit;
48
float
m_unitScale;
49
core::matrix4 m_unitScaleMatrix;
50
51
std::vector<CAnimationClip*> m_clips;
52
std::map<std::string, SEntityAnim*> m_nodeAnim;
53
54
SNodeParam
* m_colladaRoot;
55
std::vector<SNodeParam*> m_listNode;
56
57
public
:
58
CColladaAnimLoader();
59
60
virtual
~CColladaAnimLoader();
61
62
bool
loadAnimation(
const
char
* resource,
CAnimationClip
* output);
63
64
protected
:
65
void
constructAnimation(
const
char
* fileName,
CAnimationClip
* output);
66
67
void
clearData();
68
69
void
parseUnit(io::IXMLReader* xmlRead);
70
71
void
parseAnimationNode(io::IXMLReader* xmlRead);
72
73
void
parseAnimationSourceNode(io::IXMLReader* xmlRead);
74
75
void
parseDefaultValuePosition(io::IXMLReader* xmlRead,
float
* x,
float
* y,
float
* z);
76
77
void
parseDefaultValueRotate(io::IXMLReader* xmlRead,
float
* x,
float
* y,
float
* z,
float
* angle);
78
79
void
parseSceneNode(io::IXMLReader* xmlRead);
80
81
SNodeParam
* parseNode(io::IXMLReader* xmlRead,
SNodeParam
* parent);
82
83
SNodeParam
* getNode(
const
std::string& nodeName);
84
};
85
}
Skylicht::CAnimationClip
Represents an animation clip containing multiple animation tracks for different entities.
Definition
CAnimationClip.h:41
Skylicht
Everything in the Skylicht Engine. You can start by looking at the topics.
Definition
AudioDebugLog.h:29
Collada::SNodeParam
Definition
CColladaLoader.h:194
Skylicht::SEntityAnim
Definition
CAnimationClip.h:33
Generated by
1.17.0