[DEV] First version that might work

This commit is contained in:
Edouard DUPIN 2013-09-13 09:04:09 +02:00
parent 270082d49b
commit 013e809172
10 changed files with 27 additions and 6 deletions

View File

@ -10,6 +10,9 @@
#include <ege/Camera.h>
#include <ege/debug.h>
#undef __class__
#define __class__ "Camera"
void ege::Camera::Update(void)
{
// Note the view axes of the basic camera is (0,0,-1)

View File

@ -24,6 +24,9 @@
// Documentetion of bullet library :
// http://bulletphysics.org/mediawiki-1.5.8/index.php/Collision_Shapes
#undef __class__
#define __class__ "CollisionShapeCreator"
btCollisionShape* ege::collision::CreateShape(const ewol::Mesh* _mesh)
{
if (NULL == _mesh) {

View File

@ -11,6 +11,8 @@
#include <ege/ElementGame.h>
#undef __class__
#define __class__ "Environement"
ege::ElementGame* ege::Environement::GetElementNearest(ege::ElementGame* _sourceRequest, float& _distance)

View File

@ -9,8 +9,12 @@
#include <ege/debug.h>
#include <ege/Particule.h>
ege::Particule::Particule(ege::ParticuleEngine& _particuleEngine) :
m_particuleEngine(_particuleEngine)
#undef __class__
#define __class__ "Particule"
ege::Particule::Particule(ege::ParticuleEngine& _particuleEngine, const char* _particuleType) :
m_particuleEngine(_particuleEngine),
m_particuleType(_particuleType)
{
m_particuleEngine.Add(this);
}

View File

@ -27,6 +27,7 @@ namespace ege {
{
private:
ege::ParticuleEngine& m_particuleEngine;
const char* m_particuleType;
public:
/**
* @brief Constructor.

View File

@ -9,6 +9,9 @@
#include <ege/debug.h>
#include <ege/ParticuleEngine.h>
#undef __class__
#define __class__ "ParticuleEngine"
ege::ParticuleEngine::ParticuleEngine(ege::Environement& _env) :
m_env(_env)
{
@ -20,7 +23,7 @@ ege::ParticuleEngine::~ParticuleEngine(void)
}
void ege::ParticuleEngine::Add(Particule* _particule, const char* _particuleType)
void ege::ParticuleEngine::Add(Particule* _particule)
{
if (_particule==NULL) {
EGE_ERROR("Try to add particule NULL");
@ -34,7 +37,7 @@ void ege::ParticuleEngine::Add(Particule* _particule, const char* _particuleType
return;
}
// Just add it at the end ...
m_particuleList.PushBack();
m_particuleList.PushBack(_particule);
}
void ege::ParticuleEngine::Update(float _deltaTime)

View File

@ -31,7 +31,7 @@ namespace ege {
etk::Vector<Particule*> m_particuleList;
public:
void Clear(void);
void Add(Particule* _particule, const char* _particuleType);
void Add(Particule* _particule);
void Update(float _deltaTime);
void Draw(void);
};

View File

@ -10,6 +10,8 @@
#include <ege/ParticuleSimple.h>
#undef __class__
#define __class__ "ParticuleSimple"
ege::ParticuleSimple::ParticuleSimple(ege::ParticuleEngine& _particuleEngine, const char* _particuleType) :
Particule(_particuleEngine, _particuleType)

View File

@ -45,12 +45,13 @@ namespace ege {
//virtual void Draw(void) { };
virtual bool NeedRemove(void);
virtual void Init(void);
private:
protected:
float m_life;
float m_level;
vec3 m_pos;
vec4 m_angle;
vec3 m_speed;
public:
/**
*
*/

View File

@ -228,6 +228,7 @@ void ege::Scene::OnDraw(void)
}
#endif
}
m_env.GetParticuleEngine().Draw();
#ifdef SCENE_DISPLAY_SPEED
float localTime = (float)(ewol::GetTime() - g_startTime) / 1000.0f;
if (localTime>1) {
@ -280,6 +281,7 @@ void ege::Scene::PeriodicCall(const ewol::EventTime& _event)
//optional but useful: debug drawing
m_dynamicsWorld->debugDrawWorld();
}
m_env.GetParticuleEngine().Update(curentDelta);
// Remove all element that requested it ...
{
int32_t numberEnnemyKilled=0;