Skylicht Engine
Toggle main menu visibility
Loading...
Searching...
No Matches
ParticleSystem
Particles
Zones
CCylinder.h
1
/*
2
!@
3
MIT License
4
5
Copyright (c) 2020 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 "CPositionZone.h"
28
29
namespace
Skylicht
30
{
31
namespace
Particle
32
{
38
class
COMPONENT_API CCylinder :
public
CPositionZone
39
{
40
protected
:
42
core::vector3df
m_direction
;
44
float
m_radius
;
46
float
m_length
;
47
48
public
:
49
CCylinder(
const
core::vector3df& position,
50
const
core::vector3df& direction,
51
float
radius,
52
float
length);
53
54
virtual
~CCylinder();
55
56
virtual
CObjectSerializable
*
createSerializable
();
57
58
virtual
void
loadSerializable
(
CObjectSerializable
*
object
);
59
61
inline
void
setDirection
(
const
core::vector3df& direction)
62
{
63
m_direction
= direction;
64
m_direction
.normalize();
65
}
66
68
inline
void
setRadius
(
float
r)
69
{
70
m_radius
= r;
71
}
72
74
inline
void
setLength
(
float
l)
75
{
76
m_length
= l;
77
}
78
80
inline
const
core::vector3df&
getDirection
()
81
{
82
return
m_direction
;
83
}
84
86
inline
float
getRadius
()
87
{
88
return
m_radius
;
89
}
90
92
inline
float
getLength
()
93
{
94
return
m_length
;
95
}
96
98
virtual
void
generatePosition
(
CParticle
& particle,
bool
full,
CGroup
* group);
99
101
virtual
core::vector3df
computeNormal
(
const
core::vector3df& point,
CGroup
* group);
102
103
DECLARE_GETTYPENAME(CCylinder)
104
};
105
}
106
}
Skylicht::CObjectSerializable
Definition
CObjectSerializable.h:36
Skylicht::Particle::CCylinder::setRadius
void setRadius(float r)
Sets cylinder radius.
Definition
CCylinder.h:68
Skylicht::Particle::CCylinder::generatePosition
virtual void generatePosition(CParticle &particle, bool full, CGroup *group)
Implementation: spawns within volume or on surface.
Skylicht::Particle::CCylinder::getLength
float getLength()
Gets length.
Definition
CCylinder.h:92
Skylicht::Particle::CCylinder::createSerializable
virtual CObjectSerializable * createSerializable()
Creates a serializable object for property editing or saving.
Skylicht::Particle::CCylinder::setLength
void setLength(float l)
Sets cylinder length.
Definition
CCylinder.h:74
Skylicht::Particle::CCylinder::getRadius
float getRadius()
Gets radius.
Definition
CCylinder.h:86
Skylicht::Particle::CCylinder::setDirection
void setDirection(const core::vector3df &direction)
Sets central axis direction.
Definition
CCylinder.h:61
Skylicht::Particle::CCylinder::m_length
float m_length
Length (height) along the axis.
Definition
CCylinder.h:46
Skylicht::Particle::CCylinder::computeNormal
virtual core::vector3df computeNormal(const core::vector3df &point, CGroup *group)
Implementation: computes surface normal.
Skylicht::Particle::CCylinder::getDirection
const core::vector3df & getDirection()
Gets axis direction.
Definition
CCylinder.h:80
Skylicht::Particle::CCylinder::loadSerializable
virtual void loadSerializable(CObjectSerializable *object)
Loads properties from a serializable object.
Skylicht::Particle::CCylinder::m_radius
float m_radius
Radius of the cylinder.
Definition
CCylinder.h:44
Skylicht::Particle::CCylinder::m_direction
core::vector3df m_direction
Central axis direction.
Definition
CCylinder.h:42
Skylicht::Particle::CGroup
Represents a group of particles with shared settings, emitters, and a renderer.
Definition
CGroup.h:132
Skylicht::Particle::CParticle
Individual particle data structure.
Definition
CParticle.h:65
Skylicht
Everything in the Skylicht Engine. You can start by looking at the topics.
Definition
AudioDebugLog.h:29
Generated by
1.17.0