Skylicht Engine
Loading...
Searching...
No Matches
CParticleRenderer.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 "Entity/IRenderSystem.h"
29#include "Entity/CEntityGroup.h"
30
31#include "Culling/CCullingBBoxData.h"
32#include "Culling/CCullingData.h"
33#include "Culling/CVisibleData.h"
34#include "Transform/CWorldTransformData.h"
35#include "Transform/CWorldInverseTransformData.h"
36#include "ParticleSystem/CParticleBufferData.h"
37
38namespace Skylicht
39{
40 namespace Particle
41 {
48 class COMPONENT_API CParticleRenderer : public IRenderSystem
49 {
50 protected:
55
60 public:
61 CParticleRenderer();
62
63 virtual ~CParticleRenderer();
64
66 virtual void beginQuery(CEntityManager* entityManager);
67
69 virtual void onQuery(CEntityManager* entityManager, CEntity** entities, int numEntity);
70
72 virtual void init(CEntityManager* entityManager);
73
75 virtual void update(CEntityManager* entityManager);
76
78 virtual void render(CEntityManager* entityManager);
79
81 virtual void renderTransparent(CEntityManager* entityManager);
82
84 virtual void renderEmission(CEntityManager* entityManager);
85
86 protected:
87
90
93
96
99 };
100 }
101}
The object class is designed to optimize entity queries.
Definition CEntityGroup.h:54
This is the object class that describes an entity.
Definition CEntity.h:58
This object class manages all entities within a scene.
Definition CEntityManager.h:89
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 renderParticleGroupEmission(CParticleBufferData *data, const core::matrix4 &world)
Internal: renders emission groups for an entity.
void renderGroup(IVideoDriver *driver, Particle::CGroup *group)
Internal: submits a specific group to the video driver.
core::vector3df m_billboardUp
Current billboard up vector.
Definition CParticleRenderer.h:57
virtual void beginQuery(CEntityManager *entityManager)
ECS hook: establishes filters for entities with particle data.
CEntityGroup * m_group
Cached entity group.
Definition CParticleRenderer.h:52
virtual void update(CEntityManager *entityManager)
ECS hook: per-frame updates.
virtual void init(CEntityManager *entityManager)
ECS hook: initialization.
virtual void render(CEntityManager *entityManager)
ECS hook: main render pass (standard/opaque).
virtual void renderEmission(CEntityManager *entityManager)
ECS hook: emission render pass.
const core::matrix4 & getTransformNoRotate(const core::matrix4 &world)
Internal helper to calculate transform without rotation.
core::matrix4 m_transform
Internal scratchpad matrix.
Definition CParticleRenderer.h:54
core::vector3df m_billboardLook
Current billboard look vector.
Definition CParticleRenderer.h:59
void renderParticleGroup(CParticleBufferData *data, const core::matrix4 &world)
Internal: renders all groups for an entity.
virtual void renderTransparent(CEntityManager *entityManager)
ECS hook: transparent render pass.
virtual void onQuery(CEntityManager *entityManager, CEntity **entities, int numEntity)
ECS hook: query implementation.
Interface to driver which is able to perform 2d and 3d graphics functions.
Definition IVideoDriver.h:388
Everything in the Skylicht Engine. You can start by looking at the topics.
Definition AudioDebugLog.h:29
vector3d< f32 > vector3df
Typedef for a f32 3d vector.
Definition vector3d.h:445
CMatrix4< f32 > matrix4
Typedef for f32 matrix.
Definition matrix4.h:2241