Minetest  5.4.0
particles.h
Go to the documentation of this file.
1 /*
2 Minetest
3 Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
4 
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation; either version 2.1 of the License, or
8 (at your option) any later version.
9 
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
14 
15 You should have received a copy of the GNU Lesser General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19 
20 #pragma once
21 
22 #include <string>
23 #include "irrlichttypes_bloated.h"
24 #include "tileanimation.h"
25 #include "mapnode.h"
26 
27 // This file defines the particle-related structures that both the server and
28 // client need. The ParticleManager and rendering is in client/particles.h
29 
31  bool collisiondetection = false;
32  bool collision_removal = false;
33  bool object_collision = false;
34  bool vertical = false;
35  std::string texture;
37  u8 glow = 0;
39  u8 node_tile = 0;
40 
44  }
45 
46  /* This helper is useful for copying params from
47  * ParticleSpawnerParameters to ParticleParameters */
48  inline void copyCommon(CommonParticleParams &to) const {
52  to.vertical = vertical;
53  to.texture = texture;
54  to.animation = animation;
55  to.glow = glow;
56  to.node = node;
57  to.node_tile = node_tile;
58  }
59 };
60 
65  f32 expirationtime = 1;
66  f32 size = 1;
67 
68  void serialize(std::ostream &os, u16 protocol_ver) const;
69  void deSerialize(std::istream &is, u16 protocol_ver);
70 };
71 
73  u16 amount = 1;
75  f32 time = 1;
76  f32 minexptime = 1, maxexptime = 1, minsize = 1, maxsize = 1;
77 
78  // For historical reasons no (de-)serialization methods here
79 };
core::vector3df v3f
Definition: irr_v3d.h:26
#define CONTENT_IGNORE
Definition: mapnode.h:71
Definition: particles.h:30
bool object_collision
Definition: particles.h:33
MapNode node
Definition: particles.h:38
bool collisiondetection
Definition: particles.h:31
struct TileAnimationParams animation
Definition: particles.h:36
std::string texture
Definition: particles.h:35
void copyCommon(CommonParticleParams &to) const
Definition: particles.h:48
u8 glow
Definition: particles.h:37
bool collision_removal
Definition: particles.h:32
bool vertical
Definition: particles.h:34
CommonParticleParams()
Definition: particles.h:41
u8 node_tile
Definition: particles.h:39
Definition: mapnode.h:118
void setContent(content_t c) noexcept
Definition: mapnode.h:160
Definition: particles.h:61
v3f pos
Definition: particles.h:62
void serialize(std::ostream &os, u16 protocol_ver) const
Definition: particles.cpp:23
v3f acc
Definition: particles.h:64
v3f vel
Definition: particles.h:63
f32 size
Definition: particles.h:66
f32 expirationtime
Definition: particles.h:65
void deSerialize(std::istream &is, u16 protocol_ver)
Definition: particles.cpp:42
Definition: particles.h:72
v3f maxpos
Definition: particles.h:74
v3f maxvel
Definition: particles.h:74
u16 amount
Definition: particles.h:73
f32 minexptime
Definition: particles.h:76
f32 maxexptime
Definition: particles.h:76
f32 minsize
Definition: particles.h:76
v3f maxacc
Definition: particles.h:74
v3f minpos
Definition: particles.h:74
v3f minacc
Definition: particles.h:74
f32 time
Definition: particles.h:75
f32 maxsize
Definition: particles.h:76
v3f minvel
Definition: particles.h:74
Definition: tileanimation.h:33
enum TileAnimationType type
Definition: tileanimation.h:34
@ TAT_NONE
Definition: tileanimation.h:27