Merge branch 'master' of github.com:sippeangelo/Escape-the-Dawn

Conflicts:
	Escape-the-Dawn/AABB.h
	Escape-the-Dawn/Components/Bounds.h
	Escape-the-Dawn/Escape-the-Dawn.vcxproj
	Escape-the-Dawn/Escape-the-Dawn.vcxproj.filters
This commit is contained in:
Adam
2014-03-07 19:17:24 +01:00
35 changed files with 462 additions and 398 deletions
+6 -7
View File
@@ -1,5 +1,5 @@
#ifndef Bounds_h__
#define Bounds_h__
#ifndef Components_Bounds_h__
#define Components_Bounds_h__
#include "Component.h"
#include <glm/common.hpp>
@@ -8,13 +8,12 @@
namespace Components
{
struct Bounds : Component
{
struct Bounds : Component
{
//Axis Aligned Bounding Box
glm::vec3 origin;
glm::vec3 volumeVector; //The vector that defines the volume of the BB, it goes from one corner to the opposite one
};
REGISTER_COMPONENT("Bounds", Bounds);
};
}
#endif // !Bounds_h__
#endif // !Components_Bounds_h__
+9 -10
View File
@@ -1,18 +1,17 @@
#ifndef Camera_h__
#define Camera_h__
#ifndef Components_Camera_h__
#define Components_Camera_h__
#include "Component.h"
namespace Components
{
struct Camera : Component
{
int FOV;
int NearClip;
int FarClip;
};
REGISTER_COMPONENT("Camera", Camera);
struct Camera : Component
{
int FOV;
int NearClip;
int FarClip;
};
}
#endif // !Camera_h__
#endif // !Components_Camera_h__
+9 -9
View File
@@ -1,18 +1,18 @@
#ifndef Collision_h__
#define Collision_h__
#ifndef Components_Collision_h__
#define Components_Collision_h__
#include "Entity.h"
#include "Component.h"
#include <vector>
namespace Components
{
struct Collision : Component
{
bool Phantom;
std::vector<int> CollidingEntities;
};
REGISTER_COMPONENT("Collision", Collision);
struct Collision : Component
{
bool Phantom;
std::vector<EntityID> CollidingEntities;
};
}
#endif // !Collision_h__
#endif // !Components_Collision_h__
+10 -11
View File
@@ -1,5 +1,5 @@
#ifndef DirectionalLight_h__
#define DirectionalLight_h__
#ifndef Components_DirectionalLight_h__
#define Components_DirectionalLight_h__
#include "Component.h"
#include "Color.h"
@@ -7,14 +7,13 @@
namespace Components
{
struct DirectionalLight : Component
{
float Intensity;
float MaxRange;
float SpecularIntensity;
Color color;
};
REGISTER_COMPONENT("DirectionalLight", DirectionalLight);
struct DirectionalLight : Component
{
float Intensity;
float MaxRange;
float SpecularIntensity;
Color Color;
};
}
#endif // !DirectionalLight_h__
#endif // !Components_DirectionalLight_h__
+16 -11
View File
@@ -1,19 +1,24 @@
#ifndef Input_h__
#define Input_h__
#ifndef Components_Input_h__
#define Components_Input_h__
#include <array>
#include <GLFW/glfw3.h>
#include "Component.h"
#include <GLFW/glfw3.h>
namespace Components
{
struct Input : Component
{
int KeyState[GLFW_KEY_LAST];
float MouseState[2];
float dX, dY;
};
REGISTER_COMPONENT("Input", Input);
struct Input : Component
{
std::array<int, GLFW_KEY_LAST> KeyState;
std::array<int, GLFW_KEY_LAST> LastKeyState;
std::array<int, GLFW_MOUSE_BUTTON_LAST> MouseState;
std::array<int, GLFW_MOUSE_BUTTON_LAST> LastMouseState;
float dX, dY;
};
}
#endif // !Input_h__
#endif // !Components_Input_h__
+10 -9
View File
@@ -1,5 +1,7 @@
#ifndef Model_h__
#define Model_h__
#ifndef Components_Model_h__
#define Components_Model_h__
#include <string>
#include "Component.h"
#include "Color.h"
@@ -7,12 +9,11 @@
namespace Components
{
struct Model : Component
{
std::string ModelName;
Color color;
};
REGISTER_COMPONENT("Model", Model);
struct Model : Component
{
std::string ModelFile;
Color Color;
};
}
#endif // !Model_h__
#endif // !Components_Model_h__
+15 -16
View File
@@ -1,5 +1,5 @@
#ifndef ParticleEmitter_h__
#define ParticleEmitter_h__
#ifndef Components_ParticleEmitter_h__
#define Components_ParticleEmitter_h__
#include "Component.h"
#include "Color.h"
@@ -8,19 +8,18 @@
namespace Components
{
struct ParticleEmitter : Component
{
int ParticleTemplate;
float SpawnFrequency;
int SpawnCount;
std::vector<Color> ColorSpectrum;
std::vector<float> ScaleSpectrum;
float SpreadAngle;
float LifeTime;
std::vector<float[3]> VelocitySpectrum;
std::vector<float[3]> AngularVelocitySpectrum;
};
REGISTER_COMPONENT("ParticleEmitter", ParticleEmitter);
struct ParticleEmitter : Component
{
int ParticleTemplate;
float SpawnFrequency;
int SpawnCount;
std::vector<Color> ColorSpectrum;
std::vector<float> ScaleSpectrum;
float SpreadAngle;
float LifeTime;
std::vector<float[3]> VelocitySpectrum;
std::vector<float[3]> AngularVelocitySpectrum;
};
}
#endif // !ParticleEmitter_h__
#endif // !Components_ParticleEmitter_h__
+10 -11
View File
@@ -1,5 +1,5 @@
#ifndef PointLight_h__
#define PointLight_h__
#ifndef Components_PointLight_h__
#define Components_PointLight_h__
#include "Component.h"
#include "Color.h"
@@ -7,14 +7,13 @@
namespace Components
{
struct PointLight : Component
{
float Intensity;
float MaxRange;
float SpecularIntensity;
Color color;
};
REGISTER_COMPONENT("PointLight", PointLight);
struct PointLight : Component
{
float Intensity;
float MaxRange;
float SpecularIntensity;
Color Color;
};
}
#endif // !PointLight_h__
#endif // !Components_PointLight_h__
+7 -8
View File
@@ -1,16 +1,15 @@
#ifndef PowerUp_h__
#define PowerUp_h__
#ifndef Components_PowerUp_h__
#define Components_PowerUp_h__
#include "Component.h"
namespace Components
{
struct PowerUp : Component
{
int Speed;
};
REGISTER_COMPONENT("PowerUp", PowerUp);
struct PowerUp : Component
{
float Speed;
};
}
#endif // !PowerUp_h__
#endif // !Components_PowerUp_h__
+11 -10
View File
@@ -1,18 +1,19 @@
#ifndef SoundEmitter_h__
#define SoundEmitter_h__
#ifndef Components_SoundEmitter_h__
#define Components_SoundEmitter_h__
#include <string>
#include "Component.h"
namespace Components
{
struct SoundEmitter : Component
{
std::string SoundFile;
float Volume;
float MaxRange;
};
REGISTER_COMPONENT("SoundEmitter", SoundEmitter);
struct SoundEmitter : Component
{
std::string SoundFile;
float Volume;
float MaxRange;
};
}
#endif // !SoundEmitter_h__
#endif // !Components_SoundEmitter_h__
+10 -9
View File
@@ -1,5 +1,7 @@
#ifndef Sprite_h__
#define Sprite_h__
#ifndef Components_Sprite_h__
#define Components_Sprite_h__
#include <string>
#include "Component.h"
#include "Color.h"
@@ -7,12 +9,11 @@
namespace Components
{
struct Sprite : Component
{
std::string SpriteFile;
Color color;
};
REGISTER_COMPONENT("Sprite", Sprite);
struct Sprite : Component
{
std::string SpriteFile;
Color Color;
};
}
#endif // !Sprite_h__
#endif // !Components_Sprite_h__
+8 -9
View File
@@ -1,17 +1,16 @@
#ifndef Stat_h__
#define Stat_h__
#ifndef Components_Stat_h__
#define Components_Stat_h__
#include "Component.h"
namespace Components
{
struct Stat : Component
{
int Health;
bool Destroyable;
};
REGISTER_COMPONENT("Stat", Stat);
struct Stat : Component
{
float Health;
bool Destroyable;
};
}
#endif // !Stat_h__
#endif // !Components_Stat_h__
+4 -5
View File
@@ -1,13 +1,12 @@
#ifndef Template_h__
#define Template_h__
#ifndef Components_Template_h__
#define Components_Template_h__
#include "Component.h"
namespace Components
{
struct Template : Component { };
REGISTER_COMPONENT("Template", Template);
struct Template : Component { };
}
#endif // !Template_h__
#endif // !Components_Template_h__
+19
View File
@@ -0,0 +1,19 @@
#ifndef Components_Transform_h__
#define Components_Transform_h__
#include "Component.h"
#include <glm/gtc/quaternion.hpp>
namespace Components
{
struct Transform : Component
{
glm::vec3 Position;
glm::quat Orientation;
glm::vec3 Velocity;
};
}
#endif // Components_Transform_h__
@@ -1,19 +0,0 @@
#ifndef Transform_h__
#define Transform_h__
#include "Component.h"
#include <glm/gtc/quaternion.hpp>
namespace Components
{
struct Transform : Component
{
float Position[3];
glm::fquat qtrn; //Quaternion with floats
float Velocity[3];
};
REGISTER_COMPONENT("Transform", Transform);
}
#endif // Transform_h__