Merge remote-tracking branch 'origin/particles' into havok

Conflicts:
	src/Components/Vehicle.h
This commit is contained in:
ViktorLjung
2014-05-13 01:57:28 +02:00
35 changed files with 571 additions and 39 deletions
+2
View File
@@ -14,6 +14,8 @@ struct BoxShape : Component
float Width;
float Height;
float Depth;
virtual BoxShape* Clone() const override { return new BoxShape(*this); }
};
}
+2
View File
@@ -17,6 +17,8 @@ struct Camera : Component
float FOV;
float NearClip;
float FarClip;
virtual Camera* Clone() const override { return new Camera(*this); }
};
}
+2
View File
@@ -13,6 +13,8 @@ struct DirectionalLight : Component
float MaxRange;
float SpecularIntensity;
Color Color;
virtual DirectionalLight* Clone() const override { return new DirectionalLight(*this); }
};
}
+2
View File
@@ -9,6 +9,8 @@ struct FreeSteering : Component
{
FreeSteering() : Speed(35) { }
float Speed;
virtual FreeSteering* Clone() const override { return new FreeSteering(*this); }
};
}
+2
View File
@@ -11,6 +11,8 @@ namespace Components
EntityID LinkedEntity;
glm::vec3 Pivot;
glm::vec3 Axis;
virtual HingeConstraint* Clone() const override { return new HingeConstraint(*this); }
};
}
+2
View File
@@ -18,6 +18,8 @@ struct Input : Component
std::array<int, GLFW_MOUSE_BUTTON_LAST+1> LastMouseState;
float dX, dY;
float WheelDelta;
virtual Input* Clone() const override { return new Input(*this); }
};
}
+2
View File
@@ -11,6 +11,8 @@ namespace Components
struct MeshShape : Component
{
std::string ResourceName;
virtual MeshShape* Clone() const override { return new MeshShape(*this); }
};
}
+2
View File
@@ -16,6 +16,8 @@ struct Model : Component
Color Color;
bool Visible;
bool ShadowCaster;
virtual Model* Clone() const override { return new Model(*this); }
};
}
+25
View File
@@ -0,0 +1,25 @@
#ifndef Components_Particle_h__
#define Components_Particle_h__
#include "System.h"
#include "Component.h"
#include "Color.h"
#include <vector>
namespace Components
{
struct Particle : Component
{
std::vector<Color> ColorSpectrum;
std::vector<glm::vec3> ScaleSpectrum;
double LifeTime;
std::vector<glm::vec3> VelocitySpectrum;
std::vector<float> AngularVelocitySpectrum;
std::vector<glm::vec3> OrientationSpectrum; //Keep?
virtual Particle* Clone() const override { return new Particle(*this); }
};
}
#endif // !Components_Particle_h__
+24 -5
View File
@@ -5,20 +5,39 @@
#include "Color.h"
#include <vector>
namespace Systems { class ParticleSystem; }
namespace Components
{
struct ParticleEmitter : Component
{
int ParticleTemplate;
friend class Systems::ParticleSystem;
ParticleEmitter()
: SpawnFrequency(0)
, SpawnCount(0)
, SpreadAngle(0)
, LifeTime(0)
, TimeSinceLastSpawn(0) { }
EntityID ParticleTemplate;
float SpawnFrequency;
float Speed;
int SpawnCount;
std::vector<Color> ColorSpectrum;
std::vector<float> ScaleSpectrum;
std::vector<glm::vec3> ScaleSpectrum;
float SpreadAngle;
float LifeTime;
std::vector<float[3]> VelocitySpectrum;
std::vector<float[3]> AngularVelocitySpectrum;
double LifeTime;
bool UseGoalVelocity;
glm::vec3 GoalVelocity;
std::vector<float> AngularVelocitySpectrum;
std::vector<glm::vec3> OrientationSpectrum; //Keep?
virtual ParticleEmitter* Clone() const override { return new ParticleEmitter(*this); }
private:
double TimeSinceLastSpawn;
};
}
+2
View File
@@ -13,6 +13,8 @@ struct Physics : Component
float Mass;
bool Static;
virtual Physics* Clone() const override { return new Physics(*this); }
};
}
+2
View File
@@ -16,6 +16,8 @@ struct PointLight : Component
float constantAttenuation, linearAttenuation, quadraticAttenuation;
float spotExponent;
Color color;
virtual PointLight* Clone() const override { return new PointLight(*this); }
};
}
+2
View File
@@ -17,6 +17,8 @@ struct SoundEmitter : Component
float Pitch;
bool Loop;
std::string Path;
virtual SoundEmitter* Clone() const override { return new SoundEmitter(*this); }
};
}
+2
View File
@@ -12,6 +12,8 @@ struct SphereShape : Component
: Radius(1.f){ }
float Radius;
virtual SphereShape* Clone() const override { return new SphereShape(*this); }
};
}
+2
View File
@@ -13,6 +13,8 @@ struct Sprite : Component
{
std::string SpriteFile;
Color Color;
virtual Sprite* Clone() const override { return new Sprite(*this); }
};
}
+1 -1
View File
@@ -7,7 +7,7 @@ namespace Components
{
struct TankSteering : Component
{
TankSteering* Clone() const override { return new TankSteering(*this); }
};
}
+6 -1
View File
@@ -6,7 +6,12 @@
namespace Components
{
struct Template : Component { };
struct Template
: public Component
{
virtual Template* Clone() const override { return nullptr; }
};
}
#endif // !Components_Template_h__
+3 -1
View File
@@ -6,7 +6,7 @@
namespace Components
{
struct Transform : Component
struct Transform : public Component
{
Transform()
: Scale(glm::vec3(1.f)) { }
@@ -15,6 +15,8 @@ struct Transform : Component
glm::quat Orientation;
glm::vec3 Velocity;
glm::vec3 Scale;
virtual Transform* Clone() const override { return new Transform(*this); }
};
}
+2
View File
@@ -23,6 +23,8 @@ struct Vehicle : Component
float TopSpeed;
float MaxSpeedFullSteeringAngle;
float SpringDamping;
Vehicle* Clone() const override { return new Vehicle(*this); }
};
}
+2
View File
@@ -36,6 +36,8 @@ struct Wheel : Component
private:
int ID;
glm::quat OriginalOrientation;
Wheel* Clone() const override { return new Wheel(*this); }
};
}
+2
View File
@@ -9,6 +9,8 @@ namespace Components
struct WheelPair : Component
{
// Flag for pair wheels
virtual WheelPair* Clone() const override { return new WheelPair(*this); }
};
}