OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
controller.hpp
Go to the documentation of this file.
1 /*
2  OpenMW - The completely unofficial reimplementation of Morrowind
3  Copyright (C) 2008-2010 Nicolay Korslund
4  Email: < korslund@gmail.com >
5  WWW: http://openmw.sourceforge.net/
6 
7  This file (controller.h) is part of the OpenMW package.
8 
9  OpenMW is distributed as free software: you can redistribute it
10  and/or modify it under the terms of the GNU General Public License
11  version 3, as published by the Free Software Foundation.
12 
13  This program is distributed in the hope that it will be useful, but
14  WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  version 3 along with this program. If not, see
20  http://www.gnu.org/licenses/ .
21 
22  */
23 
24 #ifndef OPENMW_COMPONENTS_NIF_CONTROLLER_HPP
25 #define OPENMW_COMPONENTS_NIF_CONTROLLER_HPP
26 
27 #include "base.hpp"
28 
29 namespace Nif
30 {
31 
33 {
34 public:
35  struct Particle {
36  osg::Vec3f velocity;
37  float lifetime;
38  float lifespan;
39  float timestamp;
40  int vertex;
41  };
42 
43  float velocity;
45 
46  float verticalDir; // 0=up, pi/2=horizontal, pi=down
50 
51  float size;
52  float startTime;
53  float stopTime;
54 
55  float emitRate;
56  float lifetime;
58 
59  enum EmitFlags
60  {
61  NoAutoAdjust = 0x1 // If this flag is set, we use the emitRate value. Otherwise,
62  // we calculate an emit rate so that the maximum number of particles
63  // in the system (numParticles) is never exceeded.
64  };
65  int emitFlags;
66 
67  osg::Vec3f offsetRandom;
68 
70 
73  std::vector<Particle> particles;
74 
77 
78  void read(NIFStream *nif);
79  void post(NIFFile *nif);
80 };
82 
84 {
85 public:
87 
88  void read(NIFStream *nif);
89  void post(NIFFile *nif);
90 };
91 
93 {
94 public:
97 
98  void read(NIFStream *nif);
99  void post(NIFFile *nif);
100 };
101 
103 {
104 public:
106 
107  void read(NIFStream *nif);
108  void post(NIFFile *nif);
109 };
110 
112 {
113 public:
115 
116  void read(NIFStream *nif);
117  void post(NIFFile *nif);
118 };
119 
121 {
122 public:
124 
125  void read(NIFStream *nif);
126  void post(NIFFile *nif);
127 };
128 
130 {
131 public:
133 
134  void read(NIFStream *nif);
135  void post(NIFFile *nif);
136 };
137 
139 {
140 public:
142 
143  void read(NIFStream *nif);
144  void post(NIFFile *nif);
145 };
146 
148 {
149 public:
150  int mTexSlot; // NiTexturingProperty::TextureType
151  float mDelta; // Time between two flips. delta = (start_time - stop_time) / num_sources
153 
154  void read(NIFStream *nif);
155  void post(NIFFile *nif);
156 };
157 
158 } // Namespace
159 #endif
NiSourceTextureList mSources
Definition: controller.hpp:152
Definition: niffile.hpp:17
void post(NIFFile *nif)
Does post-processing, after the entire tree is loaded.
Definition: controller.cpp:158
NiMorphDataPtr data
Definition: controller.hpp:132
Definition: controller.hpp:83
std::vector< Particle > particles
Definition: controller.hpp:73
osg::Vec3f offsetRandom
Definition: controller.hpp:67
int emitFlags
Definition: controller.hpp:65
int mTexSlot
Definition: controller.hpp:150
void read(NIFStream *nif)
Parses the record from file.
Definition: controller.cpp:164
float emitRate
Definition: controller.hpp:55
void post(NIFFile *nif)
Does post-processing, after the entire tree is loaded.
Definition: controller.cpp:98
void read(NIFStream *nif)
Parses the record from file.
Definition: controller.cpp:140
ExtraPtr affectors
Definition: controller.hpp:75
void read(NIFStream *nif)
Parses the record from file.
Definition: controller.cpp:92
NiPosDataPtr posData
Definition: controller.hpp:95
int activeCount
Definition: controller.hpp:72
Definition: controller.hpp:147
NodePtr emitter
Definition: controller.hpp:69
Definition: controller.hpp:32
float verticalAngle
Definition: controller.hpp:47
void read(NIFStream *nif)
Parses the record from file.
Definition: controller.cpp:104
void post(NIFFile *nif)
Does post-processing, after the entire tree is loaded.
Definition: controller.cpp:146
float lifetime
Definition: controller.hpp:37
float verticalDir
Definition: controller.hpp:46
Definition: controller.hpp:111
Definition: controller.hpp:102
NiUVDataPtr data
Definition: controller.hpp:105
NiKeyframeDataPtr data
Definition: controller.hpp:114
float velocity
Definition: controller.hpp:43
osg::Vec3f velocity
Definition: controller.hpp:36
void read(NIFStream *nif)
Parses the record from file.
Definition: controller.cpp:126
ExtraPtr colliders
Definition: controller.hpp:76
Definition: controller.hpp:35
void read(NIFStream *nif)
Parses the record from file.
Definition: controller.cpp:177
NiParticleSystemController NiBSPArrayController
Definition: controller.hpp:81
float horizontalAngle
Definition: controller.hpp:49
void read(NIFStream *nif)
Parses the record from file.
Definition: controller.cpp:152
float lifetime
Definition: controller.hpp:56
void post(NIFFile *nif)
Does post-processing, after the entire tree is loaded.
Definition: controller.cpp:183
Definition: controller.hpp:120
float velocityRandom
Definition: controller.hpp:44
float mDelta
Definition: controller.hpp:151
void read(NIFStream *nif)
Parses the record from file.
Definition: controller.cpp:30
NiFloatDataPtr data
Definition: controller.hpp:123
Definition: controller.hpp:129
EmitFlags
Definition: controller.hpp:59
Definition: base.hpp:26
float horizontalDir
Definition: controller.hpp:48
Definition: controller.hpp:92
float timestamp
Definition: controller.hpp:39
NiVisDataPtr data
Definition: controller.hpp:141
void read(NIFStream *nif)
Parses the record from file.
Definition: controller.cpp:189
int vertex
Definition: controller.hpp:40
void post(NIFFile *nif)
Does post-processing, after the entire tree is loaded.
Definition: controller.cpp:171
NiFloatDataPtr floatData
Definition: controller.hpp:96
float lifespan
Definition: controller.hpp:38
float size
Definition: controller.hpp:51
Definition: nifstream.hpp:26
float lifetimeRandom
Definition: controller.hpp:57
void post(NIFFile *nif)
Does post-processing, after the entire tree is loaded.
Definition: controller.cpp:134
float stopTime
Definition: controller.hpp:53
void post(NIFFile *nif)
Does post-processing, after the entire tree is loaded.
Definition: controller.cpp:198
int numParticles
Definition: controller.hpp:71
NiPosDataPtr data
Definition: controller.hpp:86
float startTime
Definition: controller.hpp:52
void post(NIFFile *nif)
Does post-processing, after the entire tree is loaded.
Definition: controller.cpp:118
Definition: controller.hpp:138
void post(NIFFile *nif)
Does post-processing, after the entire tree is loaded.
Definition: controller.cpp:84