Components + almost AABB

This commit is contained in:
Adam
2014-03-06 21:32:31 +01:00
parent 54a5a7a113
commit 00584ab397
21 changed files with 401 additions and 11 deletions
+17
View File
@@ -0,0 +1,17 @@
#ifndef Bounds_h__
#define Bounds_h__
#include "Component.h"
#include "AABB.h"
namespace Components
{
struct Bounds : Component
{
AABB BB; //Axis Aligned Bounding Box
};
REGISTER_COMPONENT("Bounds", Bounds);
}
#endif // !Bounds_h__
+18
View File
@@ -0,0 +1,18 @@
#ifndef Camera_h__
#define Camera_h__
#include "Component.h"
namespace Components
{
struct Camera : Component
{
int FOV;
int NearClip;
int FarClip;
};
REGISTER_COMPONENT("Camera", Camera);
}
#endif // !Camera_h__
+18
View File
@@ -0,0 +1,18 @@
#ifndef Collision_h__
#define Collision_h__
#include "Component.h"
#include <vector>
namespace Components
{
struct Collision : Component
{
bool Phantom;
std::vector<int> CollidingEntities;
};
REGISTER_COMPONENT("Collision", Collision);
}
#endif // !Collision_h__
@@ -0,0 +1,20 @@
#ifndef DirectionalLight_h__
#define DirectionalLight_h__
#include "Component.h"
#include "Color.h"
namespace Components
{
struct DirectionalLight : Component
{
float Intensity;
float MaxRange;
float SpecularIntensity;
Color color;
};
REGISTER_COMPONENT("DirectionalLight", DirectionalLight);
}
#endif // !DirectionalLight_h__
+19
View File
@@ -0,0 +1,19 @@
#ifndef Input_h__
#define Input_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);
}
#endif // !Input_h__
+18
View File
@@ -0,0 +1,18 @@
#ifndef Model_h__
#define Model_h__
#include "Component.h"
#include "Color.h"
namespace Components
{
struct Model : Component
{
std::string ModelName;
Color color;
};
REGISTER_COMPONENT("Model", Model);
}
#endif // !Model_h__
@@ -0,0 +1,26 @@
#ifndef ParticleEmitter_h__
#define 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;
};
REGISTER_COMPONENT("ParticleEmitter", ParticleEmitter);
}
#endif // !ParticleEmitter_h__
+20
View File
@@ -0,0 +1,20 @@
#ifndef PointLight_h__
#define PointLight_h__
#include "Component.h"
#include "Color.h"
namespace Components
{
struct PointLight : Component
{
float Intensity;
float MaxRange;
float SpecularIntensity;
Color color;
};
REGISTER_COMPONENT("PointLight", PointLight);
}
#endif // !PointLight_h__
+16
View File
@@ -0,0 +1,16 @@
#ifndef PowerUp_h__
#define PowerUp_h__
#include "Component.h"
namespace Components
{
struct PowerUp : Component
{
int Speed;
};
REGISTER_COMPONENT("PowerUp", PowerUp);
}
#endif // !PowerUp_h__
+18
View File
@@ -0,0 +1,18 @@
#ifndef SoundEmitter_h__
#define SoundEmitter_h__
#include "Component.h"
namespace Components
{
struct SoundEmitter : Component
{
std::string SoundFile;
float Volume;
float MaxRange;
};
REGISTER_COMPONENT("SoundEmitter", SoundEmitter);
}
#endif // !SoundEmitter_h__
+18
View File
@@ -0,0 +1,18 @@
#ifndef Sprite_h__
#define Sprite_h__
#include "Component.h"
#include "Color.h"
namespace Components
{
struct Sprite : Component
{
std::string SpriteFile;
Color color;
};
REGISTER_COMPONENT("Sprite", Sprite);
}
#endif // !Sprite_h__
+17
View File
@@ -0,0 +1,17 @@
#ifndef Stat_h__
#define Stat_h__
#include "Component.h"
namespace Components
{
struct Stat : Component
{
int Health;
bool Destroyable;
};
REGISTER_COMPONENT("Stat", Stat);
}
#endif // !Stat_h__
+13
View File
@@ -0,0 +1,13 @@
#ifndef Template_h__
#define Template_h__
#include "Component.h"
namespace Components
{
struct Template : Component { };
REGISTER_COMPONENT("Template", Template);
}
#endif // !Template_h__
+8 -6
View File
@@ -2,16 +2,18 @@
#define Transform_h__
#include "Component.h"
#include <glm/gtc/quaternion.hpp>
namespace Components
{
struct Transform : Component
{
float Position[3];
};
REGISTER_COMPONENT("Transform", Transform);
struct Transform : Component
{
float Position[3];
glm::fquat qtrn; //Quaternion with floats
float Velocity[3];
};
REGISTER_COMPONENT("Transform", Transform);
}
#endif // Transform_h__