Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/lib/particles/box_emitter.h @ 7711

Last change on this file since 7711 was 6826, checked in by bensch, 19 years ago

orxonox/trunk: ok, the Cube Emitter works

File size: 1.2 KB
RevLine 
[4597]1/*!
[6823]2 * @file box_emitter.h
3 *  Definition of a BoxEmitter
[6822]4 */
[3926]5
[6823]6#ifndef _BOX_EMITTER_H
7#define _BOX_EMITTER_H
[3926]8
[6822]9#include "particle_emitter.h"
[3926]10
[6825]11#define BOX_EMITTER_DEFAULT_SIZE Vector(1.0f, 1.0f, 1.0f)
12
[6826]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 */
[6823]19class BoxEmitter : public ParticleEmitter
[6619]20{
21  friend class ParticleSystem;
22public:
[6825]23  BoxEmitter(const Vector& size = BOX_EMITTER_DEFAULT_SIZE,
24             float emissionRate = PARTICLE_EMITTER_DEFAULT_EMISSION_RATE,
25             float velocity = PARTICLE_EMITTER_DEFAULT_VELOCITY,
26             float angle = PARTICLE_EMITTER_DEFAULT_SPREAD);
[6823]27  BoxEmitter(const TiXmlElement* root);
28  virtual ~BoxEmitter();
[4597]29
[6823]30  virtual void loadParams(const TiXmlElement* root);
[3926]31
[6823]32  void setSize(float x, float y, float z);
33  void setSize(const Vector& size) { this->setSize(size.x, size.y, size.z); };
[3927]34
[6825]35protected:
[6822]36  virtual void emitParticles(unsigned int count) const;
[6619]37
[6822]38private:
39  void init();
[3929]40
[6619]41private:
[6823]42  Vector      size;
[3926]43};
44
[6823]45#endif /* _BOX_EMITTER_H */
Note: See TracBrowser for help on using the repository browser.