snowstorm.h

来自「一本关于OPenGL的很好的电子书」· C头文件 代码 · 共 46 行

H
46
字号
/****************************************************************************
 Snowstorm.h  Particle system representing a snowstorm
 
 Author   :   Dave Astle
 Date     :   3/17/2001

 Written for OpenGL Game Programming
*****************************************************************************/
#ifndef __SNOWSTORM_H_INCLUDED__
#define __SNOWSTORM_H_INCLUDED__


/********************************* Includes *********************************/
#include "Particles.h"


/*************************** Constants and Macros ***************************/
const vector3_t SNOWFLAKE_VELOCITY  (0.0f, -3.0f, 0.0f);
const vector3_t VELOCITY_VARIATION  (0.2f, 0.5f, 0.2f);
const float     SNOWFLAKE_SIZE      = 0.02f;
const float     SNOWFLAKES_PER_SEC  = 2000;


/***************************** Data structures ******************************/
class CSnowstorm : public CParticleSystem
{
public:
  CSnowstorm(int maxParticles, vector3_t origin, float height, float width, float depth);

  void  Update(float elapsedTime);
  void  Render();

  void  InitializeSystem();
  void  KillSystem();

protected:
  void    InitializeParticle(int index);
  float   m_height;
  float   m_width;
  float   m_depth;

  GLuint  m_texture;     // snowflake texture
};


#endif // __SNOWSTORM_H_INCLUDED__

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?