Compare commits
69 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| bc3c8299e8 | |||
| dc88074f7f | |||
| db09d93111 | |||
| cc34f53b16 | |||
| fe36e8b423 | |||
| a7bff92899 | |||
| bfcf7b240e | |||
| 73b8bff1f3 | |||
| 1deb506fb2 | |||
| ae3cab6cd1 | |||
| a9b19d9af1 | |||
| cb7beae28c | |||
| 7ea26d10ee | |||
| 28e9ba1208 | |||
| f0c2fdead1 | |||
| e1ca104fc9 | |||
| 2cb4a307eb | |||
| 6507efc0db | |||
| 96a3e68bf4 | |||
| 2d438060dd | |||
| a339c61f5b | |||
| 8b81ba9019 | |||
| 7af17049e9 | |||
| 85ba5552e9 | |||
| 8b66d29adc | |||
| a9a19193ad | |||
| 0a6653d079 | |||
| cdbc348cfa | |||
| 502a290d36 | |||
| cfba8efd24 | |||
| 5a6374f013 | |||
| 1ae2f3f5f3 | |||
| 1961c16fe2 | |||
| d32a483bb4 | |||
| e23ea78aeb | |||
| 4153a31e3a | |||
| 0908be1e02 | |||
| 2ed5fad699 | |||
| 70374fa10e | |||
| 20468cba1b | |||
| 7749fc5474 | |||
| 6dd7f1a657 | |||
| 144e548b7a | |||
| 14b0a64720 | |||
| 8647267cad | |||
| ecab5de056 | |||
| 38d8cdded2 | |||
| 22c391df54 | |||
| f220d8088c | |||
| df2e4abb52 | |||
| 8867e7ac3c | |||
| 05bbecc452 | |||
| a36deb2cf9 | |||
| 73a4336206 | |||
| f2ab02d860 | |||
| bf376f54b6 | |||
| 178402e964 | |||
| 36043010af | |||
| cb77c1ff97 | |||
| 69db32337d | |||
| 6af167675d | |||
| ecd823cb9f | |||
| 847c539373 | |||
| cb7f06573f | |||
| 6542d1b444 | |||
| bbf6058c17 | |||
| 0e51ae7dc9 | |||
| c912cd7a42 | |||
| 7f1016476b |
@@ -24,7 +24,9 @@ public:
|
||||
{
|
||||
// Check if we are trying to add more than the package can fit.
|
||||
if (m_MaxPacketSize < m_Offset + sizeof(T)) {
|
||||
LOG_WARNING("Packet AddPrimitive(): You are trying to add more than we have allocated for! New size is %i bytes\n", m_MaxPacketSize*2);
|
||||
if (m_MaxPacketSize >= 32000) {
|
||||
LOG_WARNING("Package::WritePrimitive(): New size is huge %i bytes\n", m_MaxPacketSize*2);
|
||||
}
|
||||
resizeData();
|
||||
}
|
||||
memcpy(m_Data + m_Offset, &val, sizeof(T));
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
#define MiniDump_h__
|
||||
|
||||
#include <Windows.h>
|
||||
#include <DbgHelp.h>
|
||||
|
||||
void WINAPI Create_Dump(PEXCEPTION_POINTERS pException, BOOL File_Flag, BOOL Show_Flag);
|
||||
long WINAPI Create_Dump_Immediate(LPEXCEPTION_POINTERS pException);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
#ifndef AbilityCooldownHUDSystem_h__
|
||||
#define AbilityCooldownHUDSystem_h__
|
||||
|
||||
#include "../../Engine/Core/System.h"
|
||||
#include "../../Engine/GLM.h"
|
||||
|
||||
class AbilityCooldownHUDSystem : public ImpureSystem
|
||||
{
|
||||
public:
|
||||
AbilityCooldownHUDSystem(SystemParams params)
|
||||
: System(params)
|
||||
{ }
|
||||
|
||||
virtual void Update(double dt) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,19 @@
|
||||
#ifndef BoostIconsHUDSystem_h__
|
||||
#define BoostIconsHUDSystem_h__
|
||||
|
||||
#include "../../Engine/Core/System.h"
|
||||
#include "../../Engine/GLM.h"
|
||||
|
||||
class BoostIconsHUDSystem : public PureSystem
|
||||
{
|
||||
public:
|
||||
BoostIconsHUDSystem(SystemParams params)
|
||||
: System(params)
|
||||
, PureSystem("BoostIconsHUD")
|
||||
{ }
|
||||
|
||||
virtual void UpdateComponent(EntityWrapper& entity, ComponentWrapper& capturePoint, double dt) override;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -51,10 +51,12 @@
|
||||
<xs:include schemaLocation="Components/Page.xsd"/>
|
||||
<xs:include schemaLocation="Components/SpriteIndicator.xsd"/>
|
||||
<xs:include schemaLocation="Components/Button.xsd"/>
|
||||
<xs:include schemaLocation="Components/AbilityCooldownHUD.xsd"/>
|
||||
<xs:include schemaLocation="Components/DoubleJump.xsd"/>
|
||||
<xs:include schemaLocation="Components/WeaponAttachment.xsd"/>
|
||||
<xs:include schemaLocation="Components/DefenderWeapon.xsd"/>
|
||||
<xs:include schemaLocation="Components/CapturePointGameMode.xsd"/>
|
||||
<xs:include schemaLocation="Components/CapturePointArrowHUD.xsd"/>
|
||||
<xs:include schemaLocation="Components/FloatingEffect.xsd"/>
|
||||
<xs:include schemaLocation="Components/BoostIconsHUD.xsd"/>
|
||||
</xs:schema>
|
||||
@@ -0,0 +1,3 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<AbilityCooldownHUD xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="AbilityCooldownHUD.xsd">
|
||||
</AbilityCooldownHUD>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0"?>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:t="types">
|
||||
<xs:import schemaLocation="../Types.xsd" namespace="types"/>
|
||||
<xs:element name="AbilityCooldownHUD">
|
||||
<xs:annotation>
|
||||
<xs:documentation>HUD element for tracking ability cooldown. If it has a sprite and fill component it will fill the sprite with chosen color depending on the cooldown.\n A child with text component named "Cooldown"</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:element>
|
||||
</xs:schema>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<BoostIconsHUD xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="BoostIconsHUD.xsd"/>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0"?>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:t="types">
|
||||
<xs:import schemaLocation="../Types.xsd" namespace="types"/>
|
||||
|
||||
<xs:element name="BoostIconsHUD">
|
||||
<xs:annotation>
|
||||
<xs:documentation>Origin for the 3 boost states. Create 3 children with Sprite and Fill components, name them "Sprint", "Defender", "Assault"</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:element>
|
||||
</xs:schema>
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<Text xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Text.xsd">
|
||||
<Content></Content>
|
||||
<Resource></Resource>
|
||||
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||
<Color R="1" G="1" B="1" A="1"/>
|
||||
<Visible>true</Visible>
|
||||
<Alignment><Center/></Alignment>
|
||||
|
||||
@@ -100,12 +100,12 @@
|
||||
<Percentage>1</Percentage>
|
||||
<Color A="1" B="1" G="0" R="0"/>
|
||||
</c:Fill>
|
||||
<c:HealthHUD/>
|
||||
<c:Text>
|
||||
<Content>100/100</Content>
|
||||
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||
<Color A="0.505882382" B="3.92156863" G="1.17647064" R="0"/>
|
||||
</c:Text>
|
||||
<c:HealthHUD/>
|
||||
<c:Transform>
|
||||
<Position X="-0.355000019" Y="-0.203000009" Z="0.0410000011"/>
|
||||
<Scale X="0.0350000001" Y="0.0350000001" Z="0.0350000001"/>
|
||||
@@ -132,7 +132,70 @@
|
||||
<Orientation X="5.87300014" Y="0" Z="4.71200037"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
<Children>
|
||||
<Entity name="BoostIcons">
|
||||
<Components>
|
||||
<c:BoostIconsHUD/>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity name="Assault">
|
||||
<Components>
|
||||
<c:Fill>
|
||||
<Color A="1" B="0.533333361" G="1" R="0.329411775"/>
|
||||
</c:Fill>
|
||||
<c:Sprite>
|
||||
<DiffuseTexture>Textures/Core/White.png</DiffuseTexture>
|
||||
<DepthSort>false</DepthSort>
|
||||
<GlowMap></GlowMap>
|
||||
<Color A="0.588235319" B="0.0392156877" G="0.184313729" R="0"/>
|
||||
</c:Sprite>
|
||||
<c:Transform>
|
||||
<Position X="0.225000009" Y="0.168000013" Z="0"/>
|
||||
<Scale X="0.27700001" Y="0.100000001" Z="0.200000003"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity name="Defender">
|
||||
<Components>
|
||||
<c:Fill>
|
||||
<Color A="1" B="1" G="0.58431375" R="0.105882354"/>
|
||||
</c:Fill>
|
||||
<c:Sprite>
|
||||
<DiffuseTexture>Textures/Core/White.png</DiffuseTexture>
|
||||
<DepthSort>false</DepthSort>
|
||||
<GlowMap></GlowMap>
|
||||
<Color A="0.588235319" B="0.34117648" G="0.192156866" R="0"/>
|
||||
</c:Sprite>
|
||||
<c:Transform>
|
||||
<Position X="0.224999994" Y="0.27700001" Z="0"/>
|
||||
<Scale X="0.27700001" Y="0.100000001" Z="0.200000003"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity name="Sniper">
|
||||
<Components>
|
||||
<c:Fill>
|
||||
<Color A="1" B="0.345098048" G="0" R="1"/>
|
||||
</c:Fill>
|
||||
<c:Sprite>
|
||||
<DiffuseTexture>Textures/Core/White.png</DiffuseTexture>
|
||||
<DepthSort>false</DepthSort>
|
||||
<GlowMap></GlowMap>
|
||||
<Color A="0.588235319" B="0.121568628" G="0" R="0.443137258"/>
|
||||
</c:Sprite>
|
||||
<c:Transform>
|
||||
<Position X="0.225000009" Y="0.38500002" Z="0"/>
|
||||
<Scale X="0.27700001" Y="0.100000001" Z="0.200000003"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
@@ -196,7 +259,6 @@
|
||||
<CapturePointNumber>3</CapturePointNumber>
|
||||
</c:CapturePointHUD>
|
||||
<c:Fill>
|
||||
<Percentage>0.80222018197612788</Percentage>
|
||||
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
|
||||
</c:Fill>
|
||||
<c:Sprite>
|
||||
@@ -231,6 +293,7 @@
|
||||
<CapturePointNumber>4</CapturePointNumber>
|
||||
</c:CapturePointHUD>
|
||||
<c:Fill>
|
||||
<Percentage>1</Percentage>
|
||||
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
|
||||
</c:Fill>
|
||||
<c:Sprite>
|
||||
@@ -286,7 +349,7 @@
|
||||
<c:Sprite>
|
||||
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||
<GlowMap></GlowMap>
|
||||
<Color A="0.699999988" B="0" G="0.200000003" R="1"/>
|
||||
<Color A="0.699999988" B="0" G="0" R="1"/>
|
||||
</c:Sprite>
|
||||
<c:Transform>
|
||||
<Position X="-1.58304751" Y="0.919596612" Z="0"/>
|
||||
@@ -297,7 +360,8 @@
|
||||
<Components>
|
||||
<c:CapturePointHUD/>
|
||||
<c:Fill>
|
||||
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
|
||||
<Percentage>1</Percentage>
|
||||
<Color A="0.699999988" B="0" G="0" R="1"/>
|
||||
</c:Fill>
|
||||
<c:Sprite>
|
||||
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
||||
@@ -306,7 +370,7 @@
|
||||
<c:Transform>
|
||||
<Position X="0" Y="0" Z="0.00999999978"/>
|
||||
<Scale X="0.800000012" Y="0.800000012" Z="0.800000012"/>
|
||||
<Orientation X="0" Y="0" Z="1.57079637"/>
|
||||
<Orientation X="0" Y="0" Z="4.71238899"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
@@ -369,6 +433,25 @@
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
<Entity name="CapturePointArrow">
|
||||
<Components>
|
||||
<c:CapturePointArrowHUD/>
|
||||
<c:Model>
|
||||
<Resource>Models/Widgets/Arrows/Arrow5.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Team>
|
||||
<Team>
|
||||
<Blue/>
|
||||
</Team>
|
||||
</c:Team>
|
||||
<c:Transform>
|
||||
<Position X="0" Y="0.714000046" Z="-1.30000007"/>
|
||||
<Scale X="0.200000003" Y="0.200000003" Z="0.200000003"/>
|
||||
<Orientation X="0.405680239" Y="0.369605929" Z="0"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
<Entity name="Hands">
|
||||
|
||||
@@ -51,8 +51,10 @@
|
||||
<xs:element ref="c:Page" minOccurs="0"/>
|
||||
<xs:element ref="c:Button" minOccurs="0"/>
|
||||
<xs:element ref="c:WeaponAttachment" minOccurs="0"/>
|
||||
<xs:element ref="c:AbilityCooldownHUD" minOccurs="0"/>
|
||||
<xs:element ref="c:DefenderWeapon" minOccurs="0"/>
|
||||
<xs:element ref="c:CapturePointArrowHUD" minOccurs="0"/>
|
||||
<xs:element ref="c:BoostIconsHUD" minOccurs="0"/>
|
||||
<xs:element ref="c:FloatingEffect" minOccurs="0"/>
|
||||
<xs:element ref="c:AmmoPickup" minOccurs="0"/>
|
||||
<xs:element ref="c:HealthPickup" minOccurs="0"/>
|
||||
|
||||
@@ -17,105 +17,107 @@ void CollisionSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper& c
|
||||
EntityAABB& boxA = *boundingBox;
|
||||
bool everHitTheGround = false;
|
||||
|
||||
auto prevPosIt = m_PrevPositions.find(entity);
|
||||
if (prevPosIt != m_PrevPositions.end()) {
|
||||
glm::vec3 size = boxA.Size();
|
||||
float diameter = std::min(size.x, size.z);
|
||||
glm::vec3 prevOrigin = prevPosIt->second;
|
||||
glm::vec3 toCurrentPos = boxA.Origin() - prevOrigin;
|
||||
float rayLength = glm::length(toCurrentPos) + 0.5f*diameter;
|
||||
//If the entity has moved farther than the size of its box, we need to handle it specially.
|
||||
if (rayLength > diameter) {
|
||||
Ray ray(prevOrigin, toCurrentPos);
|
||||
m_OctreeResult.clear();
|
||||
m_Octree->ObjectsPossiblyHitByRay(ray, m_OctreeResult);
|
||||
for (auto& boxB : m_OctreeResult) {
|
||||
if (boxA.Entity == boxB.Entity) {
|
||||
continue;
|
||||
}
|
||||
bool hit;
|
||||
float dist;
|
||||
if (boxB.Entity.HasComponent("Model")) {
|
||||
RawModel* model;
|
||||
std::string res = (std::string)boxB.Entity["Model"]["Resource"];
|
||||
try {
|
||||
model = ResourceManager::Load<RawModel, true>(res);
|
||||
} catch (const std::exception&) {
|
||||
if (entity == LocalPlayer) {
|
||||
auto prevPosIt = m_PrevPositions.find(entity);
|
||||
if (prevPosIt != m_PrevPositions.end()) {
|
||||
glm::vec3 size = boxA.Size();
|
||||
float diameter = std::min(size.x, size.z);
|
||||
glm::vec3 prevOrigin = prevPosIt->second;
|
||||
glm::vec3 toCurrentPos = boxA.Origin() - prevOrigin;
|
||||
float rayLength = glm::length(toCurrentPos) + 0.5f*diameter;
|
||||
//If the entity has moved farther than the size of its box, we need to handle it specially.
|
||||
if (rayLength > diameter) {
|
||||
Ray ray(prevOrigin, toCurrentPos);
|
||||
m_OctreeResult.clear();
|
||||
m_Octree->ObjectsPossiblyHitByRay(ray, m_OctreeResult);
|
||||
for (auto& boxB : m_OctreeResult) {
|
||||
if (boxA.Entity == boxB.Entity) {
|
||||
continue;
|
||||
}
|
||||
float u, v;
|
||||
hit = Collision::RayVsModel(ray, model->Vertices(), model->m_Indices, Transform::ModelMatrix(boxB.Entity), dist, u, v);
|
||||
} else {
|
||||
hit = Collision::RayVsAABB(ray, boxB, dist);
|
||||
}
|
||||
if (hit && dist < rayLength) {
|
||||
//Set the entity to where it was colliding, minus the maximum box size.
|
||||
//TODO: Perhaps this should be done slightly more properly.
|
||||
glm::vec3 newOriginPos = ray.Origin() + (dist - 0.707107f*diameter) * ray.Direction();
|
||||
glm::vec3 resolve = newOriginPos - boxA.Origin();
|
||||
(glm::vec3&)cTransform["Position"] += resolve;
|
||||
boxA = *Collision::EntityAbsoluteAABB(entity);
|
||||
if (resolve.y > 0) {
|
||||
everHitTheGround = true;
|
||||
(bool)cPhysics["IsOnGround"] = true;
|
||||
((glm::vec3&)cPhysics["Velocity"]).y = 0.f;
|
||||
bool hit;
|
||||
float dist;
|
||||
if (boxB.Entity.HasComponent("Model")) {
|
||||
RawModel* model;
|
||||
std::string res = (std::string)boxB.Entity["Model"]["Resource"];
|
||||
try {
|
||||
model = ResourceManager::Load<RawModel, true>(res);
|
||||
} catch (const std::exception&) {
|
||||
continue;
|
||||
}
|
||||
float u, v;
|
||||
hit = Collision::RayVsModel(ray, model->Vertices(), model->m_Indices, Transform::ModelMatrix(boxB.Entity), dist, u, v);
|
||||
} else {
|
||||
hit = Collision::RayVsAABB(ray, boxB, dist);
|
||||
}
|
||||
if (hit && dist < rayLength) {
|
||||
//Set the entity to where it was colliding, minus the maximum box size.
|
||||
//TODO: Perhaps this should be done slightly more properly.
|
||||
glm::vec3 newOriginPos = ray.Origin() + (dist - 0.707107f*diameter) * ray.Direction();
|
||||
glm::vec3 resolve = newOriginPos - boxA.Origin();
|
||||
(glm::vec3&)cTransform["Position"] += resolve;
|
||||
boxA = *Collision::EntityAbsoluteAABB(entity);
|
||||
if (resolve.y > 0) {
|
||||
everHitTheGround = true;
|
||||
(bool)cPhysics["IsOnGround"] = true;
|
||||
((glm::vec3&)cPhysics["Velocity"]).y = 0.f;
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Collide against octree items
|
||||
m_OctreeResult.clear();
|
||||
m_Octree->ObjectsInSameRegion(*boundingBox, m_OctreeResult);
|
||||
for (auto& boxB : m_OctreeResult) {
|
||||
glm::vec3 resolutionVector;
|
||||
if (boxA.Entity == boxB.Entity) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (boxB.Entity.HasComponent("Model") && Collision::AABBVsAABB(boxA, boxB)) {
|
||||
//Here we know boxB is a entity with Collideable, AABB, and Model.
|
||||
RawModel* model;
|
||||
try {
|
||||
model = ResourceManager::Load<RawModel, true>(boxB.Entity["Model"]["Resource"]);
|
||||
} catch (const std::exception&) {
|
||||
// Collide against octree items
|
||||
m_OctreeResult.clear();
|
||||
m_Octree->ObjectsInSameRegion(*boundingBox, m_OctreeResult);
|
||||
for (auto& boxB : m_OctreeResult) {
|
||||
glm::vec3 resolutionVector;
|
||||
if (boxA.Entity == boxB.Entity) {
|
||||
continue;
|
||||
}
|
||||
|
||||
glm::mat4 modelMatrix = Transform::ModelMatrix(boxB.Entity);
|
||||
if (boxB.Entity.HasComponent("Model") && Collision::AABBVsAABB(boxA, boxB)) {
|
||||
//Here we know boxB is a entity with Collideable, AABB, and Model.
|
||||
RawModel* model;
|
||||
try {
|
||||
model = ResourceManager::Load<RawModel, true>(boxB.Entity["Model"]["Resource"]);
|
||||
} catch (const std::exception&) {
|
||||
continue;
|
||||
}
|
||||
|
||||
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"];
|
||||
float verticalStepHeight = (float)(double)cPhysics["VerticalStepHeight"];
|
||||
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.
|
||||
(glm::vec3&)cTransform["Position"] += notMovingxz ? prevPosIt->second - boxA.Origin() : resolutionVector;
|
||||
glm::mat4 modelMatrix = Transform::ModelMatrix(boxB.Entity);
|
||||
|
||||
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"];
|
||||
float verticalStepHeight = (float)(double)cPhysics["VerticalStepHeight"];
|
||||
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.
|
||||
(glm::vec3&)cTransform["Position"] += notMovingxz ? prevPosIt->second - boxA.Origin() : resolutionVector;
|
||||
boxA = *Collision::EntityAbsoluteAABB(entity);
|
||||
cPhysics["Velocity"] = inOutVelocity;
|
||||
if (isOnGround) {
|
||||
everHitTheGround = true;
|
||||
(bool)cPhysics["IsOnGround"] = true;
|
||||
}
|
||||
}
|
||||
} else if (Collision::AABBVsAABB(boxA, boxB, resolutionVector)) {
|
||||
//Enter here if boxB has no Model.
|
||||
(glm::vec3&)cTransform["Position"] += resolutionVector;
|
||||
boxA = *Collision::EntityAbsoluteAABB(entity);
|
||||
cPhysics["Velocity"] = inOutVelocity;
|
||||
if (isOnGround) {
|
||||
if (resolutionVector.y > 0) {
|
||||
everHitTheGround = true;
|
||||
(bool)cPhysics["IsOnGround"] = true;
|
||||
((glm::vec3&)cPhysics["Velocity"]).y = 0.f;
|
||||
}
|
||||
}
|
||||
} else if (Collision::AABBVsAABB(boxA, boxB, resolutionVector)) {
|
||||
//Enter here if boxB has no Model.
|
||||
(glm::vec3&)cTransform["Position"] += resolutionVector;
|
||||
boxA = *Collision::EntityAbsoluteAABB(entity);
|
||||
if (resolutionVector.y > 0) {
|
||||
everHitTheGround = true;
|
||||
(bool)cPhysics["IsOnGround"] = true;
|
||||
((glm::vec3&)cPhysics["Velocity"]).y = 0.f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//This should apply air friction and such, iff zero models were hit.
|
||||
if (!everHitTheGround) {
|
||||
(bool)cPhysics["IsOnGround"] = false;
|
||||
}
|
||||
//This should apply air friction and such, iff zero models were hit.
|
||||
if (!everHitTheGround) {
|
||||
(bool)cPhysics["IsOnGround"] = false;
|
||||
}
|
||||
|
||||
m_PrevPositions[entity] = boxA.Origin();
|
||||
m_PrevPositions[entity] = boxA.Origin();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,18 +49,24 @@ void Packet::WriteString(const std::string& str)
|
||||
// Message, add one extra byte for null terminator
|
||||
size_t sizeOfString = str.size() + 1;
|
||||
if (m_Offset + sizeOfString > m_MaxPacketSize) {
|
||||
//LOG_WARNING("Package::WriteString(): Data size in packet exceeded maximum package size. New size is %i bytes\n", m_MaxPacketSize*2);
|
||||
if (m_MaxPacketSize >= 32000) {
|
||||
LOG_WARNING("Package::WriteString(): New size is huge %i bytes\n", m_MaxPacketSize*2);
|
||||
}
|
||||
resizeData();
|
||||
}
|
||||
memcpy(m_Data + m_Offset, str.data(), sizeOfString * sizeof(char));
|
||||
m_Offset += sizeOfString * sizeof(char);
|
||||
memcpy(m_Data + m_Offset, str.data(), str.size() * sizeof(char));
|
||||
m_Offset += str.size() * sizeof(char);
|
||||
m_Data[m_Offset] = '\0';
|
||||
m_Offset += 1;
|
||||
}
|
||||
|
||||
void Packet::WriteData(char * data, int sizeOfData)
|
||||
{
|
||||
|
||||
if (m_Offset + sizeOfData > m_MaxPacketSize) {
|
||||
//LOG_WARNING("Packet::WriteData(): Data size in packet exceeded maximum packet size. New size is %i bytes\n", m_MaxPacketSize*2);
|
||||
if (m_MaxPacketSize >= 32000) {
|
||||
LOG_WARNING("Package::WriteData(): New size is huge %i bytes\n", m_MaxPacketSize*2);
|
||||
}
|
||||
while (m_Offset + sizeOfData > m_MaxPacketSize) {
|
||||
resizeData();
|
||||
}
|
||||
|
||||
@@ -74,7 +74,10 @@ size_t TCPClient::readBuffer()
|
||||
boost::asio::ip::tcp::socket::message_peek, error);
|
||||
unsigned int sizeOfPacket = 0;
|
||||
memcpy(&sizeOfPacket, m_ReadBuffer, sizeof(int));
|
||||
|
||||
if (sizeOfPacket > m_Socket->available()) {
|
||||
LOG_WARNING("TCPClient::readBuffer(): We haven't got the whole packet yet.");
|
||||
return 0;
|
||||
}
|
||||
// if the buffer is to small increase the size of it
|
||||
// TODO if message is huge 1 time the buffer will not decrease.
|
||||
if (sizeOfPacket > m_BufferSize) {
|
||||
|
||||
@@ -106,7 +106,10 @@ int TCPServer::readBuffer(PlayerDefinition & playerDefinition)
|
||||
boost::asio::ip::tcp::socket::message_peek, error);
|
||||
unsigned int sizeOfPacket = 0;
|
||||
memcpy(&sizeOfPacket, m_ReadBuffer, sizeof(int));
|
||||
|
||||
if (sizeOfPacket > playerDefinition.TCPSocket->available()) {
|
||||
LOG_WARNING("TCPServer::readBuffer(): We haven't got the whole packet yet.");
|
||||
return 0;
|
||||
}
|
||||
// if the buffer is to small increase the size of it
|
||||
if (sizeOfPacket > m_BufferSize) {
|
||||
delete[] m_ReadBuffer;
|
||||
|
||||
@@ -45,7 +45,10 @@ int UDPClient::readBuffer()
|
||||
boost::asio::ip::udp::socket::message_peek, error);
|
||||
int sizeOfPacket = 0;
|
||||
memcpy(&sizeOfPacket, m_ReadBuffer, sizeof(int));
|
||||
|
||||
if (sizeOfPacket > m_Socket->available()) {
|
||||
LOG_WARNING("UDPClient::readBuffer(): We haven't got the whole packet yet.");
|
||||
return 0;
|
||||
}
|
||||
// if the buffer is to small increase the size of it
|
||||
if (sizeOfPacket > m_BufferSize) {
|
||||
delete[] m_ReadBuffer;
|
||||
|
||||
@@ -92,6 +92,11 @@ int UDPServer::readBuffer()
|
||||
unsigned int sizeOfPacket = 0;
|
||||
memcpy(&sizeOfPacket, m_ReadBuffer, sizeof(int));
|
||||
|
||||
if (sizeOfPacket > m_Socket->available()) {
|
||||
LOG_WARNING("UDPServer::readBuffer(): We haven't got the whole packet yet.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
// if the buffer is to small increase the size of it
|
||||
if (sizeOfPacket > m_BufferSize) {
|
||||
delete[] m_ReadBuffer;
|
||||
|
||||
@@ -27,9 +27,11 @@
|
||||
#include "Rendering/AnimationSystem.h"
|
||||
#include "Network/MultiplayerSnapshotFilter.h"
|
||||
#include "Game/Systems/AmmunitionHUDSystem.h"
|
||||
#include "Game/Systems/AbilityCooldownHUDSystem.h"
|
||||
#include "Game/Systems/CapturePointArrowHUDSystem.h"
|
||||
#include "Game/Systems/KillFeedSystem.h"
|
||||
#include "Game/Systems/BoostSystem.h"
|
||||
#include "Game/Systems/BoostIconsHUDSystem.h"
|
||||
#include "GUI/ButtonSystem.h"
|
||||
#include "GUI/MainMenuSystem.h"
|
||||
|
||||
@@ -134,6 +136,7 @@ Game::Game(int argc, char* argv[])
|
||||
m_SystemPipeline->AddSystem<AmmoPickupSystem>(updateOrderLevel);
|
||||
m_SystemPipeline->AddSystem<DamageIndicatorSystem>(updateOrderLevel);
|
||||
m_SystemPipeline->AddSystem<AmmunitionHUDSystem>(updateOrderLevel);
|
||||
m_SystemPipeline->AddSystem<AbilityCooldownHUDSystem>(updateOrderLevel);
|
||||
m_SystemPipeline->AddSystem<CapturePointArrowHUDSystem>(updateOrderLevel);
|
||||
m_SystemPipeline->AddSystem<KillFeedSystem>(updateOrderLevel);
|
||||
m_SystemPipeline->AddSystem<LifetimeSystem>(updateOrderLevel);
|
||||
@@ -147,6 +150,7 @@ Game::Game(int argc, char* argv[])
|
||||
m_SystemPipeline->AddSystem<BoostSystem>(updateOrderLevel);
|
||||
m_SystemPipeline->AddSystem<ButtonSystem>(updateOrderLevel, m_Renderer);
|
||||
m_SystemPipeline->AddSystem<MainMenuSystem>(updateOrderLevel, m_Renderer);
|
||||
m_SystemPipeline->AddSystem<BoostIconsHUDSystem>(updateOrderLevel);
|
||||
// Populate Octree with collidables
|
||||
++updateOrderLevel;
|
||||
m_SystemPipeline->AddSystem<FillOctreeSystem>(updateOrderLevel, m_OctreeCollision, "Collidable");
|
||||
|
||||
+71
-80
@@ -1,110 +1,101 @@
|
||||
/*
|
||||
Author: Vladimir Sedach.
|
||||
Inspired by Original Author: Vladimir Sedach.
|
||||
|
||||
Purpose: demo of Call Stack creation by our own means,
|
||||
and with MiniDumpWriteDump() function of DbgHelp.dll.
|
||||
Purpose: demo of Call Stack creation by our own means,
|
||||
and with MiniDumpWriteDump() function of DbgHelp.dll.
|
||||
*/
|
||||
|
||||
#include "MiniDump.h"
|
||||
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <ctime>
|
||||
#include <comdef.h>
|
||||
|
||||
#include <windows.h>
|
||||
#include <tlhelp32.h>
|
||||
//#include "dbghelp.h"
|
||||
#pragma optimize("y", off) //generate stack frame pointers for all functions - same as /Oy- in the project
|
||||
#pragma warning(disable: 4200) //nonstandard extension used : zero-sized array in struct/union
|
||||
#pragma warning(disable: 4100) //unreferenced formal parameter
|
||||
|
||||
//#define DEBUG_DPRINTF 1 //allow d()
|
||||
//#include "wfun.h"
|
||||
|
||||
#pragma optimize("y", off) //generate stack frame pointers for all functions - same as /Oy- in the project
|
||||
#pragma warning(disable: 4200) //nonstandard extension used : zero-sized array in struct/union
|
||||
#pragma warning(disable: 4100) //unreferenced formal parameter
|
||||
|
||||
// In case you don't have dbghelp.h.
|
||||
#ifndef _DBGHELP_
|
||||
|
||||
typedef struct _MINIDUMP_EXCEPTION_INFORMATION {
|
||||
DWORD ThreadId;
|
||||
PEXCEPTION_POINTERS ExceptionPointers;
|
||||
BOOL ClientPointers;
|
||||
} MINIDUMP_EXCEPTION_INFORMATION, *PMINIDUMP_EXCEPTION_INFORMATION;
|
||||
|
||||
typedef enum _MINIDUMP_TYPE {
|
||||
MiniDumpNormal = 0x00000000,
|
||||
MiniDumpWithDataSegs = 0x00000001,
|
||||
} MINIDUMP_TYPE;
|
||||
|
||||
typedef BOOL (WINAPI * MINIDUMP_WRITE_DUMP)(
|
||||
IN HANDLE hProcess,
|
||||
IN DWORD ProcessId,
|
||||
IN HANDLE hFile,
|
||||
IN MINIDUMP_TYPE DumpType,
|
||||
IN CONST PMINIDUMP_EXCEPTION_INFORMATION ExceptionParam, OPTIONAL
|
||||
IN PVOID UserStreamParam, OPTIONAL
|
||||
IN PVOID CallbackParam OPTIONAL
|
||||
);
|
||||
|
||||
#else
|
||||
|
||||
typedef BOOL (WINAPI * MINIDUMP_WRITE_DUMP)(
|
||||
IN HANDLE hProcess,
|
||||
IN DWORD ProcessId,
|
||||
IN HANDLE hFile,
|
||||
IN MINIDUMP_TYPE DumpType,
|
||||
IN CONST PMINIDUMP_EXCEPTION_INFORMATION ExceptionParam, OPTIONAL
|
||||
IN PMINIDUMP_USER_STREAM_INFORMATION UserStreamParam, OPTIONAL
|
||||
IN PMINIDUMP_CALLBACK_INFORMATION CallbackParam OPTIONAL
|
||||
);
|
||||
#endif //#ifndef _DBGHELP_
|
||||
|
||||
HMODULE hDbgHelp;
|
||||
MINIDUMP_WRITE_DUMP MiniDumpWriteDump_;
|
||||
|
||||
// Tool Help functions.
|
||||
typedef HANDLE (WINAPI * CREATE_TOOL_HELP32_SNAPSHOT)(DWORD dwFlags, DWORD th32ProcessID);
|
||||
typedef BOOL(WINAPI * MINIDUMP_WRITE_DUMP)(
|
||||
IN HANDLE hProcess,
|
||||
IN DWORD ProcessId,
|
||||
IN HANDLE hFile,
|
||||
IN MINIDUMP_TYPE DumpType,
|
||||
IN CONST PMINIDUMP_EXCEPTION_INFORMATION ExceptionParam, OPTIONAL
|
||||
IN PVOID UserStreamParam, OPTIONAL
|
||||
IN PVOID CallbackParam OPTIONAL
|
||||
);
|
||||
|
||||
//*************************************************************************************
|
||||
void WINAPI Create_Dump(PEXCEPTION_POINTERS pException, BOOL File_Flag, BOOL Show_Flag)
|
||||
long WINAPI Create_Dump_Immediate(LPEXCEPTION_POINTERS pException)
|
||||
//*************************************************************************************
|
||||
// Create dump.
|
||||
// pException can be either GetExceptionInformation() or NULL.
|
||||
// If File_Flag = TRUE - write dump files (.dmz and .dmp) with the name of the current process.
|
||||
// If Show_Flag = TRUE - show message with Get_Exception_Info() dump.
|
||||
{
|
||||
// Try to get MiniDumpWriteDump() address.
|
||||
hDbgHelp = LoadLibrary("DBGHELP.DLL");
|
||||
MiniDumpWriteDump_ = (MINIDUMP_WRITE_DUMP)GetProcAddress(hDbgHelp, "MiniDumpWriteDump");
|
||||
HMODULE hDbgHelp = LoadLibrary("DBGHELP.DLL");
|
||||
MINIDUMP_WRITE_DUMP MiniDumpWriteDump_ = (MINIDUMP_WRITE_DUMP)GetProcAddress(hDbgHelp, "MiniDumpWriteDump");
|
||||
|
||||
// If MiniDumpWriteDump() of DbgHelp.dll available.
|
||||
if (MiniDumpWriteDump_)
|
||||
{
|
||||
HANDLE hDump_File;
|
||||
CHAR Dump_Path[MAX_PATH];
|
||||
// If MiniDumpWriteDump() of DbgHelp.dll available.
|
||||
if (MiniDumpWriteDump_) {
|
||||
// Get absolute path of current process: C:/ ... /name.exe
|
||||
CHAR Dump_Path[MAX_PATH];
|
||||
GetModuleFileName(NULL, Dump_Path, sizeof(Dump_Path));
|
||||
std::string path(Dump_Path);
|
||||
|
||||
GetModuleFileName(NULL, Dump_Path, sizeof(Dump_Path)); //path of current process
|
||||
// Get current time in a string.
|
||||
std::time_t t = std::time(NULL);
|
||||
char tStr[16];
|
||||
std::strftime(tStr, 32, " %a %H-%M-%S", std::localtime(&t));
|
||||
std::strftime(tStr, ARRAYSIZE(tStr), " %a %H-%M-%S", std::localtime(&t));
|
||||
std::string time(tStr);
|
||||
std::string path(Dump_Path);
|
||||
// Remove the .exe from path
|
||||
path = path.substr(0, path.length() - 4);
|
||||
path += time + ".dmp";
|
||||
// Add the current time and .dmp
|
||||
path += "dump" + time + ".dmp";
|
||||
|
||||
MINIDUMP_EXCEPTION_INFORMATION M;
|
||||
M.ThreadId = GetCurrentThreadId();
|
||||
M.ExceptionPointers = pException;
|
||||
M.ClientPointers = 0;
|
||||
DWORD procId = GetCurrentProcessId();
|
||||
DWORD threadId = GetCurrentThreadId();
|
||||
|
||||
hDump_File = CreateFile(path.c_str(), GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
MINIDUMP_EXCEPTION_INFORMATION M;
|
||||
M.ThreadId = threadId;
|
||||
M.ExceptionPointers = pException;
|
||||
M.ClientPointers = TRUE;
|
||||
|
||||
MiniDumpWriteDump_(GetCurrentProcess(), GetCurrentProcessId(), hDump_File,
|
||||
MiniDumpNormal, (pException) ? &M : NULL, NULL, NULL);
|
||||
HANDLE hDump_File = CreateFile(path.c_str(), GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
HANDLE process = GetCurrentProcess();
|
||||
|
||||
CloseHandle(hDump_File);
|
||||
BOOL result = MiniDumpWriteDump_(process, procId, hDump_File
|
||||
, (MINIDUMP_TYPE)(MiniDumpWithDataSegs |
|
||||
MiniDumpWithHandleData |
|
||||
MiniDumpScanMemory |
|
||||
MiniDumpWithUnloadedModules |
|
||||
MiniDumpWithIndirectlyReferencedMemory |
|
||||
MiniDumpWithPrivateReadWriteMemory |
|
||||
MiniDumpWithFullMemoryInfo |
|
||||
MiniDumpWithThreadInfo |
|
||||
MiniDumpIgnoreInaccessibleMemory)
|
||||
, &M, NULL, NULL);
|
||||
HRESULT error = (HRESULT)GetLastError();
|
||||
|
||||
std::cout << "Memory dumped to: \"" << path.c_str() << "\"";
|
||||
MessageBox(NULL, ("Application crashed, memory dumped to: " + path).c_str(), "MiniDump", MB_ICONHAND | MB_OK);
|
||||
CloseHandle(hDump_File);
|
||||
if (!result) {
|
||||
_com_error cErr(error);
|
||||
HRESULT actualErrorCode = error & 0xFFFF;
|
||||
char hexErrBuf[16];
|
||||
std::sprintf(hexErrBuf, "0x%x", actualErrorCode);
|
||||
std::cout << "Bad memory dump at: \"" << path.c_str() << "\"" << std::endl
|
||||
<< "because MiniDumpWriteDump failed with error #" << actualErrorCode << " (" << hexErrBuf << "): \"" << cErr.ErrorMessage() << "\"" << std::endl;
|
||||
MessageBox(NULL, "Application crashed, memory dump failed, but file was created.", "MiniDump", MB_ICONHAND | MB_OK);
|
||||
} else {
|
||||
std::cout << "Memory dumped to: \"" << path.c_str() << "\"" << std::endl;
|
||||
MessageBox(NULL, ("Application crashed, memory dumped to: " + path).c_str(), "MiniDump", MB_ICONHAND | MB_OK);
|
||||
}
|
||||
} else {
|
||||
MessageBox(NULL, "Application crashed, memory dump failed.", "MiniDump", MB_ICONHAND | MB_OK);
|
||||
std::cout << "Memory dump failed because MiniDumpWriteDump is not available." << std::endl;
|
||||
MessageBox(NULL, "Application crashed, could not create a memory dump.", "MiniDump", MB_ICONHAND | MB_OK);
|
||||
}
|
||||
|
||||
// Basically, terminate the application.
|
||||
return EXCEPTION_EXECUTE_HANDLER;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
#include "Game/Systems/AbilityCooldownHUDSystem.h"
|
||||
|
||||
void AbilityCooldownHUDSystem::Update(double dt)
|
||||
{
|
||||
//HUD element for tracking cooldown on the parent entity with Dashability TODO: Make sure it support other abilities when they are made.
|
||||
|
||||
auto abilityHUDs = m_World->GetComponents("AbilityCooldownHUD");
|
||||
if (abilityHUDs == nullptr)
|
||||
return;
|
||||
|
||||
for (auto& abilityHUDC : *abilityHUDs) {
|
||||
EntityWrapper entity = EntityWrapper(m_World, abilityHUDC.EntityID);
|
||||
EntityWrapper abilityEntity = entity.FirstParentWithComponent("DashAbility");
|
||||
if (!abilityEntity.Valid())
|
||||
return;
|
||||
EntityWrapper cooldownTextEntity = entity.FirstChildByName("Cooldown");
|
||||
if(cooldownTextEntity.Valid()) {
|
||||
if(cooldownTextEntity.HasComponent("Text"))
|
||||
{
|
||||
double maxAbilityCD = (double)abilityEntity["DashAbility"]["CoolDownMaxTimer"];
|
||||
double currentAbilityCD = (double)abilityEntity["DashAbility"]["CoolDownTimer"];
|
||||
currentAbilityCD = currentAbilityCD >= 0.0 ? currentAbilityCD : 0.0;
|
||||
std::string t = (std::string&)cooldownTextEntity["Text"]["Content"] = std::to_string(currentAbilityCD).substr(0, 3);
|
||||
if(entity.HasComponent("Fill")) {
|
||||
entity["Fill"]["Percentage"] = currentAbilityCD/maxAbilityCD; //TODO: current time needs to be in the component.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
#include "Game/Systems/BoostIconsHUDSystem.h"
|
||||
|
||||
void BoostIconsHUDSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper& capturePoint, double dt)
|
||||
{
|
||||
EntityWrapper assaultEntity = entity.FirstChildByName("Assault");
|
||||
EntityWrapper defenderEntity = entity.FirstChildByName("Defender");
|
||||
EntityWrapper sniperEntity = entity.FirstChildByName("Sniper");
|
||||
|
||||
if(assaultEntity.Valid()) {
|
||||
if (assaultEntity.HasComponent("Fill")) {
|
||||
EntityWrapper parentWithAssaultBoost = assaultEntity.FirstParentWithComponent("BoostAssault");
|
||||
if (parentWithAssaultBoost.Valid()) {
|
||||
(double&)assaultEntity["Fill"]["Percentage"] = 1.0;
|
||||
} else {
|
||||
(double&)assaultEntity["Fill"]["Percentage"] = 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (defenderEntity.Valid()) {
|
||||
if (defenderEntity.HasComponent("Fill")) {
|
||||
EntityWrapper parentWithAssaultBoost = defenderEntity.FirstParentWithComponent("BoostDefender");
|
||||
if (parentWithAssaultBoost.Valid()) {
|
||||
(double&)defenderEntity["Fill"]["Percentage"] = 1.0;
|
||||
} else {
|
||||
(double&)defenderEntity["Fill"]["Percentage"] = 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (sniperEntity.Valid()) {
|
||||
if (sniperEntity.HasComponent("Fill")) {
|
||||
EntityWrapper parentWithAssaultBoost = sniperEntity.FirstParentWithComponent("BoostSniper");
|
||||
if (parentWithAssaultBoost.Valid()) {
|
||||
(double&)sniperEntity["Fill"]["Percentage"] = 1.0;
|
||||
} else {
|
||||
(double&)sniperEntity["Fill"]["Percentage"] = 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,14 +18,9 @@ PlayerMovementSystem::~PlayerMovementSystem()
|
||||
void PlayerMovementSystem::Update(double dt)
|
||||
{
|
||||
updateMovementControllers(dt);
|
||||
if (IsServer) {
|
||||
for (auto& kv : m_PlayerInputControllers) {
|
||||
updateVelocity(kv.first, dt);
|
||||
}
|
||||
} else {
|
||||
if (LocalPlayer.Valid()) {
|
||||
updateVelocity(LocalPlayer, dt);
|
||||
}
|
||||
// Only do physics calculations on client and only for themselves.
|
||||
if (IsClient && LocalPlayer.Valid()) {
|
||||
updateVelocity(LocalPlayer, dt);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+4
-15
@@ -1,27 +1,16 @@
|
||||
#include "Game.h"
|
||||
#include "MiniDump.h"
|
||||
|
||||
LONG WINAPI CrashHandler(EXCEPTION_POINTERS* pException);
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
::SetUnhandledExceptionFilter(CrashHandler);
|
||||
SetUnhandledExceptionFilter(Create_Dump_Immediate);
|
||||
|
||||
Game game(argc, argv);
|
||||
while (game.Running()) {
|
||||
PerformanceTimer::StartTimer("Game-Tick");
|
||||
PerformanceTimer::StartTimer("Game-Tick");
|
||||
game.Tick();
|
||||
PerformanceTimer::StopTimer("Game-Tick");
|
||||
PerformanceTimer::StopTimer("Game-Tick");
|
||||
}
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
LONG WINAPI CrashHandler(EXCEPTION_POINTERS* pException)
|
||||
{
|
||||
//Take minidump. path should be bin/TacticalZ.dmp
|
||||
//Then show MessageBox, and exit application.
|
||||
Create_Dump(pException, 1, 1);
|
||||
|
||||
return EXCEPTION_EXECUTE_HANDLER;// EXCEPTION_CONTINUE_SEARCH
|
||||
}
|
||||
Reference in New Issue
Block a user