My Project
WeatherParticle.h
1 #pragma once
2 #include "IBatchedElementDraw.h"
3 
4 namespace ParaEngine
5 {
6  class WeatherParticleSpawner;
7  struct SceneState;
8  class CCameraFrustum;
9 
10  enum WeatherType {
11  WeatherType_Rain = 0,
12  WeatherType_Snow,
13  WeatherType_RainSplash,
14  WeatherType_Last,
15  };
16 
17 
22  {
23  public:
25  virtual ~WeatherParticle();
26 
27  virtual WeatherType GetType() = 0;
28  virtual void Init(float x, float y, float z);
29  virtual bool IsPointTexture() { return true; }
30  virtual void Reset();
31 
32  virtual TextureEntity* GetTexture() { return m_pTexture; }
33  virtual void SetTexture(TextureEntity* val) { m_pTexture = val; }
34 
38  virtual int RenderParticle(SPRITEVERTEX** pVertexBuffer, SceneState* pSceneState);
39 
40  virtual void FrameMove(float deltaTime);
42  virtual void Draw(SceneState * sceneState, CCameraFrustum* pFrustum, const Vector3& vRenderOffset);
43 
44  virtual void SetFallOnGround();
45  virtual void SetDead();
46  bool IsDead() const { return m_isDead; }
47 
49  virtual void RecollectMe();
50 
51  float GetMinY() const { return minY; }
52  void SetMinY(float val) { minY = val; }
53 
54  protected:
55  WeatherParticleSpawner* GetWeatherSpawner();
56  ParaEngine::Vector3 GetRenderOffset() const { return m_vRenderOffset; }
57  void SetRenderOffset(ParaEngine::Vector3 val) { m_vRenderOffset = val; }
58 
59  protected:
60  float x;
61  float y;
62  float z;
63  float speed_x;
64  float speed_y;
65  float speed_z;
66  float width;
67  float height;
68  float lifetime;
69  float minY;
70  int tileIndex;
71 
72  bool m_isDead;
73  Vector3 m_vRenderOffset;
74  float gravity;
75  WeatherParticleSpawner* m_pWeatherSpawner;
76  TextureEntity* m_pTexture;
77  };
78 
80  {
81  public:
82  RainParticle(WeatherParticleSpawner* pParent) : WeatherParticle(pParent) {};
83  virtual ~RainParticle(){};
84  virtual WeatherType GetType() { return WeatherType_Rain; };
85  virtual void Init(float x, float y, float z);
86  virtual void SetDead();
87  };
88 
90  {
91  public:
93  virtual ~RainSplashParticle(){};
94  virtual WeatherType GetType() { return WeatherType_RainSplash; };
95  virtual void Init(float x, float y, float z);
96  virtual void FrameMove(float deltaTime);
97  };
98 
100  {
101  public:
102  SnowParticle(WeatherParticleSpawner* pParent) : WeatherParticle(pParent) {};
103  virtual ~SnowParticle(){};
104  virtual WeatherType GetType() { return WeatherType_Snow; };
105 
106  virtual void Init(float x, float y, float z);
107  virtual void FrameMove(float deltaTime);
108 
109  bool isFloating;
110  float float_speed;
111  };
112 }
Which DXT Compression to Use? Obviously, there are some trade-offs between the different formats whic...
Definition: TextureEntity.h:29
It's used as parameter to Draw method of each scene object.
Definition: SceneState.h:284
Definition: WeatherParticle.h:89
different physics engine has different winding order.
Definition: EventBinding.h:32
Custom vertex type for the trees.
Definition: VertexFVF.h:146
Definition: WeatherParticle.h:99
virtual void RecollectMe()
recollect to spawner
Definition: WeatherParticle.cpp:115
base class for weather particle
Definition: WeatherParticle.h:21
Standard 3-dimensional vector.
Definition: ParaVector3.h:16
virtual void Draw(SceneState *sceneState, CCameraFrustum *pFrustum, const Vector3 &vRenderOffset)
only for drawable objects
Definition: WeatherParticle.cpp:120
virtual int RenderParticle(SPRITEVERTEX **pVertexBuffer, SceneState *pSceneState)
generate particle sprite vertex into the vertex buffer based on current camera setting (bill boarding...
Definition: WeatherParticle.cpp:141
Definition: WeatherParticleSpawner.h:16
base class for a rectangle particle.
Definition: ParticleElement.h:21
Definition: WeatherParticle.h:79
the camera view culling frustum
Definition: CameraFrustum.h:10