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"
26 // This file defines the particle-related structures that both the server and
27 // client need. The ParticleManager and rendering is in client/particles.h
29 struct CommonParticleParams {
30 bool collisiondetection = false;
31 bool collision_removal = false;
32 bool object_collision = false;
33 bool vertical = false;
35 struct TileAnimationParams animation;
38 CommonParticleParams() {
39 animation.type = TAT_NONE;
42 /* This helper is useful for copying params from
43 * ParticleSpawnerParameters to ParticleParameters */
44 inline void copyCommon(CommonParticleParams &to) const {
45 to.collisiondetection = collisiondetection;
46 to.collision_removal = collision_removal;
47 to.object_collision = object_collision;
48 to.vertical = vertical;
50 to.animation = animation;
55 struct ParticleParameters : CommonParticleParams {
59 f32 expirationtime = 1;
62 void serialize(std::ostream &os, u16 protocol_ver) const;
63 void deSerialize(std::istream &is, u16 protocol_ver);
66 struct ParticleSpawnerParameters : CommonParticleParams {
68 v3f minpos, maxpos, minvel, maxvel, minacc, maxacc;
70 f32 minexptime = 1, maxexptime = 1, minsize = 1, maxsize = 1;
72 // For historical reasons no (de-)serialization methods here