Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/world_entities/particles/box_emitter.h @ 10765

Last change on this file since 10765 was 9869, checked in by bensch, 18 years ago

orxonox/trunk: merged the new_class_id branche back to the trunk.
merged with command:
svn merge https://svn.orxonox.net/orxonox/branches/new_class_id trunk -r9683:HEAD
no conflicts… puh..

File size: 1.2 KB
Line 
1/*!
2 * @file box_emitter.h
3 *  Definition of a BoxEmitter
4 */
5
6#ifndef _BOX_EMITTER_H
7#define _BOX_EMITTER_H
8
9#include "particle_emitter.h"
10
11#define BOX_EMITTER_DEFAULT_SIZE Vector(1.0f, 1.0f, 1.0f)
12
13//! A class to handle a Box Emitter.
14/**
15 * A Box Emitter is a special kind of emitter, that has the (underlying) PNode
16 * at its center, and from there on is a Box in the Direction of the PNode
17 * out around size in the corresponding directions
18 */
19class BoxEmitter : public ParticleEmitter
20{
21  ObjectListDeclaration(BoxEmitter);
22  friend class ParticleSystem;
23public:
24  BoxEmitter(const Vector& size = BOX_EMITTER_DEFAULT_SIZE,
25             float emissionRate = PARTICLE_EMITTER_DEFAULT_EMISSION_RATE,
26             float velocity = PARTICLE_EMITTER_DEFAULT_VELOCITY,
27             float angle = PARTICLE_EMITTER_DEFAULT_SPREAD);
28  BoxEmitter(const TiXmlElement* root);
29  virtual ~BoxEmitter();
30
31  virtual void loadParams(const TiXmlElement* root);
32
33  void setSize(float x, float y, float z);
34  void setSize(const Vector& size) { this->setSize(size.x, size.y, size.z); };
35
36protected:
37  virtual void emitParticles(unsigned int count) const;
38
39private:
40  void init();
41
42private:
43  Vector      size;
44};
45
46#endif /* _BOX_EMITTER_H */
Note: See TracBrowser for help on using the repository browser.