Skylicht Engine
Loading...
Searching...
No Matches
CVortexSystem.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 "ISystem.h"
28
29namespace Skylicht
30{
31 namespace Particle
32 {
46 class COMPONENT_API CVortexSystem : public ISystem
47 {
48 protected:
50 core::vector3df m_position;
52 core::vector3df m_direction;
63
64 public:
65 CVortexSystem(const core::vector3df& position, const core::vector3df& direction, float rotationSpeed = 1.0f, float attractionSpeed = 0.0f);
66
67 virtual ~CVortexSystem();
68
70 virtual void update(CParticle *particles, int num, CGroup *group, float dt);
71
73 inline core::vector3df getPosition()
74 {
75 return m_position;
76 }
77
79 inline core::vector3df getDirection()
80 {
81 return m_direction;
82 }
83
85 inline void setPosition(const core::vector3df& p)
86 {
87 m_position = p;
88 }
89
91 inline void setDirection(const core::vector3df& d)
92 {
93 m_direction = d;
94 }
95
97 inline float getRotateSpeed()
98 {
99 return m_rotationSpeed;
100 }
101
103 inline float getAttractionSpeed()
104 {
105 return m_attractionSpeed;
106 }
107
109 inline float getEyeRadius()
110 {
111 return m_eyeRadius;
112 }
113
115 inline void setRotateSpeed(float f)
116 {
117 m_rotationSpeed = f;
118 }
119
121 inline void setAttractionSpeed(float f)
122 {
124 }
125
127 inline void setEyeRadius(float f)
128 {
129 m_eyeRadius = f;
130 }
131
133 inline void setEyeAttractionSpeed(float f)
134 {
136 }
137
140 {
142 }
143
145 inline bool isKillingParticle()
146 {
148 }
149
151 inline void enableKillingParticle(bool b)
152 {
154 }
155 };
156 }
157}
Represents a group of particles with shared settings, emitters, and a renderer.
Definition CGroup.h:132
Individual particle data structure.
Definition CParticle.h:65
void enableKillingParticle(bool b)
Enables/disables killing particles at the core.
Definition CVortexSystem.h:151
void setRotateSpeed(float f)
Sets rotation speed.
Definition CVortexSystem.h:115
float m_attractionSpeed
Speed at which particles are pulled toward the axis.
Definition CVortexSystem.h:56
float m_eyeRadius
Radius of the vortex core.
Definition CVortexSystem.h:60
float getAttractionSpeed()
Gets radial attraction speed.
Definition CVortexSystem.h:103
void setAttractionSpeed(float f)
Sets radial attraction speed.
Definition CVortexSystem.h:121
core::vector3df m_position
Center of the vortex.
Definition CVortexSystem.h:50
virtual void update(CParticle *particles, int num, CGroup *group, float dt)
Implementation: applies vortex forces to particles.
float getEyeRadius()
Gets core radius.
Definition CVortexSystem.h:109
bool m_killingParticleEnabled
Whether to kill particles that reach the core.
Definition CVortexSystem.h:62
float m_rotationSpeed
Speed of rotation around the axis.
Definition CVortexSystem.h:54
void setEyeRadius(float f)
Sets core radius.
Definition CVortexSystem.h:127
float getRotateSpeed()
Gets rotation speed.
Definition CVortexSystem.h:97
void setDirection(const core::vector3df &d)
Sets rotation axis.
Definition CVortexSystem.h:91
core::vector3df m_direction
Axis of rotation.
Definition CVortexSystem.h:52
float m_eyeAttractionSpeed
Speed at which particles move along the axis.
Definition CVortexSystem.h:58
core::vector3df getDirection()
Gets rotation axis.
Definition CVortexSystem.h:79
bool isKillingParticle()
Checks if killing at core is enabled.
Definition CVortexSystem.h:145
void setPosition(const core::vector3df &p)
Sets center position.
Definition CVortexSystem.h:85
void setEyeAttractionSpeed(float f)
Sets axial attraction speed.
Definition CVortexSystem.h:133
core::vector3df getPosition()
Gets center position.
Definition CVortexSystem.h:73
float getEyeAttractionSpeed()
Gets axial attraction speed.
Definition CVortexSystem.h:139
Everything in the Skylicht Engine. You can start by looking at the topics.
Definition AudioDebugLog.h:29