Skylicht Engine
Toggle main menu visibility
Loading...
Searching...
No Matches
Entity
CEntityHandler.h
1
/*
2
!@
3
MIT License
4
5
Copyright (c) 2022 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 "Components/CComponentSystem.h"
28
#include "CEntity.h"
29
30
namespace
Skylicht
31
{
37
class
SKYLICHT_API CEntityHandler :
public
CComponentSystem
38
{
39
protected
:
40
core::array<CEntity*> m_entities;
41
42
bool
m_shadowCasting;
43
44
public
:
45
CEntityHandler();
46
47
virtual
~CEntityHandler();
48
49
virtual
void
initComponent();
50
51
virtual
void
updateComponent();
52
53
virtual
void
onUpdateCullingLayer(u32 mask);
54
55
CEntity
* searchEntityByID(
const
char
*
id
);
56
57
virtual
CEntity
* createEntity();
58
59
virtual
CEntity
* createEntity(
CEntity
* parent);
60
61
virtual
CEntity
* spawn()
62
{
63
return
NULL;
64
}
65
66
virtual
void
removeEntity(
CEntity
* entity);
67
68
virtual
void
removeAllEntities();
69
70
void
regenerateEntityId();
71
72
core::array<CEntity*>& getEntities()
73
{
74
return
m_entities;
75
}
76
77
inline
int
getEntityCount()
78
{
79
return
(
int
)m_entities.size();
80
}
81
82
void
getEntitiesTransforms(core::array<core::matrix4>& result);
83
84
void
setShadowCasting(
bool
b);
85
86
inline
bool
isShadowCasting()
87
{
88
return
m_shadowCasting;
89
}
90
91
protected
:
92
93
void
setEntities(
CEntity
** entities, u32 count);
94
95
void
removeChilds(
CEntity
* entity);
96
};
97
}
Skylicht::CEntity
This is the object class that describes an entity.
Definition
CEntity.h:58
Skylicht
Everything in the Skylicht Engine. You can start by looking at the topics.
Definition
AudioDebugLog.h:29
Generated by
1.17.0