Skylicht Engine
Loading...
Searching...
No Matches
CParticleBufferData.h
1/*
2!@
3MIT License
4
5Copyright (c) 2020 Skylicht Technology CO., LTD
6
7Permission 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,
9merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
10subject to the following conditions:
11
12The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
13
14THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
16IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
17WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19
20This file is part of the "Skylicht Engine".
21https://github.com/skylicht-lab/skylicht-engine
22!#
23*/
24
25#pragma once
26
27#include "Entity/IEntityData.h"
28#include "Particles/CGroup.h"
29#include "Particles/CSubGroup.h"
30#include "DataTypeIndex.h"
31
32namespace Skylicht
33{
34 namespace Particle
35 {
42 class COMPONENT_API CParticleBufferData : public IEntityData
43 {
44 public:
49
54
59 public:
60 CParticleBufferData();
61
62 virtual ~CParticleBufferData();
63
67 void clear();
68
74
80 CGroup* getGroupByName(const wchar_t* name);
81
88
94 std::vector<CSubGroup*> getSubGroup(CGroup* parent);
95
100 void removeGroup(CGroup* group);
101
107
114 void bringToNext(CGroup* group, CGroup* target, bool behind);
115
120 };
121
122 DECLARE_COMPONENT_DATA_TYPE_INDEX(CParticleBufferData);
123 }
124}
Represents a group of particles with shared settings, emitters, and a renderer.
Definition CGroup.h:132
ECS data structure holding particle groups for an entity.
Definition CParticleBufferData.h:43
void removeGroup(CGroup *group)
Removes and deletes a top-level group and its sub-groups.
void updateListGroup()
Rebuilds the AllGroups flat list from Groups and SubGroups.
core::array< CGroup * > AllGroups
Flat list of all particle groups (Groups + SubGroups).
Definition CParticleBufferData.h:58
void bringToNext(CGroup *group, CGroup *target, bool behind)
Reorders a group within the Groups list.
CSubGroup * createSubGroup(CGroup *group)
Creates a new sub-group attached to a parent group.
core::array< CSubGroup * > SubGroups
List of sub-particle groups (attached to parent groups).
Definition CParticleBufferData.h:53
core::array< CGroup * > Groups
List of top-level particle groups.
Definition CParticleBufferData.h:48
void clear()
Clears all groups and sub-groups.
std::vector< CSubGroup * > getSubGroup(CGroup *parent)
Gets all sub-groups belonging to a specific parent.
CGroup * createGroup()
Creates a new top-level particle group.
CGroup * getGroupByName(const wchar_t *name)
Finds a group by its name.
void removeSubGroup(CSubGroup *group)
Removes and deletes a specific sub-group.
A particle group that spawns particles from the positions of particles in a parent group.
Definition CSubGroup.h:50
Self reallocating template array (like stl vector) with additional features.
Definition irrArray.h:23
Everything in the Skylicht Engine. You can start by looking at the topics.
Definition AudioDebugLog.h:29