3 Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
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.
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.
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.
23 #include "irrlichttypes_bloated.h"
24 #include "tileanimation.h"
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
30 struct CommonParticleParams {
31 bool collisiondetection = false;
32 bool collision_removal = false;
33 bool object_collision = false;
34 bool vertical = false;
36 struct TileAnimationParams animation;
41 CommonParticleParams() {
42 animation.type = TAT_NONE;
43 node.setContent(CONTENT_IGNORE);
46 /* This helper is useful for copying params from
47 * ParticleSpawnerParameters to ParticleParameters */
48 inline void copyCommon(CommonParticleParams &to) const {
49 to.collisiondetection = collisiondetection;
50 to.collision_removal = collision_removal;
51 to.object_collision = object_collision;
52 to.vertical = vertical;
54 to.animation = animation;
57 to.node_tile = node_tile;
61 struct ParticleParameters : CommonParticleParams {
65 f32 expirationtime = 1;
68 void serialize(std::ostream &os, u16 protocol_ver) const;
69 void deSerialize(std::istream &is, u16 protocol_ver);
72 struct ParticleSpawnerParameters : CommonParticleParams {
74 v3f minpos, maxpos, minvel, maxvel, minacc, maxacc;
76 f32 minexptime = 1, maxexptime = 1, minsize = 1, maxsize = 1;
78 // For historical reasons no (de-)serialization methods here