14 #ifndef __diguyParticleSystem_H
15 #define __diguyParticleSystem_H
20 #define CPLUSPLUS_ONLY
29 class diguyParticleManager;
58 m_character(NULL), m_system_life_time_override(-1.0f), m_age(0.0f), m_visible(1), m_ready_for_garbage_collection(0),
64 virtual const char * get_name() = 0;
65 virtual void set_name(
const char * name) = 0;
68 virtual int update(
float dt)
71 if (m_system_life_time_override > 0.0 && m_age > m_system_life_time_override){
72 m_ready_for_garbage_collection = 1;
78 virtual void start_emitting() = 0;
79 virtual void stop_emitting() = 0;
80 virtual void pause_emitting() = 0;
81 virtual void stop_all_particles() = 0;
82 virtual void restart_particle_system() = 0;
84 virtual int get_emitting() = 0;
86 virtual int get_active_count() = 0;
88 virtual void set_position(
double x,
double y,
double z) = 0;
89 virtual void get_position(
double *x,
double *y,
double *z) = 0;
91 virtual int set_visible(
int visible){ m_visible = visible;
return 0; }
92 virtual int get_visible(){
return m_visible; }
95 virtual void set_orientation(
float * matrix) = 0;
96 virtual void set_scale(
float scale) = 0;
97 virtual void set_scale(
float scale_x,
float scale_y,
float scale_z) = 0;
98 virtual void set_time_scale(
float t) = 0;
103 virtual void reset_prev_position_next_update() = 0;
108 void set_particle_manager(diguyParticleManager * manager){ m_particle_manager = manager; }
109 diguyParticleManager * get_particle_manager() {
return m_particle_manager; }
115 m_renderer = renderer;
119 virtual int get_ready_for_garbage_collection(){
return m_ready_for_garbage_collection; }
120 virtual void set_ready_for_garbage_collection(
int value){ m_ready_for_garbage_collection = value; }
121 virtual float get_system_life_time_override(){
return m_system_life_time_override; }
122 virtual void set_system_life_time_override(
float value){ m_system_life_time_override = value; }
124 virtual int get_spawned_system(){
return m_spawned_system; }
125 virtual void set_spawned_system(
int value){ m_spawned_system = value; }
128 diguyParticleManager * m_particle_manager;
133 float m_system_life_time_override;
134 int m_ready_for_garbage_collection;
135 int m_spawned_system;
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:230
float m_brightness_multiplier
optional per particle system override for IR shader
Definition: diguyParticleSystem.h:236
int m_src_blend_func
OpenGL src blending function constant.
Definition: diguyParticleSystem.h:212
int m_particle_data_size
How large in bytes each particle is, needed for VBO stride calculations.
Definition: diguyParticleSystem.h:221
diguyParticleDrawDesc()
Definition: diguyParticleSystem.h:180
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:233
int m_particle_offset_for_normals
Definition: diguyParticleSystem.h:226
float m_alpha_thresh
alpha threshold for clipping the edges of particle system
Definition: diguyParticleSystem.h:218
float m_camera_matrix[16]
Definition: diguyParticleSystem.h:167
diguyViewCamera * m_camera
Pointer to current diguy camera.
Definition: diguyParticleSystem.h:197
An Structure that represents a particle system draw state. This struct allows you to feed rendering i...
Definition: diguyParticleSystem.h:178
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.
Definition: diguyGraphicsTexture.h:122
float m_world_rotation_matrix[16]
Definition: diguyParticleSystem.h:168
int m_render_pass_flags
current render pass flags (shadow/intersection pass etc)
Definition: diguyParticleSystem.h:239
diguyGraphicsTexture * m_texture
Texture to bind for rendering this particle system.
Definition: diguyParticleSystem.h:191
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:224
The class that represents a DI-Guy Entity in the world.
Definition: diguyCharacter.h:80
int m_dst_blend_func
OpenGL dst blending function constant.
Definition: diguyParticleSystem.h:215
int m_particle_offset_for_textures
Definition: diguyParticleSystem.h:227
int m_depth_write
Should depth writing be active for this particle.
Definition: diguyParticleSystem.h:200
int m_world_space
Is this particle in world space (usually yes)
Definition: diguyParticleSystem.h:203
An interface class that allows diguy to trigger an immediate mode rendering of a diguy particle syste...
Definition: diguyParticleSystem.h:147
The class that represents a camera in the world.
Definition: diguyViewCamera.h:260
static double t
4 Header files and forward declarations
Definition: simple_playback_ogl.cpp:55
float m_scale_x
Scale values for non world space particles.
Definition: diguyParticleSystem.h:206
float m_scale_y
Definition: diguyParticleSystem.h:206
diguyGraphicsShaderProgram * m_shader
Shader that should be used to draw particle system. If null then use the Fixed Function Pipeline...
Definition: diguyParticleSystem.h:188
float m_scale_z
Definition: diguyParticleSystem.h:206
int m_particle_offset_for_verts
Definition: diguyParticleSystem.h:225
diguyParticleSystem * m_system
Pointer to actual particle system interface class.
Definition: diguyParticleSystem.h:194
This class implements shader programs for use with DI-Guy character graphics.
Definition: diguyGraphicsShaderProgram.h:96
diguyParticleSystemRenderer()
Definition: diguyParticleSystem.h:150
int m_blend
Should blending be enabled.
Definition: diguyParticleSystem.h:209