DI-Guy SDK Documentation  13.1
diguyParticleSystem.h
Go to the documentation of this file.
1 
2 /*********************************************************************
3  ** Copyright (c) 1992-2015 VT MAK
4  ** All rights reserved.
5  *********************************************************************/
6 
7 /*********************************************************************/
14 #ifndef __diguyParticleSystem_H
15 #define __diguyParticleSystem_H
16 
17 #ifdef SWIG
18 %module diguyParticleSystem
19 #else
20 #define CPLUSPLUS_ONLY
21 #endif
22 
23 #ifdef CPLUSPLUS_ONLY
24 #include <diguy_constants.h>
25 #include <stdlib.h>
26 
27 class diguyCharacter;
28 class diguyParticleManager;
32 class diguyViewCamera;
34 
35 #endif
36 
37 #include <declspec_diguy.h>
38 
39 //------------------------------------------------------------------------------
52 /****************************************************************************/
53 class BDI_DECLSPEC_diguy diguyParticleSystem
54 {
55 
56 public:
57  diguyParticleSystem(const char * effect_name) : m_particle_manager(NULL), m_renderer(NULL),
58  m_character(NULL), m_system_life_time_override(-1.0f), m_visible(1)
59  {
60  ;
61  }
62  virtual ~diguyParticleSystem(){;}
63  virtual const char * get_name() = 0;
64  virtual void set_name(const char * name) = 0;
65 
67  virtual int update(float dt) = 0;
68 
69  virtual void start_emitting() = 0;
70  virtual void stop_emitting() = 0;
71  virtual void pause_emitting() = 0;
72  virtual void stop_all_particles() = 0;
73  virtual void restart_particle_system() = 0;
74 
75  virtual int get_emitting() = 0;
77  virtual int get_active_count() = 0;
78 
79  virtual void set_position( double x, double y, double z ) = 0;
80  virtual void get_position( double *x, double *y, double *z ) = 0;
81 
82  virtual int set_visible(int visible){ m_visible = visible; return 0;}
83  virtual int get_visible(){ return m_visible; }
84 
86  virtual void set_orientation(float rz, float rx, float ry) = 0;
87  virtual void set_scale(float scale) = 0;
88  virtual void set_scale(float scale_x, float scale_y, float scale_z) = 0;
89  virtual void set_time_scale(float t) = 0;
90 
94  virtual void reset_prev_position_next_update() = 0;
95 
96  //internally defined
97  diguyCharacter * get_character() {return m_character;}
98  void set_character(diguyCharacter * character) {m_character = character;}
99  void set_particle_manager(diguyParticleManager * manager){m_particle_manager = manager;}
100  diguyParticleManager * get_particle_manager() {return m_particle_manager;}
101 
103  virtual void render(diguyGraphicsShaderProgram * shader){;}
105  void set_particle_renderer(diguyParticleSystemRenderer* renderer){
106  m_renderer = renderer;
107  }
108  diguyParticleSystemRenderer* get_particle_renderer(){return m_renderer;}
110  diguyCharacter * m_character;
111  float m_system_life_time_override;
112 
113 protected:
114  diguyParticleManager * m_particle_manager;
116  int m_visible;
117 };
118 
119 
120 //------------------------------------------------------------------------------
134 {
135 public:
136 
138  virtual void setup_particle_rendering(int render_pass_flags) = 0;
139 
141  virtual void end_particle_rendering(int render_pass_flags) = 0;
142 
143 
145  virtual void draw_particle_buffer(const diguyParticleDrawDesc * draw_desc, void * particle_data) = 0;
146 
147 
148  float m_camera_matrix[16];
149 };
150 
151 
152 //------------------------------------------------------------------------------
164 {
165  diguyParticleDrawDesc() : m_shader(NULL), m_texture(NULL), m_system(NULL), m_camera(NULL),
166  m_depth_write(0), m_world_space(1), m_scale_x(1.0f),m_scale_y(1.0f), m_scale_z(1.0f), m_blend(0),
169  ;
170  }
185  int m_depth_write;
188  int m_world_space;
189 
191  float m_scale_x, m_scale_y, m_scale_z;
194  int m_blend;
195 
197  int m_src_blend_func;
198 
200  int m_dst_blend_func;
203  float m_alpha_thresh;
218  int m_active_count;
219 
222 };
223 
224 
225 
226 #endif
An interface class that represents a particle system that has been created by diguy's appearance effe...
Definition: diguyParticleSystem.h:52
int m_num_verts_per_primitive
Normally 4 for GL_QUADS, but can also be 2 for GL_LINES.
Definition: diguyParticleSystem.h:210
float m_brightness_multiplier
optional per particle system override for IR shader
Definition: diguyParticleSystem.h:216
int m_src_blend_func
OpenGL src blending function constant.
Definition: diguyParticleSystem.h:192
int m_particle_data_size
How large in bytes each particle is, needed for VBO stride calculations.
Definition: diguyParticleSystem.h:201
diguyParticleDrawDesc()
Definition: diguyParticleSystem.h:160
virtual void setup_particle_rendering(int render_pass_flags)=0
Function is called before individual particle systems are rendered.
int m_active_count
number of active particles for this draw call
Definition: diguyParticleSystem.h:213
int m_particle_offset_for_normals
Definition: diguyParticleSystem.h:206
float m_alpha_thresh
alpha threshold for clipping the edges of particle system
Definition: diguyParticleSystem.h:198
float m_camera_matrix[16]
Definition: diguyParticleSystem.h:144
diguyViewCamera * m_camera
Pointer to current diguy camera.
Definition: diguyParticleSystem.h:177
An Structure that represents a particle system draw state. This struct allows you to feed rendering i...
Definition: diguyParticleSystem.h:158
virtual void draw_particle_buffer(const diguyParticleDrawDesc *draw_desc, void *particle_data)=0
Function is called whenever a buffer of particles is ready to be drawn.
A class that represents a shared texture. Can be subclassed by filling out the diguy_graphics_set_tex...
Definition: diguyGraphicsTexture.h:124
diguyGraphicsTexture * m_texture
Texture to bind for rendering this particle system.
Definition: diguyParticleSystem.h:171
virtual void end_particle_rendering(int render_pass_flags)=0
Function is called after all individual particle systems are rendered.
int m_particle_offset_for_colors
Following are needed for VBO stride and offset calculations.
Definition: diguyParticleSystem.h:204
The class that represents a DI-Guy Entity in the world.
Definition: diguyCharacter.h:78
int m_dst_blend_func
OpenGL dst blending function constant.
Definition: diguyParticleSystem.h:195
int m_particle_offset_for_textures
Definition: diguyParticleSystem.h:207
int m_depth_write
Should depth writing be active for this particle.
Definition: diguyParticleSystem.h:180
int m_world_space
Is this particle in world space (usually yes)
Definition: diguyParticleSystem.h:183
An interface class that allows diguy to trigger an immediate mode rendering of a diguy particle syste...
Definition: diguyParticleSystem.h:131
The class that represents a camera in the world.
Definition: diguyViewCamera.h:90
static double t
4 Header files and forward declarations
Definition: simple_playback_ogl.cpp:53
float m_scale_x
Scale values for non world space particles.
Definition: diguyParticleSystem.h:186
float m_scale_y
Definition: diguyParticleSystem.h:186
diguyGraphicsShaderProgram * m_shader
Shader that should be used to draw particle system. If null then use the Fixed Function Pipeline...
Definition: diguyParticleSystem.h:168
float m_scale_z
Definition: diguyParticleSystem.h:186
int m_particle_offset_for_verts
Definition: diguyParticleSystem.h:205
diguyParticleSystem * m_system
Pointer to actual particle system interface class.
Definition: diguyParticleSystem.h:174
This class implements shader programs for use with DI-Guy character graphics.
Definition: diguyGraphicsShaderProgram.h:94
int m_blend
Should blending be enabled.
Definition: diguyParticleSystem.h:189