Adapted Escape the Dawn engine.

This commit is contained in:
2014-04-04 23:14:18 +02:00
parent 6a64de37fb
commit a7985b1686
64 changed files with 3384 additions and 79 deletions
+17
View File
@@ -0,0 +1,17 @@
#ifndef Components_Bounds_h__
#define Components_Bounds_h__
#include "Component.h"
namespace Components
{
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
};
}
#endif // !Components_Bounds_h__
+19
View File
@@ -0,0 +1,19 @@
#ifndef Components_Camera_h__
#define Components_Camera_h__
#include "Component.h"
namespace Components
{
struct Camera : Component
{
Camera() : FOV(glm::radians(45.f)), NearClip(0.1f), FarClip(100.f) { }
float FOV;
float NearClip;
float FarClip;
};
}
#endif // !Components_Camera_h__
+21
View File
@@ -0,0 +1,21 @@
#ifndef Components_Collision_h__
#define Components_Collision_h__
#include "Entity.h"
#include "Component.h"
#include <vector>
namespace Components
{
struct Collision : Component
{
Collision() : Phantom(false), Interested(false) { }
bool Phantom;
bool Interested;
std::vector<EntityID> CollidingEntities;
};
}
#endif // !Components_Collision_h__
+19
View File
@@ -0,0 +1,19 @@
#ifndef Components_DirectionalLight_h__
#define Components_DirectionalLight_h__
#include "Component.h"
#include "Color.h"
namespace Components
{
struct DirectionalLight : Component
{
float Intensity;
float MaxRange;
float SpecularIntensity;
Color Color;
};
}
#endif // !Components_DirectionalLight_h__
+25
View File
@@ -0,0 +1,25 @@
#ifndef Components_Input_h__
#define Components_Input_h__
#include <array>
#include <GLFW/glfw3.h>
#include "Component.h"
namespace Components
{
struct Input : Component
{
std::array<int, GLFW_KEY_LAST+1> KeyState;
std::array<int, GLFW_KEY_LAST+1> LastKeyState;
std::array<int, GLFW_MOUSE_BUTTON_LAST+1> MouseState;
std::array<int, GLFW_MOUSE_BUTTON_LAST+1> LastMouseState;
float dX, dY;
float WheelDelta;
};
}
#endif // !Components_Input_h__
+22
View File
@@ -0,0 +1,22 @@
#ifndef Components_Model_h__
#define Components_Model_h__
#include <string>
#include "Component.h"
#include "Color.h"
namespace Components
{
struct Model : Component
{
Model() : Visible(true), ShadowCaster(true) { }
std::string ModelFile;
Color Color;
bool Visible;
bool ShadowCaster;
};
}
#endif // !Components_Model_h__
+25
View File
@@ -0,0 +1,25 @@
#ifndef Components_ParticleEmitter_h__
#define Components_ParticleEmitter_h__
#include "Component.h"
#include "Color.h"
#include <vector>
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;
};
}
#endif // !Components_ParticleEmitter_h__
+22
View File
@@ -0,0 +1,22 @@
#ifndef Components_PointLight_h__
#define Components_PointLight_h__
#include "Component.h"
#include "Color.h"
namespace Components
{
struct PointLight : Component
{
float Intensity;
float MaxRange;
glm::vec3 Specular;
glm::vec3 Diffuse;
float constantAttenuation, linearAttenuation, quadraticAttenuation;
float spotExponent;
Color color;
};
}
#endif // !Components_PointLight_h__
+15
View File
@@ -0,0 +1,15 @@
#ifndef Components_PowerUp_h__
#define Components_PowerUp_h__
#include "Component.h"
namespace Components
{
struct PowerUp : Component
{
float Speed;
};
}
#endif // !Components_PowerUp_h__
+22
View File
@@ -0,0 +1,22 @@
#ifndef Components_SoundEmitter_h__
#define Components_SoundEmitter_h__
#include <string>
#include "Component.h"
namespace Components
{
struct SoundEmitter : Component
{
float Gain;
float MaxDistance;
float ReferenceDistance;
float Pitch;
bool Loop;
std::string Path;
};
}
#endif // !Components_SoundEmitter_h__
+19
View File
@@ -0,0 +1,19 @@
#ifndef Components_Sprite_h__
#define Components_Sprite_h__
#include <string>
#include "Component.h"
#include "Color.h"
namespace Components
{
struct Sprite : Component
{
std::string SpriteFile;
Color Color;
};
}
#endif // !Components_Sprite_h__
+16
View File
@@ -0,0 +1,16 @@
#ifndef Components_Stat_h__
#define Components_Stat_h__
#include "Component.h"
namespace Components
{
struct Stat : Component
{
float Health;
bool Destroyable;
};
}
#endif // !Components_Stat_h__
+12
View File
@@ -0,0 +1,12 @@
#ifndef Components_Template_h__
#define Components_Template_h__
#include "Component.h"
namespace Components
{
struct Template : Component { };
}
#endif // !Components_Template_h__
+22
View File
@@ -0,0 +1,22 @@
#ifndef Components_Transform_h__
#define Components_Transform_h__
#include "Component.h"
namespace Components
{
struct Transform : Component
{
Transform()
: Scale(glm::vec3(1.f)) { }
glm::vec3 Position;
glm::quat Orientation;
glm::vec3 Velocity;
glm::vec3 Scale;
};
}
#endif // Components_Transform_h__