GPUParticle: Use .hpp extension and reformat files now that I discovered how to force VS to emit space instead of indent.

This commit is contained in:
Vincent Lejeune 2014-02-02 21:13:03 +01:00
parent deb6883a67
commit 477dc093e3
6 changed files with 595 additions and 594 deletions

View File

@ -360,6 +360,7 @@ src/graphics/CBatchingMesh.hpp
src/graphics/explosion.hpp src/graphics/explosion.hpp
src/graphics/glow.hpp src/graphics/glow.hpp
src/graphics/glwrap.hpp src/graphics/glwrap.hpp
src/graphics/gpuparticles.hpp
src/graphics/hardware_skinning.hpp src/graphics/hardware_skinning.hpp
src/graphics/hit_effect.hpp src/graphics/hit_effect.hpp
src/graphics/hit_sfx.hpp src/graphics/hit_sfx.hpp

File diff suppressed because it is too large Load Diff

View File

@ -1,98 +0,0 @@
#ifndef GPUPARTICLES_H
#define GPUPARTICLES_H
#include "graphics/glwrap.hpp"
#include "../lib/irrlicht/source/Irrlicht/CParticleSystemSceneNode.h"
#include <ISceneManager.h>
#include <IParticleSystemSceneNode.h>
namespace irr { namespace video{ class ITexture; } }
GLuint getTextureGLuint(irr::video::ITexture *tex);
class GPUParticle : public scene::ISceneNode
{
protected:
video::SMaterial fakemat;
virtual void simulate() = 0;
virtual void draw() = 0;
public:
GPUParticle(scene::ISceneNode *parent, scene::ISceneManager* mgr,
video::ITexture *tex);
virtual void render();
virtual void OnRegisterSceneNode();
};
class ParticleSystemProxy : public scene::CParticleSystemSceneNode {
protected:
video::SMaterial fakemat;
GLuint tfb_buffers[2], initial_values_buffer, heighmapbuffer, heightmaptexture, quaternionsbuffer;
GLuint current_simulation_vao, non_current_simulation_vao;
GLuint current_hm_simulation_vao, non_currenthm__simulation_vao;
GLuint current_rendering_vao, non_current_rendering_vao;
GLuint current_rendering_flip_vao, non_current_rendering_flip_vao;
bool m_alpha_additive, has_height_map, flip;
float size_increase_factor, track_x, track_z, track_x_len, track_z_len;
static GLuint quad_vertex_buffer;
GLuint texture;
unsigned count;
static void SimpleParticleVAOBind(GLuint PositionBuffer);
static void FlipParticleVAOBind(GLuint PositionBuffer, GLuint QuaternionBuffer);
static void SimpleSimulationBind(GLuint PositionBuffer, GLuint InitialValuesBuffer);
static void HeightmapSimulationBind(GLuint PositionBuffer, GLuint InitialValuesBuffer);
void simulateHeightmap();
void simulateNoHeightmap();
void drawFlip();
void drawNotFlip();
virtual void simulate();
virtual void draw();
void generateParticlesFromPointEmitter(scene::IParticlePointEmitter *);
void generateParticlesFromBoxEmitter(scene::IParticleBoxEmitter *);
void generateParticlesFromSphereEmitter(scene::IParticleSphereEmitter *);
public:
static IParticleSystemSceneNode *addParticleNode(
bool withDefaultEmitter = true, ISceneNode* parent = 0, s32 id = -1,
const core::vector3df& position = core::vector3df(0, 0, 0),
const core::vector3df& rotation = core::vector3df(0, 0, 0),
const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f));
ParticleSystemProxy(bool createDefaultEmitter,
ISceneNode* parent, scene::ISceneManager* mgr, s32 id,
const core::vector3df& position,
const core::vector3df& rotation,
const core::vector3df& scale);
~ParticleSystemProxy();
virtual void setEmitter(scene::IParticleEmitter* emitter);
virtual void render();
virtual void OnRegisterSceneNode();
void setAlphaAdditive(bool);
void setIncreaseFactor(float);
void setHeightmap(const std::vector<std::vector<float> >&, float, float, float, float);
void setFlip();
};
class RainNode : public GPUParticle
{
protected:
GLuint SimulationProgram, RenderProgram, tfb_vertex_buffer[2];
unsigned count;
GLuint texture, normal_and_depth;
GLuint loc_campos, loc_viewm, loc_time;
GLuint loc_screenw, loc_screen, loc_invproj, texloc_tex, texloc_normal_and_depths;
s32 area;
core::aabbox3d<f32> box;
virtual void simulate();
virtual void draw();
public:
RainNode(scene::ISceneManager* mgr, video::ITexture *tex);
virtual const core::aabbox3d<f32>& getBoundingBox() const;
virtual u32 getMaterialCount() const { return 1; }
};
#endif // GPUPARTICLES_H

View File

@ -0,0 +1,98 @@
#ifndef GPUPARTICLES_H
#define GPUPARTICLES_H
#include "graphics/glwrap.hpp"
#include "../lib/irrlicht/source/Irrlicht/CParticleSystemSceneNode.h"
#include <ISceneManager.h>
#include <IParticleSystemSceneNode.h>
namespace irr { namespace video{ class ITexture; } }
GLuint getTextureGLuint(irr::video::ITexture *tex);
class GPUParticle : public scene::ISceneNode
{
protected:
video::SMaterial fakemat;
virtual void simulate() = 0;
virtual void draw() = 0;
public:
GPUParticle(scene::ISceneNode *parent, scene::ISceneManager* mgr,
video::ITexture *tex);
virtual void render();
virtual void OnRegisterSceneNode();
};
class ParticleSystemProxy : public scene::CParticleSystemSceneNode {
protected:
video::SMaterial fakemat;
GLuint tfb_buffers[2], initial_values_buffer, heighmapbuffer, heightmaptexture, quaternionsbuffer;
GLuint current_simulation_vao, non_current_simulation_vao;
GLuint current_hm_simulation_vao, non_currenthm__simulation_vao;
GLuint current_rendering_vao, non_current_rendering_vao;
GLuint current_rendering_flip_vao, non_current_rendering_flip_vao;
bool m_alpha_additive, has_height_map, flip;
float size_increase_factor, track_x, track_z, track_x_len, track_z_len;
static GLuint quad_vertex_buffer;
GLuint texture;
unsigned count;
static void SimpleParticleVAOBind(GLuint PositionBuffer);
static void FlipParticleVAOBind(GLuint PositionBuffer, GLuint QuaternionBuffer);
static void SimpleSimulationBind(GLuint PositionBuffer, GLuint InitialValuesBuffer);
static void HeightmapSimulationBind(GLuint PositionBuffer, GLuint InitialValuesBuffer);
void simulateHeightmap();
void simulateNoHeightmap();
void drawFlip();
void drawNotFlip();
virtual void simulate();
virtual void draw();
void generateParticlesFromPointEmitter(scene::IParticlePointEmitter *);
void generateParticlesFromBoxEmitter(scene::IParticleBoxEmitter *);
void generateParticlesFromSphereEmitter(scene::IParticleSphereEmitter *);
public:
static IParticleSystemSceneNode *addParticleNode(
bool withDefaultEmitter = true, ISceneNode* parent = 0, s32 id = -1,
const core::vector3df& position = core::vector3df(0, 0, 0),
const core::vector3df& rotation = core::vector3df(0, 0, 0),
const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f));
ParticleSystemProxy(bool createDefaultEmitter,
ISceneNode* parent, scene::ISceneManager* mgr, s32 id,
const core::vector3df& position,
const core::vector3df& rotation,
const core::vector3df& scale);
~ParticleSystemProxy();
virtual void setEmitter(scene::IParticleEmitter* emitter);
virtual void render();
virtual void OnRegisterSceneNode();
void setAlphaAdditive(bool);
void setIncreaseFactor(float);
void setHeightmap(const std::vector<std::vector<float> >&, float, float, float, float);
void setFlip();
};
class RainNode : public GPUParticle
{
protected:
GLuint SimulationProgram, RenderProgram, tfb_vertex_buffer[2];
unsigned count;
GLuint texture, normal_and_depth;
GLuint loc_campos, loc_viewm, loc_time;
GLuint loc_screenw, loc_screen, loc_invproj, texloc_tex, texloc_normal_and_depths;
s32 area;
core::aabbox3d<f32> box;
virtual void simulate();
virtual void draw();
public:
RainNode(scene::ISceneManager* mgr, video::ITexture *tex);
virtual const core::aabbox3d<f32>& getBoundingBox() const;
virtual u32 getMaterialCount() const { return 1; }
};
#endif // GPUPARTICLES_H

View File

@ -28,7 +28,7 @@
#include "tracks/track.hpp" #include "tracks/track.hpp"
#include "utils/constants.hpp" #include "utils/constants.hpp"
#include "utils/helpers.hpp" #include "utils/helpers.hpp"
#include "graphics/gpuparticles.h" #include "graphics/gpuparticles.hpp"
#include <SParticle.h> #include <SParticle.h>
#include <IParticleAffector.h> #include <IParticleAffector.h>

View File

@ -20,7 +20,7 @@
#include "audio/sfx_manager.hpp" #include "audio/sfx_manager.hpp"
#include "graphics/camera.hpp" #include "graphics/camera.hpp"
#include "graphics/glwrap.hpp" #include "graphics/glwrap.hpp"
#include "graphics/gpuparticles.h" #include "graphics/gpuparticles.hpp"
#include "graphics/irr_driver.hpp" #include "graphics/irr_driver.hpp"
#include "graphics/material_manager.hpp" #include "graphics/material_manager.hpp"
#include "graphics/material.hpp" #include "graphics/material.hpp"