Merge remote-tracking branch 'origin/particles' into havok
Conflicts: src/Components/Vehicle.h
This commit is contained in:
@@ -14,6 +14,8 @@ struct BoxShape : Component
|
||||
float Width;
|
||||
float Height;
|
||||
float Depth;
|
||||
|
||||
virtual BoxShape* Clone() const override { return new BoxShape(*this); }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -17,6 +17,8 @@ struct Camera : Component
|
||||
float FOV;
|
||||
float NearClip;
|
||||
float FarClip;
|
||||
|
||||
virtual Camera* Clone() const override { return new Camera(*this); }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -13,6 +13,8 @@ struct DirectionalLight : Component
|
||||
float MaxRange;
|
||||
float SpecularIntensity;
|
||||
Color Color;
|
||||
|
||||
virtual DirectionalLight* Clone() const override { return new DirectionalLight(*this); }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -9,6 +9,8 @@ struct FreeSteering : Component
|
||||
{
|
||||
FreeSteering() : Speed(35) { }
|
||||
float Speed;
|
||||
|
||||
virtual FreeSteering* Clone() const override { return new FreeSteering(*this); }
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,8 @@ namespace Components
|
||||
EntityID LinkedEntity;
|
||||
glm::vec3 Pivot;
|
||||
glm::vec3 Axis;
|
||||
|
||||
virtual HingeConstraint* Clone() const override { return new HingeConstraint(*this); }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -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); }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -11,6 +11,8 @@ namespace Components
|
||||
struct MeshShape : Component
|
||||
{
|
||||
std::string ResourceName;
|
||||
|
||||
virtual MeshShape* Clone() const override { return new MeshShape(*this); }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -16,6 +16,8 @@ struct Model : Component
|
||||
Color Color;
|
||||
bool Visible;
|
||||
bool ShadowCaster;
|
||||
|
||||
virtual Model* Clone() const override { return new Model(*this); }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -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__
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -13,6 +13,8 @@ struct Physics : Component
|
||||
|
||||
float Mass;
|
||||
bool Static;
|
||||
|
||||
virtual Physics* Clone() const override { return new Physics(*this); }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -16,6 +16,8 @@ struct PointLight : Component
|
||||
float constantAttenuation, linearAttenuation, quadraticAttenuation;
|
||||
float spotExponent;
|
||||
Color color;
|
||||
|
||||
virtual PointLight* Clone() const override { return new PointLight(*this); }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -17,6 +17,8 @@ struct SoundEmitter : Component
|
||||
float Pitch;
|
||||
bool Loop;
|
||||
std::string Path;
|
||||
|
||||
virtual SoundEmitter* Clone() const override { return new SoundEmitter(*this); }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -12,6 +12,8 @@ struct SphereShape : Component
|
||||
: Radius(1.f){ }
|
||||
|
||||
float Radius;
|
||||
|
||||
virtual SphereShape* Clone() const override { return new SphereShape(*this); }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -13,6 +13,8 @@ struct Sprite : Component
|
||||
{
|
||||
std::string SpriteFile;
|
||||
Color Color;
|
||||
|
||||
virtual Sprite* Clone() const override { return new Sprite(*this); }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Components
|
||||
{
|
||||
struct TankSteering : Component
|
||||
{
|
||||
|
||||
TankSteering* Clone() const override { return new TankSteering(*this); }
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,12 @@
|
||||
namespace Components
|
||||
{
|
||||
|
||||
struct Template : Component { };
|
||||
struct Template
|
||||
: public Component
|
||||
{
|
||||
virtual Template* Clone() const override { return nullptr; }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // !Components_Template_h__
|
||||
@@ -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); }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -23,6 +23,8 @@ struct Vehicle : Component
|
||||
float TopSpeed;
|
||||
float MaxSpeedFullSteeringAngle;
|
||||
float SpringDamping;
|
||||
|
||||
Vehicle* Clone() const override { return new Vehicle(*this); }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -36,6 +36,8 @@ struct Wheel : Component
|
||||
private:
|
||||
int ID;
|
||||
glm::quat OriginalOrientation;
|
||||
|
||||
Wheel* Clone() const override { return new Wheel(*this); }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -9,6 +9,8 @@ namespace Components
|
||||
struct WheelPair : Component
|
||||
{
|
||||
// Flag for pair wheels
|
||||
|
||||
virtual WheelPair* Clone() const override { return new WheelPair(*this); }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user