Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8a8c375d3a | |||
| 8936b3d6c3 | |||
| 8a3564ad49 | |||
| 9581e9ac84 |
@@ -19,6 +19,7 @@ public:
|
|||||||
virtual const glm::vec3 Rotation() const { return m_Rotation; }
|
virtual const glm::vec3 Rotation() const { return m_Rotation; }
|
||||||
virtual bool Jumping() const { return m_Jumping; }
|
virtual bool Jumping() const { return m_Jumping; }
|
||||||
virtual bool Crouching() const { return m_Crouching; }
|
virtual bool Crouching() const { return m_Crouching; }
|
||||||
|
virtual bool CrouchingLastFrame() const { return m_CrouchingLastFrame; }
|
||||||
virtual bool DoubleJumping() const { return m_DoubleJumping; }
|
virtual bool DoubleJumping() const { return m_DoubleJumping; }
|
||||||
virtual void SetDoubleJumping(bool isDoubleJumping) {
|
virtual void SetDoubleJumping(bool isDoubleJumping) {
|
||||||
m_DoubleJumping = isDoubleJumping;
|
m_DoubleJumping = isDoubleJumping;
|
||||||
@@ -44,6 +45,7 @@ protected:
|
|||||||
bool m_Jumping = false;
|
bool m_Jumping = false;
|
||||||
bool m_DoubleJumping = false;
|
bool m_DoubleJumping = false;
|
||||||
bool m_Crouching = false;
|
bool m_Crouching = false;
|
||||||
|
bool m_CrouchingLastFrame = false;
|
||||||
//assault dash membervariables - needed to calculate the doubletap- and dashlogic
|
//assault dash membervariables - needed to calculate the doubletap- and dashlogic
|
||||||
double m_AssaultDashDoubleTapDeltaTime = 0.0;
|
double m_AssaultDashDoubleTapDeltaTime = 0.0;
|
||||||
//i will let m_AssaultDashDoubleTapSensitivityTimer stay hardcoded, its not really a gamevariable (more an inputvariable),
|
//i will let m_AssaultDashDoubleTapSensitivityTimer stay hardcoded, its not really a gamevariable (more an inputvariable),
|
||||||
@@ -82,6 +84,7 @@ void FirstPersonInputController<EventContext>::Reset()
|
|||||||
{
|
{
|
||||||
m_Rotation = glm::vec3(0.f, 0.f, 0.f);
|
m_Rotation = glm::vec3(0.f, 0.f, 0.f);
|
||||||
m_Jumping = false;
|
m_Jumping = false;
|
||||||
|
m_CrouchingLastFrame = m_Crouching;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename EventContext>
|
template <typename EventContext>
|
||||||
|
|||||||
@@ -63,8 +63,7 @@ private:
|
|||||||
|
|
||||||
GLuint m_DepthMap;
|
GLuint m_DepthMap;
|
||||||
FrameBuffer m_DepthBuffer;
|
FrameBuffer m_DepthBuffer;
|
||||||
ShaderProgram* m_ShadowProgram;
|
ShaderProgram* m_ShadowProgram;
|
||||||
ShaderProgram* m_ShadowProgramSkinned;
|
|
||||||
|
|
||||||
std::array<glm::mat4, MAX_SPLITS> m_LightProjection;
|
std::array<glm::mat4, MAX_SPLITS> m_LightProjection;
|
||||||
std::array<glm::mat4, MAX_SPLITS> m_LightView;
|
std::array<glm::mat4, MAX_SPLITS> m_LightView;
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#include "Core/System.h"
|
#include "Core/System.h"
|
||||||
#include "Input/EInputCommand.h"
|
#include "Input/EInputCommand.h"
|
||||||
#include "Network/EPlayerDisconnected.h"
|
|
||||||
|
|
||||||
class SpectatorCameraSystem : public ImpureSystem
|
class SpectatorCameraSystem : public ImpureSystem
|
||||||
{
|
{
|
||||||
@@ -18,8 +17,6 @@ private:
|
|||||||
|
|
||||||
EventRelay<SpectatorCameraSystem, Events::InputCommand> m_EInputCommand;
|
EventRelay<SpectatorCameraSystem, Events::InputCommand> m_EInputCommand;
|
||||||
bool OnInputCommand(const Events::InputCommand& e);
|
bool OnInputCommand(const Events::InputCommand& e);
|
||||||
EventRelay<SpectatorCameraSystem, Events::PlayerDisconnected> m_EDisconnect;
|
|
||||||
bool OnDisconnect(const Events::PlayerDisconnected& e);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -29,6 +29,4 @@ K=TakeDamage,1500
|
|||||||
F2=PerformanceTimingResetAllTimers
|
F2=PerformanceTimingResetAllTimers
|
||||||
F3=PerformanceTimingCreateExcelData
|
F3=PerformanceTimingCreateExcelData
|
||||||
Comma=SwapToClassPick
|
Comma=SwapToClassPick
|
||||||
Period=SwapToTeamPick
|
Period=SwapToTeamPick
|
||||||
Enter=PickClass,1
|
|
||||||
F5=DisconnectFromServer
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
#version 430
|
|
||||||
|
|
||||||
uniform mat4 M;
|
|
||||||
uniform mat4 V;
|
|
||||||
uniform mat4 P;
|
|
||||||
uniform mat4 Bones[100];
|
|
||||||
|
|
||||||
layout (location = 0) in vec3 Position;
|
|
||||||
layout (location = 4) in vec2 TextureCoords;
|
|
||||||
layout(location = 5) in vec4 BoneIndices;
|
|
||||||
layout(location = 6) in vec4 BoneWeights;
|
|
||||||
|
|
||||||
out VertexData{
|
|
||||||
vec2 TextureCoordinate;
|
|
||||||
}Output;
|
|
||||||
|
|
||||||
void main()
|
|
||||||
{
|
|
||||||
mat4 boneTransform = mat4(1);
|
|
||||||
if(BoneWeights[0] > 0.0f){
|
|
||||||
boneTransform = BoneWeights[0] * Bones[int(BoneIndices[0])]
|
|
||||||
+ BoneWeights[1] * Bones[int(BoneIndices[1])]
|
|
||||||
+ BoneWeights[2] * Bones[int(BoneIndices[2])]
|
|
||||||
+ BoneWeights[3] * Bones[int(BoneIndices[3])];
|
|
||||||
}
|
|
||||||
|
|
||||||
gl_Position = P * V * M * boneTransform * vec4(Position, 1.0);
|
|
||||||
Output.TextureCoordinate = TextureCoords;
|
|
||||||
}
|
|
||||||
@@ -470,6 +470,7 @@ bool AABBvsTriangle(const AABB& box,
|
|||||||
}
|
}
|
||||||
|
|
||||||
glm::vec3 cornerResolution = (1+t) * diagonal;
|
glm::vec3 cornerResolution = (1+t) * diagonal;
|
||||||
|
cornerResolution = glm::dot(cornerResolution, triNormal) * triNormal;
|
||||||
//Overwrite the smallest resolution if cornerResolution is smaller.
|
//Overwrite the smallest resolution if cornerResolution is smaller.
|
||||||
float lenSq = glm::length2(cornerResolution);
|
float lenSq = glm::length2(cornerResolution);
|
||||||
if (lenSq < resolveShortest.DistanceSq) {
|
if (lenSq < resolveShortest.DistanceSq) {
|
||||||
|
|||||||
@@ -88,12 +88,11 @@ void CollisionSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper& c
|
|||||||
glm::mat4 modelMatrix = Transform::ModelMatrix(boxB.Entity);
|
glm::mat4 modelMatrix = Transform::ModelMatrix(boxB.Entity);
|
||||||
|
|
||||||
glm::vec3 inOutVelocity = (glm::vec3)cPhysics["Velocity"];
|
glm::vec3 inOutVelocity = (glm::vec3)cPhysics["Velocity"];
|
||||||
bool notMovingxz = glm::all(glm::lessThan(glm::abs(glm::vec2(inOutVelocity.x, inOutVelocity.z)), glm::vec2(0.01f))) && prevPosIt != m_PrevPositions.end();
|
|
||||||
bool isOnGround = (bool)cPhysics["IsOnGround"];
|
bool isOnGround = (bool)cPhysics["IsOnGround"];
|
||||||
float verticalStepHeight = (float)(double)cPhysics["VerticalStepHeight"];
|
float verticalStepHeight = (float)(double)cPhysics["VerticalStepHeight"];
|
||||||
if (Collision::AABBvsTriangles(boxA, model->Vertices(), model->m_Indices, modelMatrix, inOutVelocity, verticalStepHeight, isOnGround, resolutionVector)) {
|
if (Collision::AABBvsTriangles(boxA, model->Vertices(), model->m_Indices, modelMatrix, inOutVelocity, verticalStepHeight, isOnGround, resolutionVector)) {
|
||||||
//Move the position to previous position if it is not moving in the xz-plane, else resolve with the resolution vector.
|
//Move the position to previous position if it is not moving in the xz-plane, else resolve with the resolution vector.
|
||||||
(glm::vec3&)cTransform["Position"] += notMovingxz ? prevPosIt->second - boxA.Origin() : resolutionVector;
|
(glm::vec3&)cTransform["Position"] += resolutionVector;
|
||||||
boxA = *Collision::EntityAbsoluteAABB(entity);
|
boxA = *Collision::EntityAbsoluteAABB(entity);
|
||||||
cPhysics["Velocity"] = inOutVelocity;
|
cPhysics["Velocity"] = inOutVelocity;
|
||||||
if (isOnGround) {
|
if (isOnGround) {
|
||||||
|
|||||||
@@ -47,7 +47,6 @@ EditorSystem::EditorSystem(SystemParams params, IRenderer* renderer, RenderFrame
|
|||||||
Enable();
|
Enable();
|
||||||
} else {
|
} else {
|
||||||
Disable();
|
Disable();
|
||||||
m_EventBroker->Publish(Events::UnlockMouse());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
#include "Network/Client.h"
|
#include "Network/Client.h"
|
||||||
#include "Network/EPlayerDisconnected.h"
|
|
||||||
using namespace boost::asio::ip;
|
using namespace boost::asio::ip;
|
||||||
|
|
||||||
Client::Client(World* world, EventBroker* eventBroker)
|
Client::Client(World* world, EventBroker* eventBroker)
|
||||||
@@ -225,7 +224,7 @@ void Client::parseServerlist(Packet& packet)
|
|||||||
void Client::parseKick()
|
void Client::parseKick()
|
||||||
{
|
{
|
||||||
LOG_WARNING("You have been kicked from the server.");
|
LOG_WARNING("You have been kicked from the server.");
|
||||||
disconnect();
|
m_IsConnected = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::parseSpawnEvents()
|
void Client::parseSpawnEvents()
|
||||||
@@ -465,10 +464,6 @@ void Client::disconnect()
|
|||||||
Packet packet(MessageType::Disconnect, m_SendPacketID);
|
Packet packet(MessageType::Disconnect, m_SendPacketID);
|
||||||
m_Reliable.Send(packet);
|
m_Reliable.Send(packet);
|
||||||
m_Reliable.Disconnect();
|
m_Reliable.Disconnect();
|
||||||
Events::PlayerDisconnected e;
|
|
||||||
e.Entity = m_LocalPlayer.ID;
|
|
||||||
e.PlayerID = -1;
|
|
||||||
m_EventBroker->Publish(e);
|
|
||||||
createMainMenu();
|
createMainMenu();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -127,12 +127,12 @@ void AnimationSystem::UpdateAnimations(double dt)
|
|||||||
void AnimationSystem::UpdateWeights(double dt)
|
void AnimationSystem::UpdateWeights(double dt)
|
||||||
{
|
{
|
||||||
for (auto it = m_AutoBlendQueues.begin(); it != m_AutoBlendQueues.end(); ) {
|
for (auto it = m_AutoBlendQueues.begin(); it != m_AutoBlendQueues.end(); ) {
|
||||||
/* LOG_INFO("%s", it->first.Name().c_str());
|
LOG_INFO("%s", it->first.Name().c_str());
|
||||||
it->second.PrintQueue();*/
|
it->second.PrintQueue();
|
||||||
|
|
||||||
if(it->second.HasActiveBlendJob()) {
|
if(it->second.HasActiveBlendJob()) {
|
||||||
AutoBlendQueue::AutoBlendJob& blendJob = it->second.GetActiveBlendJob();
|
AutoBlendQueue::AutoBlendJob& blendJob = it->second.GetActiveBlendJob();
|
||||||
//LOG_INFO("%s", blendJob.RootNode.Name().c_str());
|
LOG_INFO("%s", blendJob.RootNode.Name().c_str());
|
||||||
std::shared_ptr<BlendTree> blendTree = it->second.GetBlendTree();
|
std::shared_ptr<BlendTree> blendTree = it->second.GetBlendTree();
|
||||||
if (blendTree != nullptr) {
|
if (blendTree != nullptr) {
|
||||||
if (blendJob.Duration != 0.0) {
|
if (blendJob.Duration != 0.0) {
|
||||||
|
|||||||
@@ -219,7 +219,7 @@ void PickingPass::Draw(RenderScene& scene)
|
|||||||
m_PickingSkinnedProgram->Bind();
|
m_PickingSkinnedProgram->Bind();
|
||||||
lastShader = m_PickingSkinnedProgram->GetHandle();
|
lastShader = m_PickingSkinnedProgram->GetHandle();
|
||||||
}
|
}
|
||||||
glUniformMatrix4fv(glGetUniformLocation(shaderSkinnedHandle, "PVM"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix() * scene.Camera->ViewMatrix() * modelJob->Matrix));
|
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "PVM"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix() * scene.Camera->ViewMatrix() * modelJob->Matrix));
|
||||||
glUniform2fv(glGetUniformLocation(shaderSkinnedHandle, "PickingColor"), 1, glm::value_ptr(glm::vec2(pickColor[0], pickColor[1])));
|
glUniform2fv(glGetUniformLocation(shaderSkinnedHandle, "PickingColor"), 1, glm::value_ptr(glm::vec2(pickColor[0], pickColor[1])));
|
||||||
|
|
||||||
std::vector<glm::mat4> frameBones;
|
std::vector<glm::mat4> frameBones;
|
||||||
|
|||||||
@@ -156,12 +156,7 @@ void ShadowPass::InitializeShaderPrograms()
|
|||||||
m_ShadowProgram->BindFragDataLocation(0, "ShadowMap");
|
m_ShadowProgram->BindFragDataLocation(0, "ShadowMap");
|
||||||
m_ShadowProgram->Link();
|
m_ShadowProgram->Link();
|
||||||
|
|
||||||
m_ShadowProgramSkinned = ResourceManager::Load<ShaderProgram>("#ShadowProgramSkinned");
|
|
||||||
m_ShadowProgramSkinned->AddShader(std::shared_ptr<Shader>(new VertexShader("Shaders/ShadowSkinned.vert.glsl")));
|
|
||||||
m_ShadowProgramSkinned->AddShader(std::shared_ptr<Shader>(new FragmentShader("Shaders/Shadow.frag.glsl")));
|
|
||||||
m_ShadowProgramSkinned->Compile();
|
|
||||||
m_ShadowProgramSkinned->BindFragDataLocation(0, "ShadowMap");
|
|
||||||
m_ShadowProgramSkinned->Link();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShadowPass::ClearBuffer()
|
void ShadowPass::ClearBuffer()
|
||||||
@@ -217,7 +212,8 @@ void ShadowPass::Draw(RenderScene & scene)
|
|||||||
|
|
||||||
ShadowPassState* state = new ShadowPassState(m_DepthBuffer.GetHandle());
|
ShadowPassState* state = new ShadowPassState(m_DepthBuffer.GetHandle());
|
||||||
|
|
||||||
|
m_ShadowProgram->Bind();
|
||||||
|
GLuint shaderHandle = m_ShadowProgram->GetHandle();
|
||||||
glViewport(0, 0, m_ResolutionSizeWidth, m_ResolutionSizeHeight);
|
glViewport(0, 0, m_ResolutionSizeWidth, m_ResolutionSizeHeight);
|
||||||
|
|
||||||
for (int i = 0; i < m_CurrentNrOfSplits; i++) {
|
for (int i = 0; i < m_CurrentNrOfSplits; i++) {
|
||||||
@@ -225,11 +221,7 @@ void ShadowPass::Draw(RenderScene & scene)
|
|||||||
|
|
||||||
glFramebufferTextureLayer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, m_DepthMap, 0, i);
|
glFramebufferTextureLayer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, m_DepthMap, 0, i);
|
||||||
|
|
||||||
|
|
||||||
GLuint shaderHandle;
|
|
||||||
|
|
||||||
for (auto &job : scene.Jobs.DirectionalLight) {
|
for (auto &job : scene.Jobs.DirectionalLight) {
|
||||||
|
|
||||||
auto directionalLightJob = std::dynamic_pointer_cast<DirectionalLightJob>(job);
|
auto directionalLightJob = std::dynamic_pointer_cast<DirectionalLightJob>(job);
|
||||||
|
|
||||||
if (directionalLightJob) {
|
if (directionalLightJob) {
|
||||||
@@ -240,19 +232,9 @@ void ShadowPass::Draw(RenderScene & scene)
|
|||||||
//RadiusToLightspace(m_shadowFrusta[i]);
|
//RadiusToLightspace(m_shadowFrusta[i]);
|
||||||
m_LightProjection[i] = glm::ortho(m_shadowFrusta[i].LRBT[LEFT], m_shadowFrusta[i].LRBT[RIGHT], m_shadowFrusta[i].LRBT[BOTTOM], m_shadowFrusta[i].LRBT[TOP], m_NearFarPlane[NEAR], m_NearFarPlane[FAR]);
|
m_LightProjection[i] = glm::ortho(m_shadowFrusta[i].LRBT[LEFT], m_shadowFrusta[i].LRBT[RIGHT], m_shadowFrusta[i].LRBT[BOTTOM], m_shadowFrusta[i].LRBT[TOP], m_NearFarPlane[NEAR], m_NearFarPlane[FAR]);
|
||||||
|
|
||||||
|
|
||||||
m_ShadowProgram->Bind();
|
|
||||||
shaderHandle = m_ShadowProgram->GetHandle();
|
|
||||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "P"), 1, GL_FALSE, glm::value_ptr(m_LightProjection[i]));
|
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "P"), 1, GL_FALSE, glm::value_ptr(m_LightProjection[i]));
|
||||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "V"), 1, GL_FALSE, glm::value_ptr(m_LightView[i]));
|
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "V"), 1, GL_FALSE, glm::value_ptr(m_LightView[i]));
|
||||||
|
|
||||||
m_ShadowProgramSkinned->Bind();
|
|
||||||
shaderHandle = m_ShadowProgramSkinned->GetHandle();
|
|
||||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "P"), 1, GL_FALSE, glm::value_ptr(m_LightProjection[i]));
|
|
||||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "V"), 1, GL_FALSE, glm::value_ptr(m_LightView[i]));
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
GLERROR("ShadowLight ERROR");
|
GLERROR("ShadowLight ERROR");
|
||||||
|
|
||||||
for (auto &objectJob : scene.Jobs.OpaqueObjects) {
|
for (auto &objectJob : scene.Jobs.OpaqueObjects) {
|
||||||
@@ -263,23 +245,6 @@ void ShadowPass::Draw(RenderScene & scene)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(modelJob->Model->IsSkinned()) {
|
|
||||||
m_ShadowProgramSkinned->Bind();
|
|
||||||
shaderHandle = m_ShadowProgramSkinned->GetHandle();
|
|
||||||
|
|
||||||
std::vector<glm::mat4> frameBones;
|
|
||||||
if (modelJob->BlendTree != nullptr) {
|
|
||||||
frameBones = modelJob->BlendTree->GetFinalPose();
|
|
||||||
} else {
|
|
||||||
frameBones = modelJob->Skeleton->GetTPose();
|
|
||||||
}
|
|
||||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "Bones"), frameBones.size(), GL_FALSE, glm::value_ptr(frameBones[0]));
|
|
||||||
|
|
||||||
} else {
|
|
||||||
m_ShadowProgram->Bind();
|
|
||||||
shaderHandle = m_ShadowProgram->GetHandle();
|
|
||||||
}
|
|
||||||
|
|
||||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "M"), 1, GL_FALSE, glm::value_ptr(modelJob->Matrix));
|
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "M"), 1, GL_FALSE, glm::value_ptr(modelJob->Matrix));
|
||||||
glUniform1f(glGetUniformLocation(shaderHandle, "Alpha"), 1.f);
|
glUniform1f(glGetUniformLocation(shaderHandle, "Alpha"), 1.f);
|
||||||
|
|
||||||
@@ -300,23 +265,6 @@ void ShadowPass::Draw(RenderScene & scene)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (modelJob->Model->IsSkinned()) {
|
|
||||||
m_ShadowProgramSkinned->Bind();
|
|
||||||
shaderHandle = m_ShadowProgramSkinned->GetHandle();
|
|
||||||
|
|
||||||
std::vector<glm::mat4> frameBones;
|
|
||||||
if (modelJob->BlendTree != nullptr) {
|
|
||||||
frameBones = modelJob->BlendTree->GetFinalPose();
|
|
||||||
} else {
|
|
||||||
frameBones = modelJob->Skeleton->GetTPose();
|
|
||||||
}
|
|
||||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "Bones"), frameBones.size(), GL_FALSE, glm::value_ptr(frameBones[0]));
|
|
||||||
|
|
||||||
} else {
|
|
||||||
m_ShadowProgram->Bind();
|
|
||||||
shaderHandle = m_ShadowProgram->GetHandle();
|
|
||||||
}
|
|
||||||
|
|
||||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "M"), 1, GL_FALSE, glm::value_ptr(modelJob->Matrix));
|
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "M"), 1, GL_FALSE, glm::value_ptr(modelJob->Matrix));
|
||||||
glUniform1f(glGetUniformLocation(shaderHandle, "Alpha"), modelJob->Color.a);
|
glUniform1f(glGetUniformLocation(shaderHandle, "Alpha"), modelJob->Color.a);
|
||||||
|
|
||||||
|
|||||||
@@ -264,6 +264,11 @@ void PlayerMovementSystem::updateMovementControllers(double dt)
|
|||||||
size = glm::vec3(1.f, 1.f, 1.f);
|
size = glm::vec3(1.f, 1.f, 1.f);
|
||||||
} else {
|
} else {
|
||||||
size = glm::vec3(1.f, 1.6f, 1.f);
|
size = glm::vec3(1.f, 1.6f, 1.f);
|
||||||
|
if (controller->CrouchingLastFrame() && isOnGround) {
|
||||||
|
// The collision should resolve this anyway, but
|
||||||
|
// this is more reliable, since the box gets larger.
|
||||||
|
((glm::vec3&)cTransform["Position"]).y += 0.3f;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ SpectatorCameraSystem::SpectatorCameraSystem(SystemParams params)
|
|||||||
, m_PickedTeam(-1)
|
, m_PickedTeam(-1)
|
||||||
{
|
{
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_EInputCommand, &SpectatorCameraSystem::OnInputCommand);
|
EVENT_SUBSCRIBE_MEMBER(m_EInputCommand, &SpectatorCameraSystem::OnInputCommand);
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_EDisconnect, &SpectatorCameraSystem::OnDisconnect);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpectatorCameraSystem::Update(double dt)
|
void SpectatorCameraSystem::Update(double dt)
|
||||||
@@ -88,17 +87,4 @@ bool SpectatorCameraSystem::OnInputCommand(const Events::InputCommand& e)
|
|||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SpectatorCameraSystem::OnDisconnect(const Events::PlayerDisconnected& e)
|
|
||||||
{
|
|
||||||
// If local player gets disconnected, they should be set to
|
|
||||||
// the spectator camera next time a map loads that has one.
|
|
||||||
if (e.Entity == LocalPlayer.ID) {
|
|
||||||
m_CamSetToTeamPick = false;
|
|
||||||
// They will also be set to menu, so unlock mouse just in case they were in game with locked mouse.
|
|
||||||
Events::UnlockMouse unlock;
|
|
||||||
m_EventBroker->Publish(unlock);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user