Merge branch 'master' into CoolDeathAnimation

# Conflicts:
#	include/Engine/Rendering/ModelJob.h
#	resources/Shaders/ForwardPlus.frag.glsl
#	src/Engine/Rendering/DrawFinalPass.cpp
#	src/Engine/Rendering/RenderSystem.cpp
This commit is contained in:
2016-01-27 10:31:28 +01:00
44 changed files with 838 additions and 138 deletions
+1
View File
@@ -12,6 +12,7 @@ struct PlayerSpawned : Event
int PlayerID;
EntityWrapper Player;
EntityWrapper Spawner;
std::string PlayerName;
};
}
+4
View File
@@ -23,6 +23,7 @@ struct EntityWrapper
static const EntityWrapper Invalid;
const std::string Name();
bool HasComponent(const std::string& componentType);
EntityWrapper Parent();
EntityWrapper FirstChildByName(const std::string& name);
@@ -35,6 +36,9 @@ struct EntityWrapper
bool operator!=(const EntityWrapper& e) const;
explicit operator EntityID() const;
operator bool();
private:
EntityWrapper firstChildByNameRecursive(const std::string& name, EntityID parent);
};
namespace std
+2
View File
@@ -8,8 +8,10 @@
namespace Transform
{
glm::mat4 AbsoluteTransformation(EntityWrapper entity);
glm::vec3 AbsolutePosition(EntityWrapper entity);
glm::vec3 AbsolutePosition(World* world, EntityID entity);
glm::vec3 AbsoluteOrientationEuler(EntityWrapper entity);
glm::quat AbsoluteOrientation(EntityWrapper entity);
glm::quat AbsoluteOrientation(World* world, EntityID entity);
glm::vec3 AbsoluteScale(EntityWrapper entity);
+2
View File
@@ -2,6 +2,7 @@
#define Events_InputCommand_h__
#include "Core/EventBroker.h"
#include "Core/EntityWrapper.h"
namespace Events
{
@@ -10,6 +11,7 @@ struct InputCommand : Event
{
/** Numerical ID of the player. */
int PlayerID;
EntityWrapper Player;
/** The command that was sent. */
std::string Command;
/** The value of the command. */
@@ -15,8 +15,8 @@
struct ExplosionEffectJob : ModelJob
{
ExplosionEffectJob(ComponentWrapper explosionEffectComponent, ::Model* model, Camera* camera, glm::mat4 matrix, ::RawModel::MaterialGroup matGroup, ComponentWrapper modelComponent, ::World* world)
: ModelJob(model, camera, matrix, matGroup, modelComponent, world)
ExplosionEffectJob(ComponentWrapper explosionEffectComponent, ::Model* model, Camera* camera, glm::mat4 matrix, ::RawModel::MaterialGroup matGroup, ComponentWrapper modelComponent, ::World* world, glm::vec4 fillColor, float fillPercentage)
: ModelJob(model, camera, matrix, matGroup, modelComponent, world, fillColor, fillPercentage)
{
ExplosionOrigin = (glm::vec3)explosionEffectComponent["ExplosionOrigin"];
TimeSinceDeath = (double)explosionEffectComponent["TimeSinceDeath"];
+7 -1
View File
@@ -17,7 +17,7 @@
struct ModelJob : RenderJob
{
ModelJob(::Model* model, ::Camera* camera, glm::mat4 matrix, ::RawModel::MaterialGroup matGroup, ComponentWrapper modelComponent, ::World* world)
ModelJob(Model* model, Camera* camera, glm::mat4 matrix, ::RawModel::MaterialGroup matGroup, ComponentWrapper modelComponent, World* world, glm::vec4 fillColor, float fillPercentage)
: RenderJob()
{
Model = model;
@@ -39,6 +39,9 @@ struct ModelJob : RenderJob
Depth = worldpos.z;
World = world;
FillColor = fillColor;
FillPercentage = fillPercentage;
Skeleton = Model->m_RawModel->m_Skeleton;
if (world->HasComponent(Entity, "Animation") && Skeleton != nullptr) {
@@ -72,6 +75,9 @@ struct ModelJob : RenderJob
unsigned int EndIndex = 0;
World* World;
glm::vec4 FillColor = glm::vec4(0);
float FillPercentage = 0.0;
void CalculateHash() override
{
Hash = TextureID;
+1
View File
@@ -29,6 +29,7 @@ private:
const IRenderer* m_Renderer;
RenderFrame* m_RenderFrame;
Camera* m_Camera;
World* m_World;
EntityWrapper m_CurrentCamera = EntityWrapper::Invalid;
EntityWrapper m_LocalPlayer = EntityWrapper::Invalid;