Skylicht Engine
Toggle main menu visibility
Loading...
Searching...
No Matches
Animation
CAnimationController.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 "Skeleton/CSkeleton.h"
28
#include "Components/CComponentSystem.h"
29
30
namespace
Skylicht
31
{
58
class
SKYLICHT_API CAnimationController :
public
CComponentSystem
59
{
60
protected
:
62
std::vector<CSkeleton*>
m_skeletons
;
63
65
CSkeleton
*
m_output
;
66
68
std::string
m_animFile
;
69
71
bool
m_loop
;
72
73
public
:
74
CAnimationController();
75
76
virtual
~CAnimationController();
77
78
virtual
void
initComponent();
79
80
virtual
void
updateComponent();
81
82
virtual
CObjectSerializable
* createSerializable();
83
84
virtual
void
loadSerializable(
CObjectSerializable
*
object
);
85
86
DECLARE_GETTYPENAME(CAnimationController)
87
88
public
:
89
94
CSkeleton
*
createSkeleton
();
95
101
CSkeleton
*
createSkeleton
(
core::array<CEntity*>
& entities);
102
107
int
getNumSkeleton
()
108
{
109
return
(
int
)
m_skeletons
.size();
110
}
111
117
CSkeleton
*
getSkeleton
(
int
id
)
118
{
119
return
m_skeletons
[id];
120
}
121
125
void
releaseAllSkeleton
();
126
131
inline
void
setOutput
(
CSkeleton
* skeleton)
132
{
133
m_output
= skeleton;
134
}
135
};
136
}
Skylicht::CAnimationController::createSkeleton
CSkeleton * createSkeleton()
Creates a new skeleton managed by this controller, using the GameObject's entities.
Skylicht::CAnimationController::getSkeleton
CSkeleton * getSkeleton(int id)
Gets a skeleton by index.
Definition
CAnimationController.h:117
Skylicht::CAnimationController::getNumSkeleton
int getNumSkeleton()
Gets the number of skeletons managed by this controller.
Definition
CAnimationController.h:107
Skylicht::CAnimationController::m_output
CSkeleton * m_output
The output skeleton which transforms are applied from.
Definition
CAnimationController.h:65
Skylicht::CAnimationController::createSkeleton
CSkeleton * createSkeleton(core::array< CEntity * > &entities)
Creates a new skeleton managed by this controller, using the provided entities.
Skylicht::CAnimationController::m_loop
bool m_loop
Whether the default animation should loop.
Definition
CAnimationController.h:71
Skylicht::CAnimationController::m_animFile
std::string m_animFile
Path to the primary animation file.
Definition
CAnimationController.h:68
Skylicht::CAnimationController::releaseAllSkeleton
void releaseAllSkeleton()
Releases all skeletons and clears the controller.
Skylicht::CAnimationController::setOutput
void setOutput(CSkeleton *skeleton)
Sets the skeleton that will be used for final transform application.
Definition
CAnimationController.h:131
Skylicht::CAnimationController::m_skeletons
std::vector< CSkeleton * > m_skeletons
List of skeletons managed by this controller.
Definition
CAnimationController.h:62
Skylicht::CObjectSerializable
Definition
CObjectSerializable.h:36
Skylicht::CSkeleton
Manages a hierarchy of animated entities, handling keyframe updates and animation blending.
Definition
CSkeleton.h:50
irr::core::array
Self reallocating template array (like stl vector) with additional features.
Definition
irrArray.h:23
Skylicht
Everything in the Skylicht Engine. You can start by looking at the topics.
Definition
AudioDebugLog.h:29
Generated by
1.17.0