Compare commits
113 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cedcffcf97 | |||
| da1c7b3093 | |||
| ef87102d1f | |||
| 9a41bda4cf | |||
| fc18932068 | |||
| b874ea8641 | |||
| 2609a0253d | |||
| de309d3b9d | |||
| f7ef6707a7 | |||
| feeff5b164 | |||
| 7394436e7a | |||
| f41e0b29be | |||
| 607e83134d | |||
| 5af4f9d8e7 | |||
| af68236e71 | |||
| 6f9ce8a0c1 | |||
| 6465fe6ed6 | |||
| e2831c5593 | |||
| 8d23c531af | |||
| 91b0ac5fbd | |||
| d77119bb2d | |||
| 27669b7383 | |||
| fc7d62a5ad | |||
| c42e1e0967 | |||
| fe9dbf0b0f | |||
| 4ffb03fdd5 | |||
| fe3e0bac5b | |||
| fa4f007604 | |||
| e5ff88d3c9 | |||
| 845a30ed0f | |||
| 34a71b0767 | |||
| 833006744a | |||
| b2d8cddfb7 | |||
| 6fab971734 | |||
| 2c18068059 | |||
| 09aec08d0e | |||
| ed9149fe63 | |||
| 4cf8c3d8d7 | |||
| 37414ce124 | |||
| adceccf402 | |||
| 4c1a284636 | |||
| 23dc8e07b2 | |||
| c7d31cac2d | |||
| a1e932d261 | |||
| 070f1bd394 | |||
| 993d804cef | |||
| 201480b17f | |||
| bac23f6e8c | |||
| 68f2d5327d | |||
| 2263fd2ad6 | |||
| 2f259c3773 | |||
| 8cc928b5f4 | |||
| 881ce7b02f | |||
| c130fdda5e | |||
| 97fcdb342d | |||
| 4c87ca10b9 | |||
| 22664848dc | |||
| d135ea2da6 | |||
| 949ee76f55 | |||
| 844825813b | |||
| 722b795d37 | |||
| cf2bf4e14d | |||
| 2ac584bafb | |||
| 6e5335a266 | |||
| fc5d054cb2 | |||
| 8c9f4bb84b | |||
| e15a7b9485 | |||
| a141da3d8c | |||
| ca907b912e | |||
| 97499f1c28 | |||
| 64610e3c03 | |||
| 5dd85d2748 | |||
| 261c2e021e | |||
| 581a7b470c | |||
| c4d3c515e4 | |||
| 7cc58dc94c | |||
| 5e3af7ac5d | |||
| 3e7936ef00 | |||
| 46987beefb | |||
| 8845054965 | |||
| 7dfd68467e | |||
| 4fd0108443 | |||
| 52355a63e2 | |||
| 72db672dbf | |||
| 950ecba1c0 | |||
| fdc8f753cb | |||
| 0d665c10fe | |||
| 23bb1a6405 | |||
| b8222c7b2e | |||
| 43bbc063cf | |||
| 3e4b87da7c | |||
| ac9ce8ea83 | |||
| 99643fd748 | |||
| a6c30100af | |||
| 833015f45e | |||
| 657125b469 | |||
| b13362360a | |||
| 0af9edc6e5 | |||
| ec10ef3ffc | |||
| 4432891437 | |||
| b2a437731e | |||
| 42b49f9dba | |||
| 4b8f1d95a3 | |||
| 8f84a5ddd6 | |||
| a006db9e63 | |||
| 17da9a8036 | |||
| 6bc7131290 | |||
| 4214bf10a1 | |||
| 717af2c4a4 | |||
| 02cd822cf1 | |||
| f7756ff60f | |||
| 2d5f71e442 | |||
| 503613907e |
+1
-1
Submodule assets updated: 1e7adc749e...10a611659d
@@ -78,13 +78,21 @@ bool AABBvsTriangles(const AABB& box,
|
|||||||
bool& isOnGround,
|
bool& isOnGround,
|
||||||
glm::vec3& outResolutionVector);
|
glm::vec3& outResolutionVector);
|
||||||
|
|
||||||
|
//Detects collision, but does not resolve.
|
||||||
|
bool AABBvsTriangles(const AABB& box,
|
||||||
|
const RawModel::Vertex* modelVertices,
|
||||||
|
const std::vector<unsigned int>& modelIndices,
|
||||||
|
const glm::mat4& modelMatrix);
|
||||||
|
|
||||||
//Return true if the boxes are intersecting.
|
//Return true if the boxes are intersecting.
|
||||||
bool AABBVsAABB(const AABB& a, const AABB& b);
|
bool AABBVsAABB(const AABB& a, const AABB& b);
|
||||||
//Return true if the boxes are intersecting.
|
//Return true if the boxes are intersecting.
|
||||||
//Also outputs the minimum translation that box [a] would need in order to resolve collision.
|
//Also outputs the minimum translation that box [a] would need in order to resolve collision.
|
||||||
bool AABBVsAABB(const AABB& a, const AABB& b, glm::vec3& minimumTranslation);
|
bool AABBVsAABB(const AABB& a, const AABB& b, glm::vec3& minimumTranslation);
|
||||||
|
|
||||||
// Calculates an absolute AABB from an entity AABB component
|
// Calculates an absolute AABB from an entity AABB component or Model component.
|
||||||
|
// if takeModelBox is true, the AABB component will be ignored and box is calculated from Model.
|
||||||
|
// if takeModelBox is false, the AABB component will be prefered, if it exists.
|
||||||
boost::optional<EntityAABB> EntityAbsoluteAABB(EntityWrapper& entity, bool takeModelBox = false);
|
boost::optional<EntityAABB> EntityAbsoluteAABB(EntityWrapper& entity, bool takeModelBox = false);
|
||||||
boost::optional<EntityAABB> AbsoluteAABBExplosionEffect(EntityWrapper& entity);
|
boost::optional<EntityAABB> AbsoluteAABBExplosionEffect(EntityWrapper& entity);
|
||||||
//Returns the first entity hit by the input ray. entitiesPotentiallyHitSorted needs to be sorted
|
//Returns the first entity hit by the input ray. entitiesPotentiallyHitSorted needs to be sorted
|
||||||
|
|||||||
@@ -15,11 +15,11 @@ class CollisionSystem : public PureSystem
|
|||||||
public:
|
public:
|
||||||
CollisionSystem(SystemParams params, Octree<EntityAABB>* octree)
|
CollisionSystem(SystemParams params, Octree<EntityAABB>* octree)
|
||||||
: System(params)
|
: System(params)
|
||||||
, PureSystem("Collidable")
|
, PureSystem("Physics")
|
||||||
, m_Octree(octree)
|
, m_Octree(octree)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
virtual void UpdateComponent(EntityWrapper& entity, ComponentWrapper& component, double dt) override;
|
virtual void UpdateComponent(EntityWrapper& entity, ComponentWrapper& cPhysics, double dt) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Octree<EntityAABB>* m_Octree;
|
Octree<EntityAABB>* m_Octree;
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
#define ComponentInfo_h__
|
#define ComponentInfo_h__
|
||||||
|
|
||||||
#include "../Common.h"
|
#include "../Common.h"
|
||||||
|
#include <boost/shared_array.hpp>
|
||||||
|
|
||||||
struct ComponentInfo
|
struct ComponentInfo
|
||||||
{
|
{
|
||||||
@@ -27,8 +28,9 @@ struct ComponentInfo
|
|||||||
std::string Name;
|
std::string Name;
|
||||||
std::unordered_map<std::string, Field_t> Fields;
|
std::unordered_map<std::string, Field_t> Fields;
|
||||||
std::vector<std::string> FieldsInOrder;
|
std::vector<std::string> FieldsInOrder;
|
||||||
|
std::vector<std::string> StringFields;
|
||||||
unsigned int Stride = 0;
|
unsigned int Stride = 0;
|
||||||
std::shared_ptr<char> Defaults = nullptr;
|
boost::shared_array<char> Defaults = nullptr;
|
||||||
std::shared_ptr<Meta_t> Meta = nullptr;
|
std::shared_ptr<Meta_t> Meta = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#ifndef ComponentPool_h__
|
#ifndef ComponentPool_h__
|
||||||
#define ComponentPool_h__
|
#define ComponentPool_h__
|
||||||
|
|
||||||
|
#include <set>
|
||||||
#include "MemoryPool.h"
|
#include "MemoryPool.h"
|
||||||
#include "ComponentInfo.h"
|
#include "ComponentInfo.h"
|
||||||
#include "ComponentWrapper.h"
|
#include "ComponentWrapper.h"
|
||||||
@@ -45,7 +46,8 @@ public:
|
|||||||
: m_ComponentInfo(ci)
|
: m_ComponentInfo(ci)
|
||||||
, m_Pool(ci.Meta->Allocation, sizeof(EntityID) + ci.Stride)
|
, m_Pool(ci.Meta->Allocation, sizeof(EntityID) + ci.Stride)
|
||||||
{ }
|
{ }
|
||||||
ComponentPool(const ComponentPool& other) = delete;
|
~ComponentPool();
|
||||||
|
ComponentPool(const ComponentPool& other);
|
||||||
ComponentPool(const ComponentPool&& other) = delete;
|
ComponentPool(const ComponentPool&& other) = delete;
|
||||||
|
|
||||||
const ::ComponentInfo& ComponentInfo() const { return m_ComponentInfo; }
|
const ::ComponentInfo& ComponentInfo() const { return m_ComponentInfo; }
|
||||||
|
|||||||
@@ -2,11 +2,29 @@
|
|||||||
#define ComponentWrapper_h__
|
#define ComponentWrapper_h__
|
||||||
|
|
||||||
#include <boost/shared_array.hpp>
|
#include <boost/shared_array.hpp>
|
||||||
|
#include <boost/any.hpp>
|
||||||
#include "../Common.h"
|
#include "../Common.h"
|
||||||
#include "Entity.h"
|
#include "Entity.h"
|
||||||
#include "ComponentInfo.h"
|
#include "ComponentInfo.h"
|
||||||
#include "Util/Any.h"
|
#include "Util/Any.h"
|
||||||
|
|
||||||
|
template <typename T, typename Enable = void>
|
||||||
|
struct ComponentField { };
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
struct ComponentField<T, typename std::enable_if<std::is_trivially_copyable<T>::value>::type>
|
||||||
|
{
|
||||||
|
static T& Get(const ComponentInfo::Field_t& info, char* data) { return *reinterpret_cast<T*>(data); }
|
||||||
|
static void Set(const ComponentInfo::Field_t& info, char* data, const T& value) { Get(data) = value; }
|
||||||
|
};
|
||||||
|
|
||||||
|
template <>
|
||||||
|
struct ComponentField<std::string, void>
|
||||||
|
{
|
||||||
|
static std::string& Get(const ComponentInfo::Field_t& info, char* data) { return **reinterpret_cast<std::string**>(data); }
|
||||||
|
static void Set(const ComponentInfo::Field_t& info, char* data, const std::string& value) { Get(info, data) = value; }
|
||||||
|
};
|
||||||
|
|
||||||
struct ComponentWrapper
|
struct ComponentWrapper
|
||||||
{
|
{
|
||||||
ComponentWrapper(const ComponentInfo& componentInfo, char* data)
|
ComponentWrapper(const ComponentInfo& componentInfo, char* data)
|
||||||
@@ -47,7 +65,31 @@ struct ComponentWrapper
|
|||||||
|
|
||||||
void Copy(ComponentWrapper& destination)
|
void Copy(ComponentWrapper& destination)
|
||||||
{
|
{
|
||||||
memcpy(destination.Data, this->Data, Info.Stride);
|
// Copy trivial data
|
||||||
|
memcpy(destination.Data, Data, Info.Stride);
|
||||||
|
// Duplicate strings
|
||||||
|
SolidifyStrings(destination);
|
||||||
|
}
|
||||||
|
|
||||||
|
// When component data has been copied, strings need to be reconstructed or they'll refer to the same data!
|
||||||
|
static void SolidifyStrings(ComponentWrapper& component)
|
||||||
|
{
|
||||||
|
for (auto& name : component.Info.StringFields) {
|
||||||
|
std::size_t offset = component.Info.Fields.at(name).Offset;
|
||||||
|
std::string value = *reinterpret_cast<const std::string*>(component.Data + offset);
|
||||||
|
new (component.Data + offset) std::string(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// This needs to be called to properly free component data, because strings.
|
||||||
|
static void Destroy(ComponentInfo info, char* data)
|
||||||
|
{
|
||||||
|
// Call std::string destructors
|
||||||
|
for (auto& name : info.StringFields) {
|
||||||
|
std::size_t offset = info.Fields.at(name).Offset;
|
||||||
|
auto field = reinterpret_cast<std::string*>(data + offset);
|
||||||
|
field->~basic_string();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct SubscriptProxy
|
struct SubscriptProxy
|
||||||
@@ -102,26 +144,38 @@ public:
|
|||||||
ComponentWrapperFactory(std::string componentTypeName, unsigned int allocation = 0)
|
ComponentWrapperFactory(std::string componentTypeName, unsigned int allocation = 0)
|
||||||
{
|
{
|
||||||
m_ComponentInfo.Name = componentTypeName;
|
m_ComponentInfo.Name = componentTypeName;
|
||||||
|
m_ComponentInfo.Meta = std::make_shared<ComponentInfo::Meta_t>();
|
||||||
m_ComponentInfo.Meta->Allocation = allocation;
|
m_ComponentInfo.Meta->Allocation = allocation;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
void AddProperty(std::string fieldName, T defaultValue)
|
void AddProperty(std::string fieldName, T defaultValue)
|
||||||
{
|
{
|
||||||
m_DefaultValues.push_back(defaultValue);
|
auto& field = m_ComponentInfo.Fields[fieldName];
|
||||||
m_ComponentInfo.Fields[fieldName].Type = typeid(T).name();
|
field.Name = fieldName;
|
||||||
m_ComponentInfo.Fields[fieldName].Offset = m_ComponentInfo.Stride;
|
field.Type = typeid(T).name();
|
||||||
m_ComponentInfo.Fields[fieldName].Stride = sizeof(T);
|
field.Offset = m_ComponentInfo.Stride;
|
||||||
|
field.Stride = sizeof(T);
|
||||||
|
m_ComponentInfo.FieldsInOrder.push_back(field.Name);
|
||||||
|
if (field.Type == typeid(std::string).name()) {
|
||||||
|
field.Type = "string";
|
||||||
|
m_ComponentInfo.StringFields.push_back(field.Name);
|
||||||
|
}
|
||||||
m_ComponentInfo.Stride += sizeof(T);
|
m_ComponentInfo.Stride += sizeof(T);
|
||||||
|
m_DefaultValues.push_back(std::make_pair(field, defaultValue));
|
||||||
}
|
}
|
||||||
|
|
||||||
ComponentInfo& Finalize()
|
ComponentInfo& Finalize()
|
||||||
{
|
{
|
||||||
m_ComponentInfo.Defaults = std::shared_ptr<char>(new char[m_ComponentInfo.Stride]);
|
m_ComponentInfo.Defaults = boost::shared_array<char>(new char[m_ComponentInfo.Stride]);
|
||||||
std::size_t offset = 0;
|
std::size_t offset = 0;
|
||||||
for (auto& val : m_DefaultValues) {
|
for (auto& pair : m_DefaultValues) {
|
||||||
memcpy(m_ComponentInfo.Defaults.get() + offset, val.Data.get(), val.Size);
|
if (pair.first.Type == "string") {
|
||||||
offset += val.Size;
|
new (m_ComponentInfo.Defaults.get() + offset) std::string(*reinterpret_cast<std::string*>(pair.second.Data.get()));
|
||||||
|
} else {
|
||||||
|
memcpy(m_ComponentInfo.Defaults.get() + offset, pair.second.Data.get(), pair.second.Size);
|
||||||
|
}
|
||||||
|
offset += pair.second.Size;
|
||||||
}
|
}
|
||||||
|
|
||||||
return m_ComponentInfo;
|
return m_ComponentInfo;
|
||||||
@@ -131,7 +185,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
ComponentInfo m_ComponentInfo;
|
ComponentInfo m_ComponentInfo;
|
||||||
std::vector<Any> m_DefaultValues;
|
std::vector<std::pair<ComponentInfo::Field_t, Any>> m_DefaultValues;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ struct EntityWrapper
|
|||||||
EntityWrapper Parent();
|
EntityWrapper Parent();
|
||||||
EntityWrapper FirstChildByName(const std::string& name);
|
EntityWrapper FirstChildByName(const std::string& name);
|
||||||
EntityWrapper FirstParentWithComponent(const std::string& componentType);
|
EntityWrapper FirstParentWithComponent(const std::string& componentType);
|
||||||
|
std::vector<EntityWrapper> ChildrenWithComponent(const std::string& componentType);
|
||||||
bool IsChildOf(EntityWrapper potentialParent);
|
bool IsChildOf(EntityWrapper potentialParent);
|
||||||
bool Valid() const;
|
bool Valid() const;
|
||||||
|
|
||||||
@@ -39,6 +40,7 @@ struct EntityWrapper
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
EntityWrapper firstChildByNameRecursive(const std::string& name, EntityID parent);
|
EntityWrapper firstChildByNameRecursive(const std::string& name, EntityID parent);
|
||||||
|
void childrenWithComponentRecursive(const std::string& componentType, EntityWrapper& entity, std::vector<EntityWrapper>& childrenWithComponent);
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace std
|
namespace std
|
||||||
|
|||||||
@@ -66,9 +66,25 @@ public:
|
|||||||
, m_LowestAllocatedSlot(m_NumSlots)
|
, m_LowestAllocatedSlot(m_NumSlots)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
//We may get problems with memory being released
|
MemoryPool(const MemoryPool<T>& other)
|
||||||
//prematurely, etc. if we allow copies.
|
: m_StartAddress(new char[other.m_NumSlots*other.m_Stride])
|
||||||
MemoryPool(const MemoryPool<T>& other) = delete;
|
, m_SlotIsAllocated(other.m_SlotIsAllocated)
|
||||||
|
, m_ExtraMemory()
|
||||||
|
, m_NumSlots(other.m_NumSlots)
|
||||||
|
, m_LowestAllocatedSlot(other.m_LowestAllocatedSlot)
|
||||||
|
, m_NumAllocatedSlots(other.m_NumAllocatedSlots)
|
||||||
|
, m_Stride(other.m_Stride)
|
||||||
|
, m_CurrentAllocSlot(other.m_CurrentAllocSlot)
|
||||||
|
{
|
||||||
|
// Copy statically allocated pool
|
||||||
|
memcpy(m_StartAddress, other.m_StartAddress, m_NumSlots*m_Stride);
|
||||||
|
// Copy dynamically allocated memory
|
||||||
|
for (char* otherAddr : other.m_ExtraMemory) {
|
||||||
|
char* addr = (char*)malloc(m_Stride);
|
||||||
|
memcpy(addr, otherAddr, m_Stride);
|
||||||
|
m_ExtraMemory.push_back(addr);
|
||||||
|
}
|
||||||
|
}
|
||||||
MemoryPool(const MemoryPool<T>&& other) = delete;
|
MemoryPool(const MemoryPool<T>&& other) = delete;
|
||||||
|
|
||||||
//Free all memory that has been allocated.
|
//Free all memory that has been allocated.
|
||||||
@@ -78,8 +94,9 @@ public:
|
|||||||
delete[] m_StartAddress;
|
delete[] m_StartAddress;
|
||||||
m_StartAddress = nullptr;
|
m_StartAddress = nullptr;
|
||||||
}
|
}
|
||||||
for (char* addr : m_ExtraMemory)
|
for (char* addr : m_ExtraMemory) {
|
||||||
free(addr);
|
free(addr);
|
||||||
|
}
|
||||||
m_ExtraMemory.clear();
|
m_ExtraMemory.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
#ifndef PerformanceTimer_h__
|
||||||
|
#define PerformanceTimer_h__
|
||||||
|
|
||||||
|
#include "../Common.h"
|
||||||
|
#include <boost/timer/timer.hpp>
|
||||||
|
using boost::timer::cpu_timer;
|
||||||
|
|
||||||
|
class PerformanceTimer
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static void StartTimer(std::string nameOfTimer);
|
||||||
|
static void StartTimerAndStopPrevious(std::string nameOfTimer);
|
||||||
|
static void StopTimer(std::string nameOfTimer);
|
||||||
|
static void SetFrameNumber(int frameNumber);
|
||||||
|
|
||||||
|
static void ResetAllTimers();
|
||||||
|
static void CreateExcelData();
|
||||||
|
|
||||||
|
private:
|
||||||
|
static std::map<std::string, cpu_timer> timers;
|
||||||
|
static cpu_timer m_Timer;
|
||||||
|
static std::string currentTimerRunning;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -6,6 +6,7 @@
|
|||||||
#include "System.h"
|
#include "System.h"
|
||||||
#include "World.h"
|
#include "World.h"
|
||||||
#include "EPause.h"
|
#include "EPause.h"
|
||||||
|
#include "PerformanceTimer.h"
|
||||||
|
|
||||||
class SystemPipeline
|
class SystemPipeline
|
||||||
{
|
{
|
||||||
@@ -72,7 +73,10 @@ public:
|
|||||||
|
|
||||||
// Update
|
// Update
|
||||||
for (auto& system : group.ImpureSystems) {
|
for (auto& system : group.ImpureSystems) {
|
||||||
|
auto className = (std::string)typeid(*system).name();
|
||||||
|
PerformanceTimer::StartTimer(className);
|
||||||
system->Update(dt);
|
system->Update(dt);
|
||||||
|
PerformanceTimer::StopTimer(className);
|
||||||
}
|
}
|
||||||
for (auto& pair : group.PureSystems) {
|
for (auto& pair : group.PureSystems) {
|
||||||
const std::string& componentName = pair.first;
|
const std::string& componentName = pair.first;
|
||||||
@@ -83,7 +87,10 @@ public:
|
|||||||
}
|
}
|
||||||
for (auto& component : *pool) {
|
for (auto& component : *pool) {
|
||||||
for (auto& system : systems) {
|
for (auto& system : systems) {
|
||||||
|
auto className = (std::string)typeid(*system).name();
|
||||||
|
PerformanceTimer::StartTimer(className);
|
||||||
system->UpdateComponent(EntityWrapper(m_World, component.EntityID), component, dt);
|
system->UpdateComponent(EntityWrapper(m_World, component.EntityID), component, dt);
|
||||||
|
PerformanceTimer::StopTimer(className);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -106,9 +113,9 @@ private:
|
|||||||
std::vector<UnorderedSystems> m_OrderedSystemGroups;
|
std::vector<UnorderedSystems> m_OrderedSystemGroups;
|
||||||
|
|
||||||
EventRelay<SystemPipeline, Events::Pause> m_EPause;
|
EventRelay<SystemPipeline, Events::Pause> m_EPause;
|
||||||
bool OnPause(const Events::Pause& e) {
|
bool OnPause(const Events::Pause& e) {
|
||||||
if (e.World == m_World) {
|
if (e.World == m_World) {
|
||||||
m_Paused = true;
|
m_Paused = true;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
#define Util_Any_h__
|
#define Util_Any_h__
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <boost/shared_array.hpp>
|
||||||
|
|
||||||
struct Any
|
struct Any
|
||||||
{
|
{
|
||||||
@@ -10,7 +11,7 @@ struct Any
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
Any(const T& value)
|
Any(const T& value)
|
||||||
{
|
{
|
||||||
Data = std::shared_ptr<char>(new char[sizeof(T)]);
|
Data = boost::shared_array<char>(new char[sizeof(T)]);
|
||||||
Size = sizeof(T);
|
Size = sizeof(T);
|
||||||
memcpy(Data.get(), &value, Size);
|
memcpy(Data.get(), &value, Size);
|
||||||
}
|
}
|
||||||
@@ -18,7 +19,7 @@ struct Any
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
Any(T&& value)
|
Any(T&& value)
|
||||||
{
|
{
|
||||||
Data = std::shared_ptr<char>(new char[sizeof(T)]);
|
Data = boost::shared_array<char>(new char[sizeof(T)]);
|
||||||
Size = sizeof(T);
|
Size = sizeof(T);
|
||||||
memcpy(Data.get(), &value, Size);
|
memcpy(Data.get(), &value, Size);
|
||||||
}
|
}
|
||||||
@@ -35,7 +36,7 @@ struct Any
|
|||||||
return Any(value);
|
return Any(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<char> Data = nullptr;
|
boost::shared_array<char> Data = nullptr;
|
||||||
std::size_t Size = 0;
|
std::size_t Size = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ public:
|
|||||||
: m_EventBroker(eventBroker)
|
: m_EventBroker(eventBroker)
|
||||||
{ }
|
{ }
|
||||||
~World();
|
~World();
|
||||||
|
World(const World& other);
|
||||||
|
|
||||||
// Create empty entity
|
// Create empty entity
|
||||||
EntityID CreateEntity(EntityID parent = 0);
|
EntityID CreateEntity(EntityID parent = 0);
|
||||||
|
|||||||
@@ -1,165 +0,0 @@
|
|||||||
#ifndef GUI_BUTTON_H__
|
|
||||||
#define GUI_BUTTON_H__
|
|
||||||
|
|
||||||
#include "GUI/TextureFrame.h"
|
|
||||||
#include "GUI/EButtonEnter.h"
|
|
||||||
#include "GUI/EButtonLeave.h"
|
|
||||||
#include "GUI/EButtonPress.h"
|
|
||||||
#include "GUI/EButtonRelease.h"
|
|
||||||
#include "Core/EMouseMove.h"
|
|
||||||
#include "Core/EMousePress.h"
|
|
||||||
#include "Core/EMouseRelease.h"
|
|
||||||
|
|
||||||
namespace dd
|
|
||||||
{
|
|
||||||
namespace GUI
|
|
||||||
{
|
|
||||||
|
|
||||||
class Button : public TextureFrame
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
Button(Frame* parent, std::string name)
|
|
||||||
: TextureFrame(parent, name)
|
|
||||||
{
|
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_EMouseMove, &Button::OnMouseMove);
|
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_EMousePress, &Button::OnMousePress);
|
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_EMouseRelease, &Button::OnMouseRelease);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SetTextureHover(std::string resourceName)
|
|
||||||
{
|
|
||||||
m_TextureHover = resourceName;
|
|
||||||
}
|
|
||||||
void SetTextureReleased(std::string resourceName)
|
|
||||||
{
|
|
||||||
m_TextureReleased = resourceName;
|
|
||||||
SetTexture(resourceName);
|
|
||||||
}
|
|
||||||
void SetTexturePressed(std::string resourceName)
|
|
||||||
{
|
|
||||||
m_TexturePressed = resourceName;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Draw(RenderScene& rq) override
|
|
||||||
{
|
|
||||||
if (m_Texture == nullptr && !m_TextureReleased.empty()) {
|
|
||||||
SetTexture(m_TextureReleased);
|
|
||||||
}
|
|
||||||
|
|
||||||
TextureFrame::Draw(rq);
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual void OnEnter() { }
|
|
||||||
virtual void OnLeave() { }
|
|
||||||
virtual void OnPress() { }
|
|
||||||
virtual void OnRelease() { }
|
|
||||||
|
|
||||||
protected:
|
|
||||||
bool m_MouseIsOver = false;
|
|
||||||
bool m_IsDown = false;
|
|
||||||
|
|
||||||
virtual bool OnMouseMove(const Events::MouseMove& event)
|
|
||||||
{
|
|
||||||
if (Hidden()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isOver = Rectangle::Intersects(AbsoluteRectangle(), Rectangle(event.X, event.Y, 1, 1));
|
|
||||||
if (isOver && !m_MouseIsOver) { // Enter
|
|
||||||
if (!m_IsDown) {
|
|
||||||
if (!m_TextureHover.empty()) {
|
|
||||||
SetTexture(m_TextureHover);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
OnEnter();
|
|
||||||
Events::ButtonEnter e;
|
|
||||||
e.FrameName = m_Name;
|
|
||||||
EventBroker->Publish(e);
|
|
||||||
Events::PlaySound soundEvent;
|
|
||||||
soundEvent.FilePath = "Sounds/GUI/hover-n.wav";
|
|
||||||
EventBroker->Publish(soundEvent);
|
|
||||||
|
|
||||||
} else if (!isOver && m_MouseIsOver) { // Leave
|
|
||||||
if (!m_IsDown) {
|
|
||||||
if (!m_TextureReleased.empty()) {
|
|
||||||
SetTexture(m_TextureReleased);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
OnLeave();
|
|
||||||
Events::ButtonLeave e;
|
|
||||||
e.FrameName = m_Name;
|
|
||||||
EventBroker->Publish(e);
|
|
||||||
}
|
|
||||||
m_MouseIsOver = isOver;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
virtual bool OnMousePress(const Events::MousePress& event)
|
|
||||||
{
|
|
||||||
if (Hidden()) {
|
|
||||||
//LOG_DEBUG("Pressed hidden button");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!Rectangle::Intersects(AbsoluteRectangle(), Rectangle(event.X, event.Y, 1, 1))) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!m_TexturePressed.empty()) {
|
|
||||||
SetTexture(m_TexturePressed);
|
|
||||||
}
|
|
||||||
|
|
||||||
m_IsDown = true;
|
|
||||||
OnPress();
|
|
||||||
Events::ButtonPress e;
|
|
||||||
e.FrameName = m_Name;
|
|
||||||
e.Button = this;
|
|
||||||
EventBroker->Publish(e);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
virtual bool OnMouseRelease(const Events::MouseRelease& event)
|
|
||||||
{
|
|
||||||
if (Hidden()) {
|
|
||||||
//LOG_DEBUG("Released hidden button");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isOver = Rectangle::Intersects(AbsoluteRectangle(), Rectangle(event.X, event.Y, 1, 1));
|
|
||||||
if (!isOver && !m_IsDown) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_MouseIsOver) {
|
|
||||||
if (!m_TextureHover.empty()) {
|
|
||||||
SetTexture(m_TextureHover);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (!m_TextureReleased.empty()) {
|
|
||||||
SetTexture(m_TextureReleased);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
m_IsDown = false;
|
|
||||||
OnRelease();
|
|
||||||
Events::ButtonRelease e;
|
|
||||||
e.FrameName = m_Name;
|
|
||||||
e.Button = this;
|
|
||||||
EventBroker->Publish(e);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
EventRelay<Frame, Events::MouseMove> m_EMouseMove;
|
|
||||||
EventRelay<Frame, Events::MousePress> m_EMousePress;
|
|
||||||
EventRelay<Frame, Events::MouseRelease> m_EMouseRelease;
|
|
||||||
|
|
||||||
std::string m_TextureHover;
|
|
||||||
std::string m_TexturePressed;
|
|
||||||
std::string m_TextureReleased;
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
#ifndef ButtonSystem_h__
|
||||||
|
#define ButtonSystem_h__
|
||||||
|
|
||||||
|
#include "../Rendering/IRenderer.h"
|
||||||
|
#include "../Core/ConfigFile.h"
|
||||||
|
#include "../Rendering/PickingPass.h"
|
||||||
|
#include "../Core/ResourceManager.h"
|
||||||
|
#include "../Core/System.h"
|
||||||
|
#include "../Core/Event.h"
|
||||||
|
#include "../Core/EMousePress.h"
|
||||||
|
#include "../Core/EMouseRelease.h"
|
||||||
|
#include "../Core/ELockMouse.h"
|
||||||
|
|
||||||
|
#include "EButtonPressed.h"
|
||||||
|
#include "EButtonReleased.h"
|
||||||
|
#include "EButtonClicked.h"
|
||||||
|
|
||||||
|
|
||||||
|
class ButtonSystem : public PureSystem
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ButtonSystem(SystemParams params, IRenderer* renderer);
|
||||||
|
virtual void UpdateComponent(EntityWrapper& entity, ComponentWrapper& component, double dt) override;
|
||||||
|
private:
|
||||||
|
IRenderer* m_Renderer;
|
||||||
|
bool m_MouseIsLocked = false;
|
||||||
|
|
||||||
|
EntityWrapper m_PickEntity = EntityWrapper::Invalid;
|
||||||
|
PickData m_PickData;
|
||||||
|
|
||||||
|
EventRelay<ButtonSystem, Events::LockMouse> m_EMouseLock;
|
||||||
|
bool OnMouseLock(const Events::LockMouse& e);
|
||||||
|
EventRelay<ButtonSystem, Events::UnlockMouse> m_EMouseUnlock;
|
||||||
|
bool OnMouseUnlock(const Events::UnlockMouse& e);
|
||||||
|
|
||||||
|
EventRelay<ButtonSystem, Events::MousePress> m_EMousePress;
|
||||||
|
bool OnMousePress(const Events::MousePress& e);
|
||||||
|
EventRelay<ButtonSystem, Events::MouseRelease> m_EMouseRelease;
|
||||||
|
bool OnMouseRelease(const Events::MouseRelease& e);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
#ifndef Events_ButtonClicked_h__
|
||||||
|
#define Events_ButtonClicked_h__
|
||||||
|
|
||||||
|
#include "Core/Event.h"
|
||||||
|
|
||||||
|
namespace Events
|
||||||
|
{
|
||||||
|
|
||||||
|
struct ButtonClicked : public Event {
|
||||||
|
std::string EntityName;
|
||||||
|
EntityWrapper Entity;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
#ifndef Events_ButtonEnter_h__
|
|
||||||
#define Events_ButtonEnter_h__
|
|
||||||
|
|
||||||
#include "../Core/EventBroker.h"
|
|
||||||
|
|
||||||
namespace Events
|
|
||||||
{
|
|
||||||
|
|
||||||
/** Thrown on GUI button hover. */
|
|
||||||
struct ButtonEnter : Event
|
|
||||||
{
|
|
||||||
std::string FrameName;
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
#ifndef Events_ButtonLeave_h__
|
|
||||||
#define Events_ButtonLeave_h__
|
|
||||||
|
|
||||||
#include "../Core/EventBroker.h"
|
|
||||||
|
|
||||||
namespace Events
|
|
||||||
{
|
|
||||||
|
|
||||||
/** Thrown on GUI button hover. */
|
|
||||||
struct ButtonLeave : Event
|
|
||||||
{
|
|
||||||
std::string FrameName;
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
#ifndef Events_ButtonPress_h__
|
|
||||||
#define Events_ButtonPress_h__
|
|
||||||
|
|
||||||
#include "../Core/EventBroker.h"
|
|
||||||
|
|
||||||
namespace GUI { class Button; }
|
|
||||||
|
|
||||||
namespace Events
|
|
||||||
{
|
|
||||||
|
|
||||||
/** Thrown on GUI button press. */
|
|
||||||
struct ButtonPress : Event
|
|
||||||
{
|
|
||||||
std::string FrameName;
|
|
||||||
GUI::Button* Button;
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
#ifndef Events_ButtonPressed_h__
|
||||||
|
#define Events_ButtonPressed_h__
|
||||||
|
|
||||||
|
#include "Core/Event.h"
|
||||||
|
|
||||||
|
namespace Events
|
||||||
|
{
|
||||||
|
|
||||||
|
struct ButtonPressed : public Event {
|
||||||
|
std::string EntityName;
|
||||||
|
EntityWrapper Entity;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
#ifndef Events_ButtonRelease_h__
|
|
||||||
#define Events_ButtonRelease_h__
|
|
||||||
|
|
||||||
#include "../Core/EventBroker.h"
|
|
||||||
|
|
||||||
namespace GUI { class Button; }
|
|
||||||
|
|
||||||
namespace Events
|
|
||||||
{
|
|
||||||
|
|
||||||
/** Thrown on GUI button release. */
|
|
||||||
struct ButtonRelease : Event
|
|
||||||
{
|
|
||||||
std::string FrameName;
|
|
||||||
GUI::Button* Button;
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
#ifndef Events_ButtonReleased_h__
|
||||||
|
#define Events_ButtonReleased_h__
|
||||||
|
|
||||||
|
#include "Core/Event.h"
|
||||||
|
|
||||||
|
namespace Events
|
||||||
|
{
|
||||||
|
|
||||||
|
struct ButtonReleased : public Event {
|
||||||
|
std::string EntityName;
|
||||||
|
EntityWrapper Entity;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -1,261 +0,0 @@
|
|||||||
#ifndef GUI_Frame_h__
|
|
||||||
#define GUI_Frame_h__
|
|
||||||
|
|
||||||
#include "../Common.h"
|
|
||||||
#include "../Core/Util/Rectangle.h"
|
|
||||||
#include "../Core/EventBroker.h"
|
|
||||||
#include "../Core/EKeyDown.h"
|
|
||||||
#include "../Core/EKeyUp.h"
|
|
||||||
#include "../Core/ResourceManager.h"
|
|
||||||
#include "../Rendering/RenderQueue.h"
|
|
||||||
#include "../Rendering/Texture.h"
|
|
||||||
#include "../Input/EInputCommand.h"
|
|
||||||
|
|
||||||
namespace GUI
|
|
||||||
{
|
|
||||||
|
|
||||||
class Frame : public Rectangle
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
enum class Anchor
|
|
||||||
{
|
|
||||||
Left,
|
|
||||||
Right,
|
|
||||||
Top,
|
|
||||||
Bottom
|
|
||||||
};
|
|
||||||
|
|
||||||
static const int BaseWidth = 1280;
|
|
||||||
static const int BaseHeight = 720;
|
|
||||||
|
|
||||||
// Set up a base frame with an event broker
|
|
||||||
Frame(EventBroker* eventBroker)
|
|
||||||
: m_EventBroker(eventBroker)
|
|
||||||
, BaseFrame(this)
|
|
||||||
, m_Name("UIParent")
|
|
||||||
, Rectangle() { }
|
|
||||||
|
|
||||||
// Create a frame as a child
|
|
||||||
Frame(Frame* parent, std::string name)
|
|
||||||
: m_Name(name)
|
|
||||||
{
|
|
||||||
SetParent(parent);
|
|
||||||
Width = parent->Width;
|
|
||||||
Height = parent->Height;
|
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_EKeyDown, &Frame::OnKeyDown);
|
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_EKeyUp, &Frame::OnKeyUp);
|
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_EInputCommand, &Frame::OnCommand);
|
|
||||||
}
|
|
||||||
|
|
||||||
~Frame()
|
|
||||||
{
|
|
||||||
/*for (auto layer : m_Children)
|
|
||||||
{
|
|
||||||
for (auto child : layer.second)
|
|
||||||
{
|
|
||||||
delete child.second;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_Parent)
|
|
||||||
{
|
|
||||||
m_Parent->RemoveChild(this);
|
|
||||||
}*/
|
|
||||||
}
|
|
||||||
|
|
||||||
Frame* Parent() const { return m_Parent; }
|
|
||||||
|
|
||||||
void SetParent(Frame* parent)
|
|
||||||
{
|
|
||||||
if (parent == nullptr) {
|
|
||||||
LOG_ERROR("Failed to parent frame \"%s\": Invalid parent", m_Name.c_str());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_Layer = parent->Layer() + 1;
|
|
||||||
parent->AddChild(this);
|
|
||||||
m_Parent = parent;
|
|
||||||
m_EventBroker = parent->m_EventBroker;
|
|
||||||
BaseFrame = parent->BaseFrame;
|
|
||||||
}
|
|
||||||
|
|
||||||
void AddChild(Frame* child)
|
|
||||||
{
|
|
||||||
m_Children[child->m_Layer].insert(std::make_pair(child->Name(), child));
|
|
||||||
if (m_Parent) {
|
|
||||||
m_Parent->AddChild(child);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void RemoveChild(Frame* child)
|
|
||||||
{
|
|
||||||
auto it = m_Children.find(child->m_Layer);
|
|
||||||
if (it != m_Children.end()) {
|
|
||||||
m_Children.erase(it);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_Parent) {
|
|
||||||
m_Parent->RemoveChild(child);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string Name() const { return m_Name; }
|
|
||||||
void SetName(std::string val) { m_Name = val; }
|
|
||||||
|
|
||||||
int Layer() const { return m_Layer; }
|
|
||||||
|
|
||||||
bool Hidden() const
|
|
||||||
{
|
|
||||||
if (m_Parent)
|
|
||||||
return m_Parent->Hidden() || m_Hidden;
|
|
||||||
else
|
|
||||||
return m_Hidden;
|
|
||||||
}
|
|
||||||
bool Visible() const
|
|
||||||
{
|
|
||||||
return !Hidden();
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual void Hide() { m_Hidden = true; }
|
|
||||||
virtual void Show() { m_Hidden = false; }
|
|
||||||
|
|
||||||
int Left() const override
|
|
||||||
{
|
|
||||||
if (m_Parent)
|
|
||||||
return m_Parent->Left() + X;
|
|
||||||
else
|
|
||||||
return X;
|
|
||||||
}
|
|
||||||
void SetLeft(int absLeft) override
|
|
||||||
{
|
|
||||||
if (m_Parent) {
|
|
||||||
X = absLeft - m_Parent->Left();
|
|
||||||
} else {
|
|
||||||
X = absLeft;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
int Right() const override
|
|
||||||
{
|
|
||||||
return Left() + Width;
|
|
||||||
}
|
|
||||||
void SetRight(int absRight) override
|
|
||||||
{
|
|
||||||
if (m_Parent) {
|
|
||||||
X = absRight - Width - m_Parent->Left();
|
|
||||||
} else {
|
|
||||||
X = absRight - Width;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
int Top() const override
|
|
||||||
{
|
|
||||||
if (m_Parent)
|
|
||||||
return m_Parent->Top() + Y;
|
|
||||||
else
|
|
||||||
return Y;
|
|
||||||
}
|
|
||||||
void SetTop(int absTop) override
|
|
||||||
{
|
|
||||||
if (m_Parent) {
|
|
||||||
Y = absTop - m_Parent->Top();
|
|
||||||
} else {
|
|
||||||
Y = absTop;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
int Bottom() const override
|
|
||||||
{
|
|
||||||
return Top() + Height;
|
|
||||||
}
|
|
||||||
void SetBottom(int absBottom) override
|
|
||||||
{
|
|
||||||
if (m_Parent) {
|
|
||||||
Y = absBottom - Height - m_Parent->Top();
|
|
||||||
} else {
|
|
||||||
Y = absBottom - Height;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
glm::vec2 Scale()
|
|
||||||
{
|
|
||||||
if (m_Parent)
|
|
||||||
return m_Parent->Scale();
|
|
||||||
else
|
|
||||||
return glm::vec2(Width, Height) / glm::vec2(BaseWidth, BaseHeight);
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle AbsoluteRectangle()
|
|
||||||
{
|
|
||||||
int left = Left();
|
|
||||||
if (m_Parent)
|
|
||||||
left = std::max(left, m_Parent->Left());
|
|
||||||
int top = Top();
|
|
||||||
if (m_Parent)
|
|
||||||
top = std::max(top, m_Parent->Top());
|
|
||||||
int width = Right() - left;
|
|
||||||
int height = Bottom() - top;
|
|
||||||
return Rectangle(left, top, width, height);
|
|
||||||
}
|
|
||||||
|
|
||||||
void UpdateLayered(double dt)
|
|
||||||
{
|
|
||||||
// Update ourselves
|
|
||||||
this->Update(dt);
|
|
||||||
|
|
||||||
// Update children
|
|
||||||
for (auto& pairLayer : m_Children) {
|
|
||||||
auto children = pairLayer.second;
|
|
||||||
for (auto& pairChild : children) {
|
|
||||||
auto child = pairChild.second;
|
|
||||||
child->Update(dt);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual void Update(double dt) { }
|
|
||||||
|
|
||||||
void DrawLayered(RenderScene& rq)
|
|
||||||
{
|
|
||||||
if (this->Hidden())
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Draw ourselves
|
|
||||||
this->Draw(rq);
|
|
||||||
|
|
||||||
// Draw children
|
|
||||||
for (auto& pairLayer : m_Children) {
|
|
||||||
auto children = pairLayer.second;
|
|
||||||
for (auto& pairChild : children) {
|
|
||||||
auto child = pairChild.second;
|
|
||||||
if (child->Hidden())
|
|
||||||
continue;
|
|
||||||
child->Draw(rq);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual void Draw(RenderScene& rq) { }
|
|
||||||
|
|
||||||
protected:
|
|
||||||
::EventBroker* m_EventBroker;
|
|
||||||
Frame* BaseFrame = nullptr;
|
|
||||||
|
|
||||||
std::string m_Name = "Unnamed";
|
|
||||||
int m_Layer = 0;
|
|
||||||
bool m_Hidden = false;
|
|
||||||
|
|
||||||
Frame* m_Parent = nullptr;
|
|
||||||
typedef std::multimap<std::string, Frame*> Children_t; // name -> frame
|
|
||||||
std::map<int, Children_t> m_Children; // layer -> Children_t
|
|
||||||
|
|
||||||
virtual bool OnKeyDown(const Events::KeyDown& event) { return false; }
|
|
||||||
virtual bool OnKeyUp(const Events::KeyUp& event) { return false; }
|
|
||||||
virtual bool OnCommand(const Events::InputCommand& event) { return false; }
|
|
||||||
|
|
||||||
private:
|
|
||||||
EventRelay<Frame, Events::KeyDown> m_EKeyDown;
|
|
||||||
EventRelay<Frame, Events::KeyUp> m_EKeyUp;
|
|
||||||
EventRelay<Frame, Events::InputCommand> m_EInputCommand;
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
#ifndef MainMenuSystem_h__
|
||||||
|
#define MainMenuSystem_h__
|
||||||
|
|
||||||
|
#include "../Core/System.h"
|
||||||
|
#include "../Rendering/IRenderer.h"
|
||||||
|
#include "../Core/ResourceManager.h"
|
||||||
|
#include "../Core/Event.h"
|
||||||
|
|
||||||
|
|
||||||
|
#include "EButtonClicked.h"
|
||||||
|
#include "EButtonPressed.h"
|
||||||
|
#include "EButtonReleased.h"
|
||||||
|
|
||||||
|
|
||||||
|
class MainMenuSystem : public ImpureSystem
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
MainMenuSystem(SystemParams params, IRenderer* renderer);
|
||||||
|
virtual void Update(double dt) override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
IRenderer* m_Renderer;
|
||||||
|
|
||||||
|
EventRelay<MainMenuSystem, Events::ButtonClicked> m_EClicked;
|
||||||
|
bool OnButtonClick(const Events::ButtonClicked& e);
|
||||||
|
EventRelay<MainMenuSystem, Events::ButtonReleased> m_EReleased;
|
||||||
|
bool OnButtonRelease(const Events::ButtonReleased& e);
|
||||||
|
EventRelay<MainMenuSystem, Events::ButtonPressed> m_EPressed;
|
||||||
|
bool OnButtonPress(const Events::ButtonPressed& e);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -1,112 +0,0 @@
|
|||||||
#ifndef GUI_TextureFrame_h__
|
|
||||||
#define GUI_TextureFrame_h__
|
|
||||||
|
|
||||||
#include "Frame.h"
|
|
||||||
#include "../Rendering/Texture.h"
|
|
||||||
#include "../Rendering/Util/CommonFunctions.h"
|
|
||||||
|
|
||||||
namespace GUI
|
|
||||||
{
|
|
||||||
|
|
||||||
class TextureFrame : public Frame
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
TextureFrame(Frame* parent, std::string name)
|
|
||||||
: Frame(parent, name) { }
|
|
||||||
|
|
||||||
void EnableScissor() { m_ScissorEnabled = true; }
|
|
||||||
void DisableScissor() { m_ScissorEnabled = false; }
|
|
||||||
|
|
||||||
void Draw(RenderScene& rq) override
|
|
||||||
{
|
|
||||||
if (m_Texture == nullptr)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Texture while fading
|
|
||||||
if (m_FadeTexture && m_CurrentFade < 1) {
|
|
||||||
FrameJob job;
|
|
||||||
job.Scissor = (m_ScissorEnabled) ? m_Parent->AbsoluteRectangle() : Rectangle();
|
|
||||||
job.Viewport = Rectangle(Left(), Top(), Width, Height);
|
|
||||||
job.TextureID = m_FadeTexture->ResourceID;
|
|
||||||
job.DiffuseTexture = m_FadeTexture;
|
|
||||||
job.Color = glm::vec4(m_Color.r, m_Color.g, m_Color.b, m_Color.a);
|
|
||||||
job.Name = Name();
|
|
||||||
rq.GUI.Add(job);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Main texture
|
|
||||||
{
|
|
||||||
FrameJob job;
|
|
||||||
job.Scissor = (m_ScissorEnabled) ? m_Parent->AbsoluteRectangle() : Rectangle();
|
|
||||||
job.Viewport = Rectangle(Left(), Top(), Width, Height);
|
|
||||||
job.TextureID = m_Texture->ResourceID;
|
|
||||||
job.DiffuseTexture = m_Texture;
|
|
||||||
job.Color = glm::vec4(m_Color.r, m_Color.g, m_Color.b, m_Color.a * m_CurrentFade);
|
|
||||||
job.Name = Name();
|
|
||||||
rq.GUI.Add(job);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string Texture() const { return m_TextureName; }
|
|
||||||
|
|
||||||
void SetTexture(std::string resourceName)
|
|
||||||
{
|
|
||||||
if (resourceName.empty()) {
|
|
||||||
m_Texture = nullptr;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_Texture = CommonFunctions::LoadTexture(resourceName, false);
|
|
||||||
m_TextureName = resourceName;
|
|
||||||
if (m_Texture == nullptr) {
|
|
||||||
m_Texture = CommonFunctions::LoadTexture("Textures/Core/ErrorTexture.png", false);
|
|
||||||
}
|
|
||||||
|
|
||||||
SizeToTexture();
|
|
||||||
}
|
|
||||||
|
|
||||||
void SizeToTexture()
|
|
||||||
{
|
|
||||||
if (m_Texture != nullptr) {
|
|
||||||
this->Width = m_Texture->Width;
|
|
||||||
this->Height = m_Texture->Height;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void FadeToTexture(std::string resourceName, double duration)
|
|
||||||
{
|
|
||||||
m_FadeTexture = m_Texture;
|
|
||||||
SetTexture(resourceName);
|
|
||||||
m_FadeDuration = duration;
|
|
||||||
m_CurrentFade = 0.f;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Update(double dt) override
|
|
||||||
{
|
|
||||||
if (m_CurrentFade < 1) {
|
|
||||||
m_CurrentFade += dt / m_FadeDuration;
|
|
||||||
if (m_CurrentFade > 1) {
|
|
||||||
m_FadeTexture = nullptr;
|
|
||||||
m_CurrentFade = 1;
|
|
||||||
m_FadeDuration = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
glm::vec4 Color() const { return m_Color; }
|
|
||||||
void SetColor(glm::vec4 val) { m_Color = val; }
|
|
||||||
|
|
||||||
protected:
|
|
||||||
bool m_ScissorEnabled = true;
|
|
||||||
Texture* m_Texture = nullptr;
|
|
||||||
std::string m_TextureName;
|
|
||||||
Texture* m_FadeTexture = nullptr;
|
|
||||||
glm::vec4 m_Color = glm::vec4(1.f, 1.f, 1.f, 1.f);
|
|
||||||
float m_FadeDuration = 0.f;
|
|
||||||
float m_CurrentFade = 1.f;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -24,6 +24,19 @@
|
|||||||
#include "Network/EInterpolate.h"
|
#include "Network/EInterpolate.h"
|
||||||
#include "Network/SnapshotFilter.h"
|
#include "Network/SnapshotFilter.h"
|
||||||
#include "Core/EPlayerSpawned.h"
|
#include "Core/EPlayerSpawned.h"
|
||||||
|
#include "Network/ESearchForServers.h"
|
||||||
|
|
||||||
|
struct ServerInfo
|
||||||
|
{
|
||||||
|
ServerInfo(std::string a, int b, std::string c, int d)
|
||||||
|
{
|
||||||
|
Address = a; Port = b; Name = c; PlayersConnected = d;
|
||||||
|
}
|
||||||
|
std::string Address = "";
|
||||||
|
int Port = 0;
|
||||||
|
std::string Name = "";
|
||||||
|
int PlayersConnected = 0;
|
||||||
|
};
|
||||||
|
|
||||||
class Client : public Network
|
class Client : public Network
|
||||||
{
|
{
|
||||||
@@ -82,18 +95,22 @@ public:
|
|||||||
void parseTCPConnect(Packet& packet);
|
void parseTCPConnect(Packet& packet);
|
||||||
void parsePlayerConnected(Packet& packet);
|
void parsePlayerConnected(Packet& packet);
|
||||||
void parsePing();
|
void parsePing();
|
||||||
|
void parseServerlist(Packet& packet);
|
||||||
void parseKick();
|
void parseKick();
|
||||||
void parsePlayersSpawned(Packet& packet);
|
void parsePlayersSpawned(Packet& packet);
|
||||||
void parseEntityDeletion(Packet& packet);
|
void parseEntityDeletion(Packet& packet);
|
||||||
|
void parsePlayerDamage(Packet& packet);
|
||||||
void parseComponentDeletion(Packet& packet);
|
void parseComponentDeletion(Packet& packet);
|
||||||
void InterpolateFields(Packet & packet, const ComponentInfo & componentInfo, const EntityID & entityID, const std::string & componentType);
|
void InterpolateFields(Packet & packet, const ComponentInfo & componentInfo, const EntityID & entityID, const std::string & componentType);
|
||||||
void parseSnapshot(Packet& packet);
|
void parseSnapshot(Packet& packet);
|
||||||
|
void UpdateLocalCapturePointHUD(EntityWrapper capturePointHUD);
|
||||||
void identifyPacketLoss();
|
void identifyPacketLoss();
|
||||||
void hasServerTimedOut();
|
void hasServerTimedOut();
|
||||||
EntityID createPlayer();
|
EntityID createPlayer();
|
||||||
void sendInputCommands();
|
void sendInputCommands();
|
||||||
void sendLocalPlayerTransform();
|
void sendLocalPlayerTransform();
|
||||||
void becomePlayer();
|
void becomePlayer();
|
||||||
|
void displayServerlist();
|
||||||
// Mapping Logic
|
// Mapping Logic
|
||||||
// Returns if local EntityID exist in map
|
// Returns if local EntityID exist in map
|
||||||
bool clientServerMapsHasEntity(EntityID clientEntityID);
|
bool clientServerMapsHasEntity(EntityID clientEntityID);
|
||||||
@@ -109,10 +126,16 @@ public:
|
|||||||
bool OnPlayerDamage(const Events::PlayerDamage& e);
|
bool OnPlayerDamage(const Events::PlayerDamage& e);
|
||||||
EventRelay<Client, Events::PlayerSpawned> m_EPlayerSpawned;
|
EventRelay<Client, Events::PlayerSpawned> m_EPlayerSpawned;
|
||||||
bool OnPlayerSpawned(const Events::PlayerSpawned& e);
|
bool OnPlayerSpawned(const Events::PlayerSpawned& e);
|
||||||
void parsePlayerDamage(Packet& packet);
|
EventRelay< Client, Events::SearchForServers> m_ESearchForServers;
|
||||||
|
bool OnSearchForServers(const Events::SearchForServers& e);
|
||||||
private:
|
private:
|
||||||
UDPClient m_Unreliable;
|
UDPClient m_Unreliable;
|
||||||
|
UDPClient m_ServerlistRequest;
|
||||||
TCPClient m_Reliable;
|
TCPClient m_Reliable;
|
||||||
|
std::vector<ServerInfo> m_Serverlist;
|
||||||
|
bool m_SearchingForServers = false;
|
||||||
|
std::clock_t m_StartSearchTime;
|
||||||
|
double m_SearchingTime = 2000; // Config I guess
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
#ifndef Events_SearchForServers_h__
|
||||||
|
#define Events_SearchForServers_h__
|
||||||
|
|
||||||
|
#include "Core/Event.h"
|
||||||
|
|
||||||
|
namespace Events
|
||||||
|
{
|
||||||
|
|
||||||
|
struct SearchForServers : public Event { };
|
||||||
|
|
||||||
|
}
|
||||||
|
#endif
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
#ifndef HybridClient_h__
|
|
||||||
#define HybridClient_h__
|
|
||||||
|
|
||||||
class HybridClient
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
HybridClient();
|
|
||||||
~HybridClient();
|
|
||||||
private:
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
#ifndef HybridServer_h__
|
|
||||||
#define HybridServer_h__
|
|
||||||
|
|
||||||
class HybridServer
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
HybridServer();
|
|
||||||
~HybridServer();
|
|
||||||
private:
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -19,6 +19,7 @@ enum class MessageType
|
|||||||
EntityDeleted,
|
EntityDeleted,
|
||||||
ComponentDeleted,
|
ComponentDeleted,
|
||||||
PlayerTransform,
|
PlayerTransform,
|
||||||
|
ServerlistRequest,
|
||||||
Invalid
|
Invalid
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -9,13 +9,16 @@ typedef unsigned int PacketID;
|
|||||||
class NetworkClient
|
class NetworkClient
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
NetworkClient();
|
||||||
|
virtual ~NetworkClient();
|
||||||
virtual void Connect(std::string playerName, std::string address, int port) = 0;
|
virtual void Connect(std::string playerName, std::string address, int port) = 0;
|
||||||
virtual void Disconnect() = 0;
|
virtual void Disconnect() = 0;
|
||||||
virtual void Receive(Packet& packet) = 0;
|
virtual void Receive(Packet& packet) = 0;
|
||||||
virtual void Send(Packet & packet) = 0;
|
virtual void Send(Packet & packet) = 0;
|
||||||
virtual bool IsSocketAvailable() = 0;
|
virtual bool IsSocketAvailable() = 0;
|
||||||
protected:
|
protected:
|
||||||
char m_ReadBuffer[BUFFERSIZE] = { 0 };
|
char* m_ReadBuffer;
|
||||||
|
unsigned int m_BufferSize = BUFFERSIZE;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -10,12 +10,15 @@ typedef unsigned int PacketID;
|
|||||||
class NetworkServer
|
class NetworkServer
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
NetworkServer();
|
||||||
|
virtual ~NetworkServer();
|
||||||
virtual void AcceptNewConnections(int& nextPlayerID, std::map<PlayerID, PlayerDefinition>& connectedPlayers) = 0;
|
virtual void AcceptNewConnections(int& nextPlayerID, std::map<PlayerID, PlayerDefinition>& connectedPlayers) = 0;
|
||||||
virtual void Receive(Packet & packet, PlayerDefinition & playerDefinition) = 0;
|
virtual void Receive(Packet & packet, PlayerDefinition & playerDefinition) = 0;
|
||||||
virtual void Send(Packet & packet, PlayerDefinition & playerDefinition) = 0;
|
virtual void Send(Packet & packet, PlayerDefinition & playerDefinition) = 0;
|
||||||
virtual void Send(Packet & packet) = 0;
|
virtual void Send(Packet & packet) = 0;
|
||||||
protected:
|
protected:
|
||||||
char m_ReadBuffer[BUFFERSIZE] = { 0 };
|
char* m_ReadBuffer;
|
||||||
|
unsigned int m_BufferSize = BUFFERSIZE;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
#include "Network/TCPServer.h"
|
#include "Network/TCPServer.h"
|
||||||
#include "Network/UDPServer.h"
|
#include "Network/UDPServer.h"
|
||||||
|
#include "Network/UDPClient.h" //LOL
|
||||||
#include "Network/MessageType.h"
|
#include "Network/MessageType.h"
|
||||||
#include "Network/PlayerDefinition.h"
|
#include "Network/PlayerDefinition.h"
|
||||||
#include "Core/World.h"
|
#include "Core/World.h"
|
||||||
@@ -32,6 +33,7 @@ private:
|
|||||||
// Network channels
|
// Network channels
|
||||||
TCPServer m_Reliable;
|
TCPServer m_Reliable;
|
||||||
UDPServer m_Unreliable;
|
UDPServer m_Unreliable;
|
||||||
|
UDPServer m_ServerlistRequest;
|
||||||
// dont forget to set these in the childrens receive logic
|
// dont forget to set these in the childrens receive logic
|
||||||
boost::asio::ip::address m_Address;
|
boost::asio::ip::address m_Address;
|
||||||
int m_Port = 27666;
|
int m_Port = 27666;
|
||||||
@@ -54,7 +56,7 @@ private:
|
|||||||
std::vector<Events::InputCommand> m_InputCommandsToBroadcast;
|
std::vector<Events::InputCommand> m_InputCommandsToBroadcast;
|
||||||
//Timers
|
//Timers
|
||||||
std::clock_t m_StartPingTime;
|
std::clock_t m_StartPingTime;
|
||||||
|
|
||||||
// Packet loss logic
|
// Packet loss logic
|
||||||
PacketID m_PacketID = 0;
|
PacketID m_PacketID = 0;
|
||||||
PacketID m_PreviousPacketID = 0;
|
PacketID m_PreviousPacketID = 0;
|
||||||
@@ -64,6 +66,7 @@ private:
|
|||||||
void reliableBroadcast(Packet& packet);
|
void reliableBroadcast(Packet& packet);
|
||||||
void unreliableBroadcast(Packet& packet);
|
void unreliableBroadcast(Packet& packet);
|
||||||
void sendSnapshot();
|
void sendSnapshot();
|
||||||
|
void addPlayersToPacket(Packet& packet, EntityID entityID);
|
||||||
void addChildrenToPacket(Packet& packet, EntityID entityID);
|
void addChildrenToPacket(Packet& packet, EntityID entityID);
|
||||||
void addInputCommandsToPacket(Packet& packet);
|
void addInputCommandsToPacket(Packet& packet);
|
||||||
void sendPing();
|
void sendPing();
|
||||||
@@ -77,10 +80,11 @@ private:
|
|||||||
void parsePlayerTransform(Packet& packet);
|
void parsePlayerTransform(Packet& packet);
|
||||||
void parseOnInputCommand(Packet& packet);
|
void parseOnInputCommand(Packet& packet);
|
||||||
void parseClientPing();
|
void parseClientPing();
|
||||||
void parsePing();
|
void parsePing();
|
||||||
void parseUDPConnect(Packet & packet);
|
void parseUDPConnect(Packet & packet);
|
||||||
void parseTCPConnect(Packet & packet);
|
void parseTCPConnect(Packet & packet);
|
||||||
void parseDisconnect();
|
void parseDisconnect();
|
||||||
|
void parseServerlistRequest(boost::asio::ip::udp::endpoint endpoint);
|
||||||
bool shouldSendToClient(EntityWrapper childEntity);
|
bool shouldSendToClient(EntityWrapper childEntity);
|
||||||
|
|
||||||
// Debug event
|
// Debug event
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ private:
|
|||||||
boost::asio::ip::tcp::endpoint m_Endpoint;
|
boost::asio::ip::tcp::endpoint m_Endpoint;
|
||||||
boost::asio::io_service m_IOService;
|
boost::asio::io_service m_IOService;
|
||||||
std::unique_ptr<boost::asio::ip::tcp::socket> m_Socket;
|
std::unique_ptr<boost::asio::ip::tcp::socket> m_Socket;
|
||||||
size_t readBuffer(char* data);
|
size_t readBuffer();
|
||||||
PacketID m_SendPacketID = 0;
|
PacketID m_SendPacketID = 0;
|
||||||
bool m_IsConnected = false;
|
bool m_IsConnected = false;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -16,6 +16,9 @@ public:
|
|||||||
void Send(Packet & packet, PlayerDefinition & playerDefinition);
|
void Send(Packet & packet, PlayerDefinition & playerDefinition);
|
||||||
void Send(Packet & packet);
|
void Send(Packet & packet);
|
||||||
void Disconnect();
|
void Disconnect();
|
||||||
|
int Port() { return m_Port; }
|
||||||
|
std::string Address() { return m_Address; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// TCP logic
|
// TCP logic
|
||||||
boost::asio::io_service m_IOService;
|
boost::asio::io_service m_IOService;
|
||||||
@@ -25,7 +28,11 @@ private:
|
|||||||
void handle_accept(boost::shared_ptr<boost::asio::ip::tcp::socket> socket,
|
void handle_accept(boost::shared_ptr<boost::asio::ip::tcp::socket> socket,
|
||||||
int& nextPlayerID, std::map<PlayerID, PlayerDefinition>& connectedPlayers,
|
int& nextPlayerID, std::map<PlayerID, PlayerDefinition>& connectedPlayers,
|
||||||
const boost::system::error_code& error);
|
const boost::system::error_code& error);
|
||||||
int readBuffer(char* data, PlayerDefinition& playerDefinition);
|
int readBuffer(PlayerDefinition& playerDefinition);
|
||||||
|
int GetPort();
|
||||||
|
std::string GetAddress();
|
||||||
|
int m_Port = 0;
|
||||||
|
std::string m_Address = "";
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -14,13 +14,14 @@ public:
|
|||||||
void Disconnect();
|
void Disconnect();
|
||||||
void Receive(Packet& packet);
|
void Receive(Packet& packet);
|
||||||
void Send(Packet & packet);
|
void Send(Packet & packet);
|
||||||
|
void Broadcast(Packet& packet, int port);
|
||||||
bool IsSocketAvailable();
|
bool IsSocketAvailable();
|
||||||
private:
|
private:
|
||||||
// Assio UDP logic
|
// Assio UDP logic
|
||||||
boost::asio::io_service m_IOService;
|
boost::asio::io_service m_IOService;
|
||||||
boost::asio::ip::udp::endpoint m_ReceiverEndpoint;
|
boost::asio::ip::udp::endpoint m_ReceiverEndpoint;
|
||||||
boost::shared_ptr<boost::asio::ip::udp::socket> m_Socket;
|
boost::shared_ptr<boost::asio::ip::udp::socket> m_Socket;
|
||||||
int readBuffer(char* data);
|
int readBuffer();
|
||||||
PacketID m_SendPacketID = 0;
|
PacketID m_SendPacketID = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -8,18 +8,21 @@ class UDPServer : public NetworkServer
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
UDPServer();
|
UDPServer();
|
||||||
|
UDPServer(int port);
|
||||||
~UDPServer();
|
~UDPServer();
|
||||||
void AcceptNewConnections(int& nextPlayerID, std::map<PlayerID, PlayerDefinition>& connectedPlayers);
|
void AcceptNewConnections(int& nextPlayerID, std::map<PlayerID, PlayerDefinition>& connectedPlayers);
|
||||||
void Receive(Packet & packet, PlayerDefinition & playerDefinition);
|
void Receive(Packet & packet, PlayerDefinition & playerDefinition);
|
||||||
void Send(Packet & packet, PlayerDefinition & playerDefinition);
|
void Send(Packet & packet, PlayerDefinition & playerDefinition);
|
||||||
void Send(Packet & packet);
|
void Send(Packet & packet);
|
||||||
|
void Send(Packet & packet, boost::asio::ip::udp::endpoint endpoint);
|
||||||
|
void Broadcast(Packet & packet, int port);
|
||||||
bool IsSocketAvailable();
|
bool IsSocketAvailable();
|
||||||
private:
|
private:
|
||||||
// UDP logic
|
// UDP logic
|
||||||
boost::asio::io_service m_IOService;
|
boost::asio::io_service m_IOService;
|
||||||
boost::asio::ip::udp::endpoint m_ReceiverEndpoint;
|
boost::asio::ip::udp::endpoint m_ReceiverEndpoint;
|
||||||
std::unique_ptr<boost::asio::ip::udp::socket> m_Socket;
|
std::unique_ptr<boost::asio::ip::udp::socket> m_Socket;
|
||||||
int readBuffer(char* data);
|
int readBuffer();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
#ifndef CubeMapPass_h__
|
||||||
|
#define CubeMapPass_h__
|
||||||
|
|
||||||
|
#include "IRenderer.h"
|
||||||
|
#include "ShaderProgram.h"
|
||||||
|
|
||||||
|
class CubeMapPass
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
CubeMapPass(IRenderer* renderer);
|
||||||
|
~CubeMapPass() { }
|
||||||
|
|
||||||
|
void LoadTextures(std::string input);
|
||||||
|
void FillCubeMap(glm::vec3 originPosition);
|
||||||
|
void GenerateCubeMapTexture();
|
||||||
|
|
||||||
|
//GLuint CubeMapTexture() const { return m_CubeMapTexture; }
|
||||||
|
GLuint m_CubeMapTexture = -1;
|
||||||
|
|
||||||
|
private:
|
||||||
|
IRenderer* m_Renderer;
|
||||||
|
std::string m_PreviusCubeMapTexture;
|
||||||
|
|
||||||
|
std::vector<Texture*> m_CubeMapTextures;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -24,6 +24,8 @@ public:
|
|||||||
|
|
||||||
void Draw(GLuint texture);
|
void Draw(GLuint texture);
|
||||||
|
|
||||||
|
void OnWindowResize();
|
||||||
|
|
||||||
//Getters
|
//Getters
|
||||||
//Return the blurred result of the texture that was sent into draw
|
//Return the blurred result of the texture that was sent into draw
|
||||||
GLuint GaussianTexture() const { return m_GaussianTexture_vert; }
|
GLuint GaussianTexture() const { return m_GaussianTexture_vert; }
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
#include "IRenderer.h"
|
#include "IRenderer.h"
|
||||||
#include "DrawFinalPassState.h"
|
#include "DrawFinalPassState.h"
|
||||||
#include "LightCullingPass.h"
|
#include "LightCullingPass.h"
|
||||||
|
#include "CubeMapPass.h"
|
||||||
#include "FrameBuffer.h"
|
#include "FrameBuffer.h"
|
||||||
#include "ShaderProgram.h"
|
#include "ShaderProgram.h"
|
||||||
#include "Util/UnorderedMapVec2.h"
|
#include "Util/UnorderedMapVec2.h"
|
||||||
@@ -13,13 +14,14 @@
|
|||||||
class DrawFinalPass
|
class DrawFinalPass
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DrawFinalPass(IRenderer* renderer, LightCullingPass* lightCullingPass);
|
DrawFinalPass(IRenderer* renderer, LightCullingPass* lightCullingPass, CubeMapPass* cubeMapPass);
|
||||||
~DrawFinalPass() { }
|
~DrawFinalPass() { }
|
||||||
void InitializeTextures();
|
void InitializeTextures();
|
||||||
void InitializeFrameBuffers();
|
void InitializeFrameBuffers();
|
||||||
void InitializeShaderPrograms();
|
void InitializeShaderPrograms();
|
||||||
void Draw(RenderScene& scene);
|
void Draw(RenderScene& scene, GLuint SSAOTexture);
|
||||||
void ClearBuffer();
|
void ClearBuffer();
|
||||||
|
void OnWindowResize();
|
||||||
|
|
||||||
//Return the texture that is used in later stages to apply the bloom effect
|
//Return the texture that is used in later stages to apply the bloom effect
|
||||||
GLuint BloomTexture() const { return m_BloomTexture; }
|
GLuint BloomTexture() const { return m_BloomTexture; }
|
||||||
@@ -31,13 +33,12 @@ public:
|
|||||||
FrameBuffer* FinalPassFrameBuffer() { return &m_FinalPassFrameBuffer; }
|
FrameBuffer* FinalPassFrameBuffer() { return &m_FinalPassFrameBuffer; }
|
||||||
FrameBuffer* FinalPassFrameBufferLowRes() { return &m_FinalPassFrameBufferLowRes; }
|
FrameBuffer* FinalPassFrameBufferLowRes() { return &m_FinalPassFrameBufferLowRes; }
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void GenerateTexture(GLuint* texture, GLenum wrapping, GLenum filtering, glm::vec2 dimensions, GLint internalFormat, GLint format, GLenum type) const;
|
void GenerateTexture(GLuint* texture, GLenum wrapping, GLenum filtering, glm::vec2 dimensions, GLint internalFormat, GLint format, GLenum type) const;
|
||||||
void GenerateMipMapTexture(GLuint* texture, GLenum wrapping, glm::vec2 dimensions, GLint format, GLenum type, GLint numMipMaps) const;
|
void GenerateMipMapTexture(GLuint* texture, GLenum wrapping, glm::vec2 dimensions, GLint format, GLenum type, GLint numMipMaps) const;
|
||||||
|
|
||||||
void DrawSprites(std::list<std::shared_ptr<RenderJob>>&jobs, RenderScene& scene);
|
void DrawSprites(std::list<std::shared_ptr<RenderJob>>&jobs, RenderScene& scene);
|
||||||
void DrawModelRenderQueues(std::list<std::shared_ptr<RenderJob>>& jobs, RenderScene& scene);
|
void DrawModelRenderQueues(std::list<std::shared_ptr<RenderJob>>& jobs, RenderScene& scene, GLuint SSAOTexture);
|
||||||
void DrawShieldToStencilBuffer(std::list<std::shared_ptr<RenderJob>>& jobs, RenderScene& scene);
|
void DrawShieldToStencilBuffer(std::list<std::shared_ptr<RenderJob>>& jobs, RenderScene& scene);
|
||||||
void DrawShieldedModelRenderQueue(std::list<std::shared_ptr<RenderJob>>& jobs, RenderScene& scene);
|
void DrawShieldedModelRenderQueue(std::list<std::shared_ptr<RenderJob>>& jobs, RenderScene& scene);
|
||||||
void DrawToDepthBuffer(std::list<std::shared_ptr<RenderJob>>& jobs, RenderScene& scene);
|
void DrawToDepthBuffer(std::list<std::shared_ptr<RenderJob>>& jobs, RenderScene& scene);
|
||||||
@@ -62,12 +63,14 @@ private:
|
|||||||
GLuint m_SceneTextureLowRes;
|
GLuint m_SceneTextureLowRes;
|
||||||
GLuint m_DepthBuffer;
|
GLuint m_DepthBuffer;
|
||||||
GLuint m_DepthBufferLowRes;
|
GLuint m_DepthBufferLowRes;
|
||||||
|
GLuint m_CubeMapTexture;
|
||||||
|
|
||||||
//maqke this component based i guess?
|
//maqke this component based i guess?
|
||||||
GLuint m_ShieldPixelRate = 16;
|
GLuint m_ShieldPixelRate = 16;
|
||||||
|
|
||||||
const IRenderer* m_Renderer;
|
const IRenderer* m_Renderer;
|
||||||
const LightCullingPass* m_LightCullingPass;
|
const LightCullingPass* m_LightCullingPass;
|
||||||
|
const CubeMapPass* m_CubeMapPass;
|
||||||
|
|
||||||
ShaderProgram* m_ForwardPlusProgram;
|
ShaderProgram* m_ForwardPlusProgram;
|
||||||
ShaderProgram* m_ExplosionEffectProgram;
|
ShaderProgram* m_ExplosionEffectProgram;
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ public:
|
|||||||
void SetSSBOSizes();
|
void SetSSBOSizes();
|
||||||
void CullLights(RenderScene& scene);
|
void CullLights(RenderScene& scene);
|
||||||
void FillLightList(RenderScene& scene);
|
void FillLightList(RenderScene& scene);
|
||||||
|
void OnWindowResize();
|
||||||
|
|
||||||
GLuint FrustumSSBO() const { return m_FrustumSSBO; }
|
GLuint FrustumSSBO() const { return m_FrustumSSBO; }
|
||||||
GLuint LightSSBO() const { return m_LightSSBO; }
|
GLuint LightSSBO() const { return m_LightSSBO; }
|
||||||
|
|||||||
@@ -108,6 +108,7 @@ struct ModelJob : RenderJob
|
|||||||
EndIndex = matGroup->EndIndex;
|
EndIndex = matGroup->EndIndex;
|
||||||
Matrix = matrix;
|
Matrix = matrix;
|
||||||
Color = modelComponent["Color"];
|
Color = modelComponent["Color"];
|
||||||
|
GlowIntensity = ((double)modelComponent["GlowIntensity"]);
|
||||||
Entity = modelComponent.EntityID;
|
Entity = modelComponent.EntityID;
|
||||||
glm::vec3 abspos = Transform::AbsolutePosition(world, modelComponent.EntityID);
|
glm::vec3 abspos = Transform::AbsolutePosition(world, modelComponent.EntityID);
|
||||||
glm::vec3 worldpos = glm::vec3(camera->ViewMatrix() * glm::vec4(abspos, 1));
|
glm::vec3 worldpos = glm::vec3(camera->ViewMatrix() * glm::vec4(abspos, 1));
|
||||||
@@ -170,7 +171,7 @@ struct ModelJob : RenderJob
|
|||||||
::Skeleton::AnimationOffset AnimationOffset;
|
::Skeleton::AnimationOffset AnimationOffset;
|
||||||
|
|
||||||
|
|
||||||
|
float GlowIntensity = 8.0;
|
||||||
glm::vec4 DiffuseColor;
|
glm::vec4 DiffuseColor;
|
||||||
glm::vec4 SpecularColor;
|
glm::vec4 SpecularColor;
|
||||||
glm::vec4 IncandescenceColor;
|
glm::vec4 IncandescenceColor;
|
||||||
@@ -183,7 +184,7 @@ struct ModelJob : RenderJob
|
|||||||
|
|
||||||
void CalculateHash() override
|
void CalculateHash() override
|
||||||
{
|
{
|
||||||
Hash = TextureID + ModelID << 10 + ShaderID << 20;
|
Hash = ShaderID << 20 + ModelID << 10 + TextureID;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ public:
|
|||||||
void Draw(RenderScene& scene);
|
void Draw(RenderScene& scene);
|
||||||
void ClearPicking();
|
void ClearPicking();
|
||||||
|
|
||||||
|
void OnWindowResize();
|
||||||
|
|
||||||
//Getters
|
//Getters
|
||||||
const ShaderProgram& PickingProgram() const { return *m_PickingProgram; }
|
const ShaderProgram& PickingProgram() const { return *m_PickingProgram; }
|
||||||
//const std::unordered_map<glm::ivec2, EntityID>& PickingColorsToEntity() const { return m_PickingColorsToEntity; }
|
//const std::unordered_map<glm::ivec2, EntityID>& PickingColorsToEntity() const { return m_PickingColorsToEntity; }
|
||||||
@@ -40,7 +42,7 @@ private:
|
|||||||
const IRenderer* m_Renderer;
|
const IRenderer* m_Renderer;
|
||||||
|
|
||||||
ShaderProgram* m_PickingProgram;
|
ShaderProgram* m_PickingProgram;
|
||||||
ShaderProgram* m_PickingSkinnedProgram;
|
ShaderProgram* m_PickingSkinnedProgram;
|
||||||
Camera* m_Camera;
|
Camera* m_Camera;
|
||||||
|
|
||||||
struct PickingInfo
|
struct PickingInfo
|
||||||
|
|||||||
@@ -16,6 +16,8 @@
|
|||||||
#include "DrawScreenQuadPass.h"
|
#include "DrawScreenQuadPass.h"
|
||||||
#include "DrawBloomPass.h"
|
#include "DrawBloomPass.h"
|
||||||
#include "DrawColorCorrectionPass.h"
|
#include "DrawColorCorrectionPass.h"
|
||||||
|
#include "SSAOPass.h"
|
||||||
|
#include "CubeMapPass.h"
|
||||||
#include "../Core/EventBroker.h"
|
#include "../Core/EventBroker.h"
|
||||||
#include "ImGuiRenderPass.h"
|
#include "ImGuiRenderPass.h"
|
||||||
#include "Camera.h"
|
#include "Camera.h"
|
||||||
@@ -23,9 +25,12 @@
|
|||||||
#include "imgui/imgui.h"
|
#include "imgui/imgui.h"
|
||||||
#include "TextPass.h"
|
#include "TextPass.h"
|
||||||
#include "Util/CommonFunctions.h"
|
#include "Util/CommonFunctions.h"
|
||||||
|
#include "Core/PerformanceTimer.h"
|
||||||
|
|
||||||
class Renderer : public IRenderer
|
class Renderer : public IRenderer
|
||||||
{
|
{
|
||||||
|
static void glfwFrameBufferCallback(GLFWwindow* window, int width, int height);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Renderer(EventBroker* eventBroker)
|
Renderer(EventBroker* eventBroker)
|
||||||
: m_EventBroker(eventBroker)
|
: m_EventBroker(eventBroker)
|
||||||
@@ -37,8 +42,12 @@ public:
|
|||||||
|
|
||||||
virtual PickData Pick(glm::vec2 screenCoord) override;
|
virtual PickData Pick(glm::vec2 screenCoord) override;
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
//----------------------Variables----------------------//
|
//----------------------Variables----------------------//
|
||||||
|
|
||||||
|
static std::unordered_map <GLFWwindow*, Renderer*> m_WindowToRenderer;
|
||||||
|
|
||||||
EventBroker* m_EventBroker;
|
EventBroker* m_EventBroker;
|
||||||
TextPass* m_TextPass;
|
TextPass* m_TextPass;
|
||||||
|
|
||||||
@@ -50,6 +59,14 @@ private:
|
|||||||
Model* m_UnitSphere;
|
Model* m_UnitSphere;
|
||||||
|
|
||||||
int m_DebugTextureToDraw = 0;
|
int m_DebugTextureToDraw = 0;
|
||||||
|
int m_CubeMapTexture = 0;
|
||||||
|
bool m_ResizeWindow = false;
|
||||||
|
float m_SSAO_Radius = 1.0f;
|
||||||
|
float m_SSAO_Bias = 0.05f;
|
||||||
|
float m_SSAO_Contrast = 1.5f;
|
||||||
|
float m_SSAO_IntensityScale = 1.0f;
|
||||||
|
int m_SSAO_NumOfSamples = 24;
|
||||||
|
int m_SSAO_NumOfTurns = 7;
|
||||||
|
|
||||||
PickingPass* m_PickingPass;
|
PickingPass* m_PickingPass;
|
||||||
LightCullingPass* m_LightCullingPass;
|
LightCullingPass* m_LightCullingPass;
|
||||||
@@ -58,6 +75,8 @@ private:
|
|||||||
DrawScreenQuadPass* m_DrawScreenQuadPass;
|
DrawScreenQuadPass* m_DrawScreenQuadPass;
|
||||||
DrawBloomPass* m_DrawBloomPass;
|
DrawBloomPass* m_DrawBloomPass;
|
||||||
DrawColorCorrectionPass* m_DrawColorCorrectionPass;
|
DrawColorCorrectionPass* m_DrawColorCorrectionPass;
|
||||||
|
SSAOPass* m_SSAOPass;
|
||||||
|
CubeMapPass* m_CubeMapPass;
|
||||||
|
|
||||||
//----------------------Functions----------------------//
|
//----------------------Functions----------------------//
|
||||||
void InitializeWindow();
|
void InitializeWindow();
|
||||||
|
|||||||
@@ -0,0 +1,63 @@
|
|||||||
|
#ifndef SSAOPass_h__
|
||||||
|
#define SSAOPass_h__
|
||||||
|
|
||||||
|
#include "IRenderer.h"
|
||||||
|
#include "SSAOPassState.h"
|
||||||
|
//#include "LightCullingPass.h" Finalpass om den skall skickas in
|
||||||
|
#include "FrameBuffer.h"
|
||||||
|
#include "ShaderProgram.h"
|
||||||
|
#include "DrawBloomPass.h"
|
||||||
|
//#include "Util/UnorderedMapVec2.h"
|
||||||
|
#include "Texture.h"
|
||||||
|
|
||||||
|
class SSAOPass
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
SSAOPass(IRenderer* rendere);
|
||||||
|
~SSAOPass() {
|
||||||
|
delete m_DrawBloomPass;
|
||||||
|
};
|
||||||
|
|
||||||
|
void Draw(GLuint depthBuffer, Camera* camera);
|
||||||
|
void Setting(float radius, float bias, float contrast, float intensityScale, int numOfSamples, int NumOfTurns);
|
||||||
|
void ClearBuffer();
|
||||||
|
void OnWindowResize();
|
||||||
|
|
||||||
|
//Return the SSAO of the texture sent to Draw
|
||||||
|
GLuint SSAOTexture() const { return m_DrawBloomPass->GaussianTexture(); }
|
||||||
|
|
||||||
|
private:
|
||||||
|
void InitializeTexture();
|
||||||
|
void InitializeFrameBuffer();
|
||||||
|
void InitializeShaderProgram();
|
||||||
|
void InitializeBuffer();
|
||||||
|
|
||||||
|
void GenerateTexture(GLuint* texture, GLenum wrapping, GLenum filtering, glm::vec2 dimensions, GLint internalFormat, GLint format, GLenum type) const;
|
||||||
|
|
||||||
|
//void blurHorizontal(GLuint depthBuffer);
|
||||||
|
//void blurVertical(GLuint depthBuffer);
|
||||||
|
|
||||||
|
Model* m_ScreenQuad;
|
||||||
|
|
||||||
|
const IRenderer* m_Renderer;
|
||||||
|
|
||||||
|
float m_Radius;
|
||||||
|
float m_Bias;
|
||||||
|
float m_Contrast;
|
||||||
|
float m_IntensityScale;
|
||||||
|
int m_NumOfSamples;
|
||||||
|
int m_NumOfTurns;
|
||||||
|
|
||||||
|
GLuint m_SSAOTexture;
|
||||||
|
FrameBuffer m_SSAOFramBuffer;
|
||||||
|
|
||||||
|
GLuint m_SSAOViewSpaceZTexture;
|
||||||
|
FrameBuffer m_SSAOViewSpaceZFramBuffer;
|
||||||
|
|
||||||
|
ShaderProgram* m_SSAOProgram;
|
||||||
|
ShaderProgram* m_SSAOViewSpaceZProgram;
|
||||||
|
|
||||||
|
DrawBloomPass* m_DrawBloomPass;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
#ifndef SSAOPassState_h__
|
||||||
|
#define SSAOPassState_h__
|
||||||
|
|
||||||
|
#include "Rendering/RenderState.h"
|
||||||
|
|
||||||
|
class SSAOPassState : public RenderState
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
SSAOPassState();
|
||||||
|
~SSAOPassState();
|
||||||
|
private:
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
struct SpriteJob : RenderJob
|
struct SpriteJob : RenderJob
|
||||||
{
|
{
|
||||||
SpriteJob(ComponentWrapper cSprite, Camera* camera, glm::mat4 matrix, World* world, glm::vec4 fillColor, float fillPercentage, bool depthSorted)
|
SpriteJob(ComponentWrapper cSprite, Camera* camera, glm::mat4 matrix, World* world, glm::vec4 fillColor, float fillPercentage, bool depthSorted, bool isIndicator)
|
||||||
: RenderJob()
|
: RenderJob()
|
||||||
{
|
{
|
||||||
Model = ResourceManager::Load<::Model>("Models/Core/UnitQuad.mesh");
|
Model = ResourceManager::Load<::Model>("Models/Core/UnitQuad.mesh");
|
||||||
@@ -30,7 +30,7 @@ struct SpriteJob : RenderJob
|
|||||||
|
|
||||||
StartIndex = matProp.material->StartIndex;
|
StartIndex = matProp.material->StartIndex;
|
||||||
EndIndex = matProp.material->EndIndex;
|
EndIndex = matProp.material->EndIndex;
|
||||||
Matrix = matrix;
|
Matrix = matrix;
|
||||||
Color = cSprite["Color"];
|
Color = cSprite["Color"];
|
||||||
Entity = cSprite.EntityID;
|
Entity = cSprite.EntityID;
|
||||||
Position = Transform::AbsolutePosition(world, cSprite.EntityID);
|
Position = Transform::AbsolutePosition(world, cSprite.EntityID);
|
||||||
@@ -40,6 +40,8 @@ struct SpriteJob : RenderJob
|
|||||||
Depth = viewpos.z;
|
Depth = viewpos.z;
|
||||||
}
|
}
|
||||||
World = world;
|
World = world;
|
||||||
|
Pickable = world->HasComponent(cSprite.EntityID, "Button");
|
||||||
|
IsIndicator = isIndicator;
|
||||||
|
|
||||||
FillColor = fillColor;
|
FillColor = fillColor;
|
||||||
FillPercentage = fillPercentage;
|
FillPercentage = fillPercentage;
|
||||||
@@ -61,6 +63,9 @@ struct SpriteJob : RenderJob
|
|||||||
unsigned int EndIndex = 0;
|
unsigned int EndIndex = 0;
|
||||||
World* World;
|
World* World;
|
||||||
|
|
||||||
|
bool Pickable;
|
||||||
|
bool IsIndicator = false;
|
||||||
|
|
||||||
glm::vec4 FillColor = glm::vec4(0);
|
glm::vec4 FillColor = glm::vec4(0);
|
||||||
float FillPercentage = 0.0;
|
float FillPercentage = 0.0;
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ public:
|
|||||||
void Bind(GLenum textureUnit = GL_TEXTURE0);
|
void Bind(GLenum textureUnit = GL_TEXTURE0);
|
||||||
|
|
||||||
GLuint m_Texture = 0;
|
GLuint m_Texture = 0;
|
||||||
|
unsigned char* Data = nullptr;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+3
-2
@@ -8,7 +8,6 @@
|
|||||||
#include "Core/EventBroker.h"
|
#include "Core/EventBroker.h"
|
||||||
#include "Rendering/Renderer.h"
|
#include "Rendering/Renderer.h"
|
||||||
#include "Core/InputManager.h"
|
#include "Core/InputManager.h"
|
||||||
#include "GUI/Frame.h"
|
|
||||||
#include "Core/World.h"
|
#include "Core/World.h"
|
||||||
#include "Input/InputProxy.h"
|
#include "Input/InputProxy.h"
|
||||||
#include "Input/KeyboardInputHandler.h"
|
#include "Input/KeyboardInputHandler.h"
|
||||||
@@ -35,6 +34,9 @@
|
|||||||
#include "Sound/SoundManager.h"
|
#include "Sound/SoundManager.h"
|
||||||
#include "Systems/SoundSystem.h"
|
#include "Systems/SoundSystem.h"
|
||||||
|
|
||||||
|
//Performance
|
||||||
|
#include "Core/PerformanceTimer.h"
|
||||||
|
|
||||||
class Game
|
class Game
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -53,7 +55,6 @@ private:
|
|||||||
IRenderer* m_Renderer;
|
IRenderer* m_Renderer;
|
||||||
InputManager* m_InputManager;
|
InputManager* m_InputManager;
|
||||||
InputProxy* m_InputProxy;
|
InputProxy* m_InputProxy;
|
||||||
GUI::Frame* m_FrameStack;
|
|
||||||
World* m_World;
|
World* m_World;
|
||||||
Octree<EntityAABB>* m_OctreeCollision;
|
Octree<EntityAABB>* m_OctreeCollision;
|
||||||
Octree<EntityAABB>* m_OctreeTrigger;
|
Octree<EntityAABB>* m_OctreeTrigger;
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ private:
|
|||||||
double AmmoGain;
|
double AmmoGain;
|
||||||
double RespawnTimer;
|
double RespawnTimer;
|
||||||
double DecreaseThisRespawnTimer;
|
double DecreaseThisRespawnTimer;
|
||||||
|
EntityID parentID;
|
||||||
};
|
};
|
||||||
std::vector<NewAmmoPickup> m_ETriggerTouchVector;
|
std::vector<NewAmmoPickup> m_ETriggerTouchVector;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -14,11 +14,13 @@
|
|||||||
#include <glm/gtx/vector_angle.hpp>
|
#include <glm/gtx/vector_angle.hpp>
|
||||||
|
|
||||||
#include "Rendering/Util/CommonFunctions.h"
|
#include "Rendering/Util/CommonFunctions.h"
|
||||||
|
//#define INDICATOR_TEST
|
||||||
|
|
||||||
class DamageIndicatorSystem : public System
|
class DamageIndicatorSystem : public ImpureSystem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DamageIndicatorSystem(SystemParams params);
|
DamageIndicatorSystem(SystemParams params);
|
||||||
|
virtual void Update(double dt) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
EventRelay<DamageIndicatorSystem, Events::PlayerDamage> m_EPlayerDamage;
|
EventRelay<DamageIndicatorSystem, Events::PlayerDamage> m_EPlayerDamage;
|
||||||
@@ -28,6 +30,20 @@ private:
|
|||||||
bool OnSetCamera(const Events::SetCamera& e);
|
bool OnSetCamera(const Events::SetCamera& e);
|
||||||
|
|
||||||
EntityID m_CurrentCamera = -1;
|
EntityID m_CurrentCamera = -1;
|
||||||
|
struct DamageIndicatorStruct {
|
||||||
|
EntityWrapper spriteEntity;
|
||||||
|
glm::vec3 enemyPosition;
|
||||||
|
DamageIndicatorStruct(EntityWrapper sprite, glm::vec3 pos)
|
||||||
|
: spriteEntity(sprite)
|
||||||
|
, enemyPosition(pos) {}
|
||||||
|
};
|
||||||
|
std::vector<DamageIndicatorStruct> updateDamageIndicatorVector;
|
||||||
|
float CalculateAngle(EntityWrapper player, glm::vec3 enemyPos);
|
||||||
|
|
||||||
|
//for tests
|
||||||
|
#ifdef INDICATOR_TEST
|
||||||
|
glm::vec3 DamageIndicatorTest(EntityWrapper player);
|
||||||
|
int m_TestVar = 0;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -27,17 +27,16 @@ public:
|
|||||||
private:
|
private:
|
||||||
bool m_NetworkEnabled;
|
bool m_NetworkEnabled;
|
||||||
|
|
||||||
//methods which will take care of specific events
|
// methods which will take care of specific events
|
||||||
EventRelay<HealthSystem, Events::PlayerDamage> m_EPlayerDamage;
|
EventRelay<HealthSystem, Events::PlayerDamage> m_EPlayerDamage;
|
||||||
bool HealthSystem::OnPlayerDamaged(Events::PlayerDamage& e);
|
bool HealthSystem::OnPlayerDamaged(Events::PlayerDamage& e);
|
||||||
EventRelay<HealthSystem, Events::PlayerHealthPickup> m_EPlayerHealthPickup;
|
EventRelay<HealthSystem, Events::PlayerHealthPickup> m_EPlayerHealthPickup;
|
||||||
bool HealthSystem::OnPlayerHealthPickup(Events::PlayerHealthPickup& e);
|
bool HealthSystem::OnPlayerHealthPickup(Events::PlayerHealthPickup& e);
|
||||||
EventRelay<HealthSystem, Events::InputCommand> m_InputCommand;
|
EventRelay<HealthSystem, Events::InputCommand> m_InputCommand;
|
||||||
bool HealthSystem::OnInputCommand(Events::InputCommand& e);
|
bool HealthSystem::OnInputCommand(Events::InputCommand& e);
|
||||||
|
|
||||||
//vector which will keep track of health changes
|
//vector which will keep track of health changes
|
||||||
std::vector<std::tuple<EntityID, double>> m_DeltaHealthVector;
|
std::vector<std::tuple<EntityID, double>> m_DeltaHealthVector;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -27,6 +27,7 @@ private:
|
|||||||
double HealthGain;
|
double HealthGain;
|
||||||
double RespawnTimer;
|
double RespawnTimer;
|
||||||
double DecreaseThisRespawnTimer;
|
double DecreaseThisRespawnTimer;
|
||||||
|
EntityID parentID;
|
||||||
};
|
};
|
||||||
std::vector<NewHealthPickup> m_ETriggerTouchVector;
|
std::vector<NewHealthPickup> m_ETriggerTouchVector;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -39,5 +39,5 @@ private:
|
|||||||
bool OnPlayerSpawned(Events::PlayerSpawned& e);
|
bool OnPlayerSpawned(Events::PlayerSpawned& e);
|
||||||
|
|
||||||
void updateMovementControllers(double dt);
|
void updateMovementControllers(double dt);
|
||||||
void updateVelocity(double dt);
|
void updateVelocity(EntityWrapper player, double dt);
|
||||||
};
|
};
|
||||||
@@ -15,11 +15,16 @@ class SpawnerSystem : public System
|
|||||||
public:
|
public:
|
||||||
SpawnerSystem(SystemParams params);
|
SpawnerSystem(SystemParams params);
|
||||||
|
|
||||||
static EntityWrapper Spawn(EntityWrapper spawner, EntityWrapper parent = EntityWrapper::Invalid);
|
// If dontCollideComponent is set, to e.g. "Player", then all the spawner
|
||||||
|
// will try to pick a spawn location so that the spawned entity doesn't
|
||||||
|
// collide with anything that has that component and is collidable.
|
||||||
|
static EntityWrapper Spawn(EntityWrapper spawner, EntityWrapper parent = EntityWrapper::Invalid, const std::string& dontCollideComponent = "");
|
||||||
|
|
||||||
private:
|
private:
|
||||||
EventRelay<SpawnerSystem, Events::SpawnerSpawn> m_OnSpawnerSpawn;
|
EventRelay<SpawnerSystem, Events::SpawnerSpawn> m_OnSpawnerSpawn;
|
||||||
bool OnSpawnerSpawn(Events::SpawnerSpawn& e);
|
bool OnSpawnerSpawn(Events::SpawnerSpawn& e);
|
||||||
|
static void transformEntityToSpawnPoint(EntityWrapper spawnedEntity, EntityWrapper spawnPoint);
|
||||||
|
static bool spawnedEntityIsColliding(EntityWrapper spawnedEntity, EntityWrapper spawnPoint, const std::string& dontCollideComponent);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -1,13 +1,14 @@
|
|||||||
|
#ifndef AssaultWeaponBehaviour_h__
|
||||||
|
#define AssaultWeaponBehaviour_h__
|
||||||
|
|
||||||
#include "Sound/EPlaySoundOnEntity.h"
|
#include "Sound/EPlaySoundOnEntity.h"
|
||||||
#include "Collision/Collision.h"
|
#include "Collision/Collision.h"
|
||||||
#include "Rendering/AnimationSystem.h"
|
|
||||||
#include "Core/ConfigFile.h"
|
#include "Core/ConfigFile.h"
|
||||||
#include "WeaponBehaviour.h"
|
#include "WeaponBehaviour.h"
|
||||||
#include "../SpawnerSystem.h"
|
#include "../SpawnerSystem.h"
|
||||||
#include "Core/EPlayerDamage.h"
|
#include "Core/EPlayerDamage.h"
|
||||||
#include "Core/EShoot.h"
|
#include "Core/EShoot.h"
|
||||||
|
|
||||||
|
|
||||||
class AssaultWeaponBehaviour : public WeaponBehaviour
|
class AssaultWeaponBehaviour : public WeaponBehaviour
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -22,16 +23,13 @@ public:
|
|||||||
private:
|
private:
|
||||||
EntityWrapper m_FirstPersonModel;
|
EntityWrapper m_FirstPersonModel;
|
||||||
EntityWrapper m_ThirdPersonModel;
|
EntityWrapper m_ThirdPersonModel;
|
||||||
|
|
||||||
// State
|
// State
|
||||||
bool m_Firing = false;
|
bool m_Firing = false;
|
||||||
bool m_Reloading = false;
|
bool m_Reloading = false;
|
||||||
double m_ReloadTimer = 0.0;
|
double m_ReloadTimer = 0.0;
|
||||||
EntityWrapper m_FirstPersonReloadImpersonator;
|
|
||||||
EntityWrapper m_ThirdPersonReloadImpersonator;
|
|
||||||
double m_TimeSinceLastFire = 0.0;
|
double m_TimeSinceLastFire = 0.0;
|
||||||
|
EntityWrapper m_FirstPersonReloadImpostor;
|
||||||
EventRelay<WeaponBehaviour, Events::AnimationComplete> m_EAnimationComplete;
|
|
||||||
bool OnAnimationComplete(Events::AnimationComplete& e);
|
|
||||||
|
|
||||||
bool hasAmmo();
|
bool hasAmmo();
|
||||||
void fireRound();
|
void fireRound();
|
||||||
@@ -47,3 +45,5 @@ private:
|
|||||||
bool shoot(double damage);
|
bool shoot(double damage);
|
||||||
void showHitMarker();
|
void showHitMarker();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
#include "WeaponBehaviour.h"
|
||||||
|
|
||||||
|
class DefenderWeaponBehaviour : public WeaponBehaviour
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
DefenderWeaponBehaviour(SystemParams systemParams, IRenderer* renderer, Octree<EntityAABB>* collisionOctree, EntityWrapper weaponEntity);
|
||||||
|
|
||||||
|
virtual void Fire() override;
|
||||||
|
//virtual void CeaseFire() override;
|
||||||
|
//virtual void Reload() override;
|
||||||
|
|
||||||
|
//virtual void Update(double dt) override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
double m_TimeSinceLastFire = 0.0;
|
||||||
|
};
|
||||||
@@ -8,17 +8,21 @@
|
|||||||
|
|
||||||
class WeaponBehaviour : public System
|
class WeaponBehaviour : public System
|
||||||
{
|
{
|
||||||
|
friend class WeaponSystem;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
WeaponBehaviour(SystemParams systemParams, IRenderer* renderer, Octree<EntityAABB>* collisionOctree, EntityWrapper player)
|
WeaponBehaviour(SystemParams systemParams, IRenderer* renderer, Octree<EntityAABB>* collisionOctree, EntityWrapper player, EntityWrapper firstPersonWeapon, EntityWrapper thirdPersonWeapon)
|
||||||
: System(systemParams)
|
: System(systemParams)
|
||||||
, m_Renderer(renderer)
|
, m_Renderer(renderer)
|
||||||
, m_CollisionOctree(collisionOctree)
|
, m_CollisionOctree(collisionOctree)
|
||||||
, m_Player(player)
|
, m_Player(player)
|
||||||
|
, m_FirstPerson(firstPersonWeapon)
|
||||||
|
, m_ThirdPerson(thirdPersonWeapon)
|
||||||
{ }
|
{ }
|
||||||
virtual ~WeaponBehaviour() = default;
|
virtual ~WeaponBehaviour() = default;
|
||||||
|
|
||||||
WeaponBehaviour(const WeaponBehaviour&) = delete;
|
WeaponBehaviour(const WeaponBehaviour&) = delete;
|
||||||
WeaponBehaviour& operator=(const WeaponBehaviour &) = delete;
|
WeaponBehaviour& operator=(const WeaponBehaviour&) = delete;
|
||||||
|
|
||||||
virtual void Fire() = 0;
|
virtual void Fire() = 0;
|
||||||
virtual void CeaseFire() { }
|
virtual void CeaseFire() { }
|
||||||
@@ -29,6 +33,8 @@ protected:
|
|||||||
IRenderer* m_Renderer;
|
IRenderer* m_Renderer;
|
||||||
Octree<EntityAABB>* m_CollisionOctree;
|
Octree<EntityAABB>* m_CollisionOctree;
|
||||||
EntityWrapper m_Player;
|
EntityWrapper m_Player;
|
||||||
|
EntityWrapper m_FirstPerson;
|
||||||
|
EntityWrapper m_ThirdPerson;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -25,4 +25,6 @@ C=ConnectToServer
|
|||||||
N=SwitchToServer
|
N=SwitchToServer
|
||||||
M=SwitchToClient
|
M=SwitchToClient
|
||||||
P=SwitchToPlayer
|
P=SwitchToPlayer
|
||||||
K=TakeDamage,1500
|
K=TakeDamage,1500
|
||||||
|
F2=PerformanceTimingResetAllTimers
|
||||||
|
F3=PerformanceTimingCreateExcelData
|
||||||
@@ -41,5 +41,10 @@
|
|||||||
<xs:include schemaLocation="Components/Shielded.xsd"/>
|
<xs:include schemaLocation="Components/Shielded.xsd"/>
|
||||||
<xs:include schemaLocation="Components/CapturePointHUD.xsd"/>
|
<xs:include schemaLocation="Components/CapturePointHUD.xsd"/>
|
||||||
<xs:include schemaLocation="Components/AmmunitionHUD.xsd"/>
|
<xs:include schemaLocation="Components/AmmunitionHUD.xsd"/>
|
||||||
|
<xs:include schemaLocation="Components/Menu.xsd"/>
|
||||||
<xs:include schemaLocation="Components/KillFeed.xsd"/>
|
<xs:include schemaLocation="Components/KillFeed.xsd"/>
|
||||||
|
<xs:include schemaLocation="Components/Page.xsd"/>
|
||||||
|
<xs:include schemaLocation="Components/SpriteIndicator.xsd"/>
|
||||||
|
<xs:include schemaLocation="Components/Button.xsd"/>
|
||||||
|
<xs:include schemaLocation="Components/WeaponAttachment.xsd"/>
|
||||||
</xs:schema>
|
</xs:schema>
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<Button xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Button.xsd">
|
||||||
|
</Button>
|
||||||
@@ -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="Button">
|
||||||
|
<xs:annotation>
|
||||||
|
<xs:documentation>Makes sprites klickable.</xs:documentation>
|
||||||
|
</xs:annotation>
|
||||||
|
</xs:element>
|
||||||
|
</xs:schema>
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<Menu xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Menu.xsd">
|
||||||
|
</Menu>
|
||||||
@@ -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="Menu">
|
||||||
|
<xs:annotation>
|
||||||
|
<xs:documentation>Attach this to the center point of a menu that uses several pages.</xs:documentation>
|
||||||
|
</xs:annotation>
|
||||||
|
</xs:element>
|
||||||
|
</xs:schema>
|
||||||
@@ -8,4 +8,5 @@
|
|||||||
<NormalMap>true</NormalMap>
|
<NormalMap>true</NormalMap>
|
||||||
<SpecularMap>true</SpecularMap>
|
<SpecularMap>true</SpecularMap>
|
||||||
<GlowMap>true</GlowMap>
|
<GlowMap>true</GlowMap>
|
||||||
|
<GlowIntensity>3.0</GlowIntensity>
|
||||||
</Model>
|
</Model>
|
||||||
@@ -33,6 +33,9 @@
|
|||||||
<xs:element name="GlowMap" type="t:bool" minOccurs="0">
|
<xs:element name="GlowMap" type="t:bool" minOccurs="0">
|
||||||
<xs:annotation><xs:documentation>Whether the model should use the Glowmap or not</xs:documentation></xs:annotation>
|
<xs:annotation><xs:documentation>Whether the model should use the Glowmap or not</xs:documentation></xs:annotation>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
|
<xs:element name="GlowIntensity" type="t:double" minOccurs="0">
|
||||||
|
<xs:annotation><xs:documentation>Intensity of the glow map</xs:documentation></xs:annotation>
|
||||||
|
</xs:element>
|
||||||
</xs:all>
|
</xs:all>
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<Page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Page.xsd">
|
||||||
|
<ID>0</ID>
|
||||||
|
</Page>
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<?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="Page">
|
||||||
|
<xs:annotation>
|
||||||
|
<xs:documentation>Use this on a child to a Menu entity and make sure that ID is not the same as other pages.</xs:documentation>
|
||||||
|
</xs:annotation>
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:all>
|
||||||
|
<xs:element name="ID" type="t:int" minOccurs="0"/>
|
||||||
|
</xs:all>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
</xs:schema>
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
<Physics xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Physics.xsd">
|
<Physics xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Physics.xsd">
|
||||||
<Velocity X="0" Y="0" Z="0"/>
|
<Velocity X="0" Y="0" Z="0"/>
|
||||||
<Gravity>true</Gravity>
|
<Gravity>true</Gravity>
|
||||||
|
<PrevOrigin X="-9876.5" Y="-9876.5" Z="-9876.5"/>
|
||||||
<IsOnGround>false</IsOnGround>
|
<IsOnGround>false</IsOnGround>
|
||||||
<VerticalStepHeight>0.33</VerticalStepHeight>
|
<VerticalStepHeight>0.33</VerticalStepHeight>
|
||||||
</Physics>
|
</Physics>
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
<xs:annotation><xs:documentation>m/s^2</xs:documentation></xs:annotation>
|
<xs:annotation><xs:documentation>m/s^2</xs:documentation></xs:annotation>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
<xs:element name="Gravity" type="t:bool" minOccurs="0"/>
|
<xs:element name="Gravity" type="t:bool" minOccurs="0"/>
|
||||||
|
<xs:element name="PrevOrigin" type="t:Vector" minOccurs="0"/>
|
||||||
<xs:element name="IsOnGround" type="t:bool" minOccurs="0"/>
|
<xs:element name="IsOnGround" type="t:bool" minOccurs="0"/>
|
||||||
<xs:element name="VerticalStepHeight" type="t:double" minOccurs="0">
|
<xs:element name="VerticalStepHeight" type="t:double" minOccurs="0">
|
||||||
<xs:annotation><xs:documentation>The largest height of a "stair-step" that can be walked over</xs:documentation></xs:annotation>
|
<xs:annotation><xs:documentation>The largest height of a "stair-step" that can be walked over</xs:documentation></xs:annotation>
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<SpriteIndicator xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="SpriteIndicator.xsd">
|
||||||
|
<MinScale>10</MinScale>
|
||||||
|
<VisibleForSingleTeamOnly>false</VisibleForSingleTeamOnly>
|
||||||
|
</SpriteIndicator>
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?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="SpriteIndicator">
|
||||||
|
<xs:annotation>
|
||||||
|
<xs:documentation>Billbord a Sprite around global Y axis</xs:documentation>
|
||||||
|
</xs:annotation>
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:all>
|
||||||
|
<xs:element name="MinScale" type="t:double" minOccurs="0"/>
|
||||||
|
<xs:element name="VisibleForSingleTeamOnly" type="t:bool" minOccurs="0">
|
||||||
|
<xs:annotation><xs:documentation>Add a Team component to this Entity or Parent to make it visible only for that team</xs:documentation></xs:annotation>
|
||||||
|
</xs:element>
|
||||||
|
</xs:all>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
</xs:schema>
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
|
||||||
<Trigger xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Trigger.xsd">
|
|
||||||
</Trigger>
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
<?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="Weapon">
|
|
||||||
<xs:complexType>
|
|
||||||
<xs:all>
|
|
||||||
<xs:element name="MagSize" type="t:int" minOccurs="0"/>
|
|
||||||
<xs:element name="MaxAmmo" type="t:int" minOccurs="0"/>
|
|
||||||
<xs:element name="CurrentAmmoInMag" type="t:int" minOccurs="0"/>
|
|
||||||
<xs:element name="CurrentAmmo" type="t:int" minOccurs="0"/>
|
|
||||||
<xs:element name="RPM" type="t:double" minOccurs="0"/>
|
|
||||||
</xs:all>
|
|
||||||
</xs:complexType>
|
|
||||||
</xs:element>
|
|
||||||
</xs:schema>
|
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<WeaponAttachment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="WeaponAttachment.xsd">
|
||||||
|
<Person><FirstPerson/></Person>
|
||||||
|
</WeaponAttachment>
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
<?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:complexType name="PersonEnum" mixed="true">
|
||||||
|
<xs:complexContent>
|
||||||
|
<xs:extension base="t:enum">
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="FirstPerson" type="t:int" fixed="0" minOccurs="0"/>
|
||||||
|
<xs:element name="ThirdPerson" type="t:int" fixed="1" minOccurs="0"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:extension>
|
||||||
|
</xs:complexContent>
|
||||||
|
</xs:complexType>
|
||||||
|
|
||||||
|
<xs:complexType name="WeaponSlotEnum" mixed="true">
|
||||||
|
<xs:complexContent>
|
||||||
|
<xs:extension base="t:enum">
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Primary" type="t:int" fixed="1" minOccurs="0"/>
|
||||||
|
<xs:element name="Secondary" type="t:int" fixed="2" minOccurs="0"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:extension>
|
||||||
|
</xs:complexContent>
|
||||||
|
</xs:complexType>
|
||||||
|
|
||||||
|
<xs:element name="WeaponAttachment">
|
||||||
|
<xs:annotation><xs:documentation>Combine with a spawner to define a weapon attachment point</xs:documentation></xs:annotation>
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:all>
|
||||||
|
<xs:element name="Person" type="PersonEnum" minOccurs="0"/>
|
||||||
|
<xs:element name="Slot" type="WeaponSlotEnum" minOccurs="0"/>
|
||||||
|
</xs:all>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
</xs:schema>
|
||||||
@@ -2,13 +2,18 @@
|
|||||||
<Entity xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
<Entity xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||||
|
|
||||||
<Components>
|
<Components>
|
||||||
<c:AABB/>
|
|
||||||
<c:AmmoPickup/>
|
<c:AmmoPickup/>
|
||||||
<c:Model>
|
<c:Model>
|
||||||
<Resource>Models/Core/UnitSphere.mesh</Resource>
|
<Resource>Models/Props/PickUps/AmmoPickUp.mesh</Resource>
|
||||||
</c:Model>
|
</c:Model>
|
||||||
|
<c:RaptorCopter>
|
||||||
|
<Speed>8</Speed>
|
||||||
|
<Axis X="0" Y="0.100000001" Z="0"/>
|
||||||
|
</c:RaptorCopter>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0" Y="1" Z="0"/>
|
<Position X="0" Y="2.36784196" Z="0"/>
|
||||||
|
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
|
||||||
|
<Orientation X="0" Y="18717.9453" Z="0"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
<c:Trigger/>
|
<c:Trigger/>
|
||||||
</Components>
|
</Components>
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<Entity name="Button" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||||
|
|
||||||
|
<Components>
|
||||||
|
<c:Button/>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Core/White.png</DiffuseTexture>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0.375197947" Z="0.0627754927"/>
|
||||||
|
<Scale X="0.600000024" Y="0.150000006" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
|
||||||
|
<Children>
|
||||||
|
<Entity name="Text">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>Play</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
<Color A="1" B="1" G="0.847058833" R="0"/>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-0.00710564246" Y="-0.203304529" Z="0.00999999978"/>
|
||||||
|
<Scale X="0.300000012" Y="0.699999988" Z="4.30000019"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
|
||||||
|
</Entity>
|
||||||
@@ -144,7 +144,7 @@
|
|||||||
</Team>
|
</Team>
|
||||||
</c:Team>
|
</c:Team>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="57.7363472" Y="2.38900018" Z="79.5"/>
|
<Position X="57.7363472" Y="4.98900032" Z="79.5"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children>
|
||||||
@@ -206,14 +206,16 @@
|
|||||||
</Team>
|
</Team>
|
||||||
</c:Team>
|
</c:Team>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="-60.2567062" Y="3.4000001" Z="-78.1000061"/>
|
<Position X="-60.2567062" Y="9.40000057" Z="-78.1000061"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children>
|
||||||
<Entity>
|
<Entity>
|
||||||
<Components>
|
<Components>
|
||||||
<c:SpawnPoint/>
|
<c:SpawnPoint/>
|
||||||
<c:Transform/>
|
<c:Transform>
|
||||||
|
<Position X="0" Y="2.10000014" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children/>
|
<Children/>
|
||||||
</Entity>
|
</Entity>
|
||||||
|
|||||||
@@ -2,13 +2,18 @@
|
|||||||
<Entity xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
<Entity xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||||
|
|
||||||
<Components>
|
<Components>
|
||||||
<c:AABB/>
|
|
||||||
<c:HealthPickup/>
|
<c:HealthPickup/>
|
||||||
<c:Model>
|
<c:Model>
|
||||||
<Resource>Models/Core/UnitSphere.mesh</Resource>
|
<Resource>Models/Props/PickUps/HealthPickUp.mesh</Resource>
|
||||||
</c:Model>
|
</c:Model>
|
||||||
|
<c:RaptorCopter>
|
||||||
|
<Speed>8</Speed>
|
||||||
|
<Axis X="0" Y="0.100000001" Z="0"/>
|
||||||
|
</c:RaptorCopter>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0" Y="1" Z="0"/>
|
<Position X="0" Y="2.36784196" Z="0"/>
|
||||||
|
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
|
||||||
|
<Orientation X="0" Y="18767.0273" Z="0"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
<c:Trigger/>
|
<c:Trigger/>
|
||||||
</Components>
|
</Components>
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
<c:DashAbility/>
|
<c:DashAbility/>
|
||||||
<c:Health/>
|
<c:Health/>
|
||||||
<c:Physics>
|
<c:Physics>
|
||||||
|
<PrevOrigin X="0" Y="0.772000015" Z="0"/>
|
||||||
<Velocity X="2.30999646e-23" Y="0" Z="1.05272533e-23"/>
|
<Velocity X="2.30999646e-23" Y="0" Z="1.05272533e-23"/>
|
||||||
</c:Physics>
|
</c:Physics>
|
||||||
<c:Player>
|
<c:Player>
|
||||||
@@ -60,6 +61,7 @@
|
|||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DiffuseTexture>Textures/Weapons/Crosshair/SmallThickHoleDot.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Weapons/Crosshair/SmallThickHoleDot.png</DiffuseTexture>
|
||||||
<DepthSort>false</DepthSort>
|
<DepthSort>false</DepthSort>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0" Y="0" Z="0.200000003"/>
|
<Position X="0" Y="0" Z="0.200000003"/>
|
||||||
@@ -110,6 +112,7 @@
|
|||||||
</c:Fill>
|
</c:Fill>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DiffuseTexture>Textures/HealthHUD3.png</DiffuseTexture>
|
<DiffuseTexture>Textures/HealthHUD3.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
<Color A="0.588235319" B="0" G="0" R="0"/>
|
<Color A="0.588235319" B="0" G="0" R="0"/>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:HealthHUD/>
|
<c:HealthHUD/>
|
||||||
@@ -135,6 +138,7 @@
|
|||||||
<Components>
|
<Components>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
<Color A="0.300000012" B="1" G="1" R="1"/>
|
<Color A="0.300000012" B="1" G="1" R="1"/>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
@@ -152,6 +156,7 @@
|
|||||||
</c:Fill>
|
</c:Fill>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0" Y="0" Z="0.00999999978"/>
|
<Position X="0" Y="0" Z="0.00999999978"/>
|
||||||
@@ -167,6 +172,7 @@
|
|||||||
<Components>
|
<Components>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
<Color A="0.300000012" B="1" G="1" R="1"/>
|
<Color A="0.300000012" B="1" G="1" R="1"/>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
@@ -185,6 +191,7 @@
|
|||||||
</c:Fill>
|
</c:Fill>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0" Y="0" Z="0.00999999978"/>
|
<Position X="0" Y="0" Z="0.00999999978"/>
|
||||||
@@ -200,6 +207,7 @@
|
|||||||
<Components>
|
<Components>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
|
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
@@ -217,6 +225,7 @@
|
|||||||
</c:Fill>
|
</c:Fill>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0" Y="0" Z="0.00999999978"/>
|
<Position X="0" Y="0" Z="0.00999999978"/>
|
||||||
@@ -232,6 +241,7 @@
|
|||||||
<Components>
|
<Components>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
<Color A="0.300000012" B="1" G="1" R="1"/>
|
<Color A="0.300000012" B="1" G="1" R="1"/>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
@@ -249,6 +259,7 @@
|
|||||||
</c:Fill>
|
</c:Fill>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0" Y="0" Z="0.00999999978"/>
|
<Position X="0" Y="0" Z="0.00999999978"/>
|
||||||
@@ -264,6 +275,7 @@
|
|||||||
<Components>
|
<Components>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
<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.200000003" R="1"/>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
@@ -279,6 +291,7 @@
|
|||||||
</c:Fill>
|
</c:Fill>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0" Y="0" Z="0.00999999978"/>
|
<Position X="0" Y="0" Z="0.00999999978"/>
|
||||||
@@ -291,8 +304,7 @@
|
|||||||
</Children>
|
</Children>
|
||||||
</Entity>
|
</Entity>
|
||||||
</Children>
|
</Children>
|
||||||
</Entity>
|
</Entity> <Entity name="KillFeed">
|
||||||
<Entity name="KillFeed">
|
|
||||||
<Components>
|
<Components>
|
||||||
<c:KillFeed/>
|
<c:KillFeed/>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
@@ -304,6 +316,7 @@
|
|||||||
<Entity name="KillFeed1">
|
<Entity name="KillFeed1">
|
||||||
<Components>
|
<Components>
|
||||||
<c:Text>
|
<c:Text>
|
||||||
|
<Content></Content>
|
||||||
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
<Alignment>
|
<Alignment>
|
||||||
<Right/>
|
<Right/>
|
||||||
@@ -316,6 +329,7 @@
|
|||||||
<Entity name="KillFeed2">
|
<Entity name="KillFeed2">
|
||||||
<Components>
|
<Components>
|
||||||
<c:Text>
|
<c:Text>
|
||||||
|
<Content></Content>
|
||||||
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
<Alignment>
|
<Alignment>
|
||||||
<Right/>
|
<Right/>
|
||||||
@@ -330,6 +344,7 @@
|
|||||||
<Entity name="KillFeed3">
|
<Entity name="KillFeed3">
|
||||||
<Components>
|
<Components>
|
||||||
<c:Text>
|
<c:Text>
|
||||||
|
<Content></Content>
|
||||||
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
<Alignment>
|
<Alignment>
|
||||||
<Right/>
|
<Right/>
|
||||||
@@ -349,13 +364,14 @@
|
|||||||
<Components>
|
<Components>
|
||||||
<c:Animation>
|
<c:Animation>
|
||||||
<AnimationName1>Idle</AnimationName1>
|
<AnimationName1>Idle</AnimationName1>
|
||||||
<Time1>1.6050530664521858</Time1>
|
<Time1>0.97725610639912475</Time1>
|
||||||
<Speed1>1</Speed1>
|
<Speed1>1</Speed1>
|
||||||
|
<AnimationName2></AnimationName2>
|
||||||
|
<AnimationName3></AnimationName3>
|
||||||
</c:Animation>
|
</c:Animation>
|
||||||
<c:Model>
|
<c:Model>
|
||||||
<Resource>Models/Characters/Assault/FirstPerson.mesh</Resource>
|
<Resource>Models/Characters/Assault/FirstPerson.mesh</Resource>
|
||||||
<Color A="1" B="1" G="0.309803933" R="0"/>
|
<Color A="1" B="1" G="0.309803933" R="0"/>
|
||||||
<Transparent>true</Transparent>
|
|
||||||
</c:Model>
|
</c:Model>
|
||||||
<c:Transform/>
|
<c:Transform/>
|
||||||
</Components>
|
</Components>
|
||||||
@@ -367,11 +383,10 @@
|
|||||||
</c:BoneAttachment>
|
</c:BoneAttachment>
|
||||||
<c:Model>
|
<c:Model>
|
||||||
<Resource>Models/Weapons/Blue/AssaultWeaponBlue.mesh</Resource>
|
<Resource>Models/Weapons/Blue/AssaultWeaponBlue.mesh</Resource>
|
||||||
<Transparent>true</Transparent>
|
|
||||||
</c:Model>
|
</c:Model>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0.12043035" Y="-0.234149337" Z="-0.181454644"/>
|
<Position X="0.12043038" Y="-0.244988307" Z="-0.181454808"/>
|
||||||
<Orientation X="0.0104045281" Y="-0.00268131681" Z="0.0428438708"/>
|
<Orientation X="0.010404544" Y="-0.00268173823" Z="0.0428441577"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children>
|
||||||
@@ -408,6 +423,7 @@
|
|||||||
<Components>
|
<Components>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
<Color A="0.588235319" B="0" G="0" R="0"/>
|
<Color A="0.588235319" B="0" G="0" R="0"/>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
@@ -477,8 +493,10 @@
|
|||||||
<Components>
|
<Components>
|
||||||
<c:Animation>
|
<c:Animation>
|
||||||
<AnimationName1>Idle</AnimationName1>
|
<AnimationName1>Idle</AnimationName1>
|
||||||
<Time1>1.620305457513453</Time1>
|
<Time1>0.87583812735846323</Time1>
|
||||||
<Speed1>1</Speed1>
|
<Speed1>1</Speed1>
|
||||||
|
<AnimationName2></AnimationName2>
|
||||||
|
<AnimationName3></AnimationName3>
|
||||||
</c:Animation>
|
</c:Animation>
|
||||||
<c:AnimationOffset>
|
<c:AnimationOffset>
|
||||||
<AnimationName>AimRifle</AnimationName>
|
<AnimationName>AimRifle</AnimationName>
|
||||||
@@ -501,8 +519,8 @@
|
|||||||
<Resource>Models/Weapons/Blue/AssaultWeaponBlue.mesh</Resource>
|
<Resource>Models/Weapons/Blue/AssaultWeaponBlue.mesh</Resource>
|
||||||
</c:Model>
|
</c:Model>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0.160351232" Y="1.02591991" Z="-0.215102971"/>
|
<Position X="0.163429111" Y="1.0235405" Z="-0.215489209"/>
|
||||||
<Orientation X="-0.0627480298" Y="-0.0432248674" Z="0.119431816"/>
|
<Orientation X="-0.0631071255" Y="-0.0576644838" Z="0.118255548"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children>
|
||||||
@@ -572,6 +590,26 @@
|
|||||||
</Components>
|
</Components>
|
||||||
<Children/>
|
<Children/>
|
||||||
</Entity>
|
</Entity>
|
||||||
|
<Entity name="Indicator">
|
||||||
|
<Components>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Icons/Arrow.png</DiffuseTexture>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<Color A="1" B="1" G="0.309803933" R="0"/>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:HiddenForLocalPlayer/>
|
||||||
|
<c:SpriteIndicator>
|
||||||
|
<MinScale>50</MinScale>
|
||||||
|
<VisibleForSingleTeamOnly>true</VisibleForSingleTeamOnly>
|
||||||
|
</c:SpriteIndicator>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="1.84019077" Z="0"/>
|
||||||
|
<Scale X="0.300000012" Y="0.300000012" Z="0.300000012"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
</Children>
|
</Children>
|
||||||
|
|
||||||
</Entity>
|
</Entity>
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
<c:DashAbility/>
|
<c:DashAbility/>
|
||||||
<c:Health/>
|
<c:Health/>
|
||||||
<c:Physics>
|
<c:Physics>
|
||||||
|
<PrevOrigin X="0" Y="0.772000015" Z="0"/>
|
||||||
<Velocity X="2.30999646e-23" Y="0" Z="1.05272533e-23"/>
|
<Velocity X="2.30999646e-23" Y="0" Z="1.05272533e-23"/>
|
||||||
</c:Physics>
|
</c:Physics>
|
||||||
<c:Player>
|
<c:Player>
|
||||||
@@ -60,6 +61,7 @@
|
|||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DiffuseTexture>Textures/Weapons/Crosshair/SmallThickHoleDot.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Weapons/Crosshair/SmallThickHoleDot.png</DiffuseTexture>
|
||||||
<DepthSort>false</DepthSort>
|
<DepthSort>false</DepthSort>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0" Y="0" Z="0.200000003"/>
|
<Position X="0" Y="0" Z="0.200000003"/>
|
||||||
@@ -110,6 +112,7 @@
|
|||||||
</c:Fill>
|
</c:Fill>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DiffuseTexture>Textures/HealthHUD3.png</DiffuseTexture>
|
<DiffuseTexture>Textures/HealthHUD3.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
<Color A="0.588235319" B="0" G="0" R="0"/>
|
<Color A="0.588235319" B="0" G="0" R="0"/>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:HealthHUD/>
|
<c:HealthHUD/>
|
||||||
@@ -135,6 +138,7 @@
|
|||||||
<Components>
|
<Components>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
<Color A="0.300000012" B="1" G="1" R="1"/>
|
<Color A="0.300000012" B="1" G="1" R="1"/>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
@@ -152,6 +156,7 @@
|
|||||||
</c:Fill>
|
</c:Fill>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0" Y="0" Z="0.00999999978"/>
|
<Position X="0" Y="0" Z="0.00999999978"/>
|
||||||
@@ -167,6 +172,7 @@
|
|||||||
<Components>
|
<Components>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
<Color A="0.300000012" B="1" G="1" R="1"/>
|
<Color A="0.300000012" B="1" G="1" R="1"/>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
@@ -185,6 +191,7 @@
|
|||||||
</c:Fill>
|
</c:Fill>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0" Y="0" Z="0.00999999978"/>
|
<Position X="0" Y="0" Z="0.00999999978"/>
|
||||||
@@ -200,6 +207,7 @@
|
|||||||
<Components>
|
<Components>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
|
<Color A="0.699999988" B="1" G="0.200000003" R="0"/>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
@@ -217,6 +225,7 @@
|
|||||||
</c:Fill>
|
</c:Fill>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0" Y="0" Z="0.00999999978"/>
|
<Position X="0" Y="0" Z="0.00999999978"/>
|
||||||
@@ -232,6 +241,7 @@
|
|||||||
<Components>
|
<Components>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
<Color A="0.300000012" B="1" G="1" R="1"/>
|
<Color A="0.300000012" B="1" G="1" R="1"/>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
@@ -249,6 +259,7 @@
|
|||||||
</c:Fill>
|
</c:Fill>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0" Y="0" Z="0.00999999978"/>
|
<Position X="0" Y="0" Z="0.00999999978"/>
|
||||||
@@ -264,6 +275,7 @@
|
|||||||
<Components>
|
<Components>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
<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.200000003" R="1"/>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
@@ -279,6 +291,7 @@
|
|||||||
</c:Fill>
|
</c:Fill>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0" Y="0" Z="0.00999999978"/>
|
<Position X="0" Y="0" Z="0.00999999978"/>
|
||||||
@@ -304,6 +317,7 @@
|
|||||||
<Entity name="KillFeed1">
|
<Entity name="KillFeed1">
|
||||||
<Components>
|
<Components>
|
||||||
<c:Text>
|
<c:Text>
|
||||||
|
<Content></Content>
|
||||||
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
<Alignment>
|
<Alignment>
|
||||||
<Right/>
|
<Right/>
|
||||||
@@ -316,6 +330,7 @@
|
|||||||
<Entity name="KillFeed2">
|
<Entity name="KillFeed2">
|
||||||
<Components>
|
<Components>
|
||||||
<c:Text>
|
<c:Text>
|
||||||
|
<Content></Content>
|
||||||
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
<Alignment>
|
<Alignment>
|
||||||
<Right/>
|
<Right/>
|
||||||
@@ -330,6 +345,7 @@
|
|||||||
<Entity name="KillFeed3">
|
<Entity name="KillFeed3">
|
||||||
<Components>
|
<Components>
|
||||||
<c:Text>
|
<c:Text>
|
||||||
|
<Content></Content>
|
||||||
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
<Alignment>
|
<Alignment>
|
||||||
<Right/>
|
<Right/>
|
||||||
@@ -349,13 +365,14 @@
|
|||||||
<Components>
|
<Components>
|
||||||
<c:Animation>
|
<c:Animation>
|
||||||
<AnimationName1>Idle</AnimationName1>
|
<AnimationName1>Idle</AnimationName1>
|
||||||
<Time1>1.6050530664521858</Time1>
|
<Time1>1.2667383999985162</Time1>
|
||||||
<Speed1>1</Speed1>
|
<Speed1>1</Speed1>
|
||||||
|
<AnimationName2></AnimationName2>
|
||||||
|
<AnimationName3></AnimationName3>
|
||||||
</c:Animation>
|
</c:Animation>
|
||||||
<c:Model>
|
<c:Model>
|
||||||
<Resource>Models/Characters/Assault/FirstPerson.mesh</Resource>
|
<Resource>Models/Characters/Assault/FirstPerson.mesh</Resource>
|
||||||
<Color A="1" B="0" G="0" R="1"/>
|
<Color A="1" B="0" G="0" R="1"/>
|
||||||
<Transparent>true</Transparent>
|
|
||||||
</c:Model>
|
</c:Model>
|
||||||
<c:Transform/>
|
<c:Transform/>
|
||||||
</Components>
|
</Components>
|
||||||
@@ -367,11 +384,10 @@
|
|||||||
</c:BoneAttachment>
|
</c:BoneAttachment>
|
||||||
<c:Model>
|
<c:Model>
|
||||||
<Resource>Models/Weapons/Red/AssaultWeaponRed.mesh</Resource>
|
<Resource>Models/Weapons/Red/AssaultWeaponRed.mesh</Resource>
|
||||||
<Transparent>true</Transparent>
|
|
||||||
</c:Model>
|
</c:Model>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0.12043035" Y="-0.234149337" Z="-0.181454644"/>
|
<Position X="0.120430425" Y="-0.242105931" Z="-0.181454822"/>
|
||||||
<Orientation X="0.0104045281" Y="-0.00268131681" Z="0.0428438708"/>
|
<Orientation X="0.010404665" Y="-0.00268179877" Z="0.0428443067"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children>
|
||||||
@@ -408,6 +424,7 @@
|
|||||||
<Components>
|
<Components>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
<Color A="0.588235319" B="0" G="0" R="0"/>
|
<Color A="0.588235319" B="0" G="0" R="0"/>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
@@ -477,8 +494,10 @@
|
|||||||
<Components>
|
<Components>
|
||||||
<c:Animation>
|
<c:Animation>
|
||||||
<AnimationName1>Idle</AnimationName1>
|
<AnimationName1>Idle</AnimationName1>
|
||||||
<Time1>1.620305457513453</Time1>
|
<Time1>0.26532318661337229</Time1>
|
||||||
<Speed1>1</Speed1>
|
<Speed1>1</Speed1>
|
||||||
|
<AnimationName2></AnimationName2>
|
||||||
|
<AnimationName3></AnimationName3>
|
||||||
</c:Animation>
|
</c:Animation>
|
||||||
<c:AnimationOffset>
|
<c:AnimationOffset>
|
||||||
<AnimationName>AimRifle</AnimationName>
|
<AnimationName>AimRifle</AnimationName>
|
||||||
@@ -501,8 +520,8 @@
|
|||||||
<Resource>Models/Weapons/Red/AssaultWeaponRed.mesh</Resource>
|
<Resource>Models/Weapons/Red/AssaultWeaponRed.mesh</Resource>
|
||||||
</c:Model>
|
</c:Model>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0.160351232" Y="1.02591991" Z="-0.215102971"/>
|
<Position X="0.159282878" Y="1.0300566" Z="-0.216084003"/>
|
||||||
<Orientation X="-0.0627480298" Y="-0.0432248674" Z="0.119431816"/>
|
<Orientation X="-0.0626799241" Y="-0.0390551724" Z="0.119761385"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children>
|
||||||
@@ -572,6 +591,26 @@
|
|||||||
</Components>
|
</Components>
|
||||||
<Children/>
|
<Children/>
|
||||||
</Entity>
|
</Entity>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Icons/Arrow.png</DiffuseTexture>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<Color A="1" B="0" G="0" R="1"/>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:HiddenForLocalPlayer/>
|
||||||
|
<c:SpriteIndicator>
|
||||||
|
<MinScale>50</MinScale>
|
||||||
|
<VisibleForSingleTeamOnly>true</VisibleForSingleTeamOnly>
|
||||||
|
</c:SpriteIndicator>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="1.84000003" Z="0"/>
|
||||||
|
<Scale X="0.300000012" Y="0.300000012" Z="0.300000012"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
</Children>
|
</Children>
|
||||||
|
|
||||||
</Entity>
|
</Entity>
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
<Axis X="0" Y="1" Z="0"/>
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
</c:RaptorCopter>
|
</c:RaptorCopter>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Orientation X="0" Y="7364.79053" Z="0"/>
|
<Orientation X="0" Y="8433.37305" Z="0"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children>
|
||||||
@@ -77,18 +77,6 @@
|
|||||||
</Entity>
|
</Entity>
|
||||||
</Children>
|
</Children>
|
||||||
</Entity>
|
</Entity>
|
||||||
<Entity name="ListenerText">
|
|
||||||
<Components>
|
|
||||||
<c:Text>
|
|
||||||
<Content>Sound Test</Content>
|
|
||||||
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
|
||||||
</c:Text>
|
|
||||||
<c:Transform>
|
|
||||||
<Orientation X="0" Y="3.31600022" Z="0"/>
|
|
||||||
</c:Transform>
|
|
||||||
</Components>
|
|
||||||
<Children/>
|
|
||||||
</Entity>
|
|
||||||
</Children>
|
</Children>
|
||||||
</Entity>
|
</Entity>
|
||||||
<Entity name="DirectionalLight">
|
<Entity name="DirectionalLight">
|
||||||
@@ -105,7 +93,7 @@
|
|||||||
</c:RaptorCopter>
|
</c:RaptorCopter>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="2.1529963" Y="6.59221172" Z="0.169116676"/>
|
<Position X="2.1529963" Y="6.59221172" Z="0.169116676"/>
|
||||||
<Orientation X="4.16300011" Y="17199.7988" Z="0"/>
|
<Orientation X="4.16300011" Y="18271.9141" Z="0"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children/>
|
<Children/>
|
||||||
@@ -180,7 +168,7 @@
|
|||||||
<Axis X="0" Y="1" Z="0"/>
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
</c:RaptorCopter>
|
</c:RaptorCopter>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Orientation X="0" Y="2019.28589" Z="0"/>
|
<Orientation X="0" Y="2553.63574" Z="0"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children>
|
||||||
@@ -225,7 +213,7 @@
|
|||||||
<Axis X="1" Y="1" Z="1"/>
|
<Axis X="1" Y="1" Z="1"/>
|
||||||
</c:RaptorCopter>
|
</c:RaptorCopter>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Orientation X="15792.2051" Y="15792.2051" Z="15792.2051"/>
|
<Orientation X="16862.3945" Y="16862.3945" Z="16862.3945"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children>
|
||||||
@@ -289,7 +277,7 @@
|
|||||||
<Axis X="0" Y="1" Z="0"/>
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
</c:RaptorCopter>
|
</c:RaptorCopter>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Orientation X="0" Y="15589.2383" Z="0"/>
|
<Orientation X="0" Y="16658.3906" Z="0"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children>
|
||||||
@@ -321,7 +309,7 @@
|
|||||||
<Axis X="0.699999988" Y="1" Z="0.300000012"/>
|
<Axis X="0.699999988" Y="1" Z="0.300000012"/>
|
||||||
</c:RaptorCopter>
|
</c:RaptorCopter>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Orientation X="11456.2695" Y="16313.6973" Z="4881.66504"/>
|
<Orientation X="12206.665" Y="17385.8008" Z="5202.3335"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children>
|
||||||
@@ -671,7 +659,7 @@
|
|||||||
<Axis X="0" Y="1" Z="0"/>
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
</c:RaptorCopter>
|
</c:RaptorCopter>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Orientation X="0" Y="316.505432" Z="0"/>
|
<Orientation X="0" Y="851.386902" Z="0"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children>
|
||||||
@@ -718,7 +706,7 @@
|
|||||||
<Axis X="0" Y="1" Z="0"/>
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
</c:RaptorCopter>
|
</c:RaptorCopter>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Orientation X="0" Y="316.505432" Z="0"/>
|
<Orientation X="0" Y="851.386902" Z="0"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children>
|
||||||
@@ -778,7 +766,7 @@
|
|||||||
<Axis X="0" Y="1" Z="0"/>
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
</c:RaptorCopter>
|
</c:RaptorCopter>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Orientation X="0" Y="316.505432" Z="0"/>
|
<Orientation X="0" Y="851.386902" Z="0"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children>
|
||||||
@@ -825,7 +813,7 @@
|
|||||||
<Axis X="0" Y="1" Z="0"/>
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
</c:RaptorCopter>
|
</c:RaptorCopter>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Orientation X="0" Y="316.505432" Z="0"/>
|
<Orientation X="0" Y="851.386902" Z="0"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children>
|
||||||
@@ -871,7 +859,7 @@
|
|||||||
<Axis X="0" Y="1" Z="0"/>
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
</c:RaptorCopter>
|
</c:RaptorCopter>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Orientation X="0" Y="316.505432" Z="0"/>
|
<Orientation X="0" Y="851.386902" Z="0"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children>
|
||||||
@@ -918,7 +906,7 @@
|
|||||||
<Axis X="0" Y="1" Z="0"/>
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
</c:RaptorCopter>
|
</c:RaptorCopter>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Orientation X="0" Y="316.505432" Z="0"/>
|
<Orientation X="0" Y="851.386902" Z="0"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children>
|
||||||
@@ -965,7 +953,7 @@
|
|||||||
<Axis X="0" Y="1" Z="0"/>
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
</c:RaptorCopter>
|
</c:RaptorCopter>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Orientation X="0" Y="316.505432" Z="0"/>
|
<Orientation X="0" Y="851.386902" Z="0"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children>
|
||||||
@@ -1027,7 +1015,7 @@
|
|||||||
</c:CapturePoint>
|
</c:CapturePoint>
|
||||||
<c:Model>
|
<c:Model>
|
||||||
<Resource>Models/Core/UnitCube.mesh</Resource>
|
<Resource>Models/Core/UnitCube.mesh</Resource>
|
||||||
<Color A="0.300000012" B="0" G="0.200000003" R="1"/>
|
<Color A="0.300000012" B="0" G="0" R="1"/>
|
||||||
<Transparent>true</Transparent>
|
<Transparent>true</Transparent>
|
||||||
</c:Model>
|
</c:Model>
|
||||||
<c:Team>
|
<c:Team>
|
||||||
@@ -1077,7 +1065,7 @@
|
|||||||
</c:CapturePoint>
|
</c:CapturePoint>
|
||||||
<c:Model>
|
<c:Model>
|
||||||
<Resource>Models/Core/UnitCube.mesh</Resource>
|
<Resource>Models/Core/UnitCube.mesh</Resource>
|
||||||
<Color A="0.300000012" B="0" G="1" R="1"/>
|
<Color A="0.300000012" B="1" G="1" R="1"/>
|
||||||
<Transparent>true</Transparent>
|
<Transparent>true</Transparent>
|
||||||
</c:Model>
|
</c:Model>
|
||||||
<c:Team/>
|
<c:Team/>
|
||||||
@@ -1167,7 +1155,7 @@
|
|||||||
</c:CapturePoint>
|
</c:CapturePoint>
|
||||||
<c:Model>
|
<c:Model>
|
||||||
<Resource>Models/Core/UnitCube.mesh</Resource>
|
<Resource>Models/Core/UnitCube.mesh</Resource>
|
||||||
<Color A="0.300000012" B="1" G="1" R="0"/>
|
<Color A="0.300000012" B="1" G="1" R="1"/>
|
||||||
<Transparent>true</Transparent>
|
<Transparent>true</Transparent>
|
||||||
</c:Model>
|
</c:Model>
|
||||||
<c:Team/>
|
<c:Team/>
|
||||||
@@ -1217,7 +1205,7 @@
|
|||||||
</c:CapturePoint>
|
</c:CapturePoint>
|
||||||
<c:Model>
|
<c:Model>
|
||||||
<Resource>Models/Core/UnitCube.mesh</Resource>
|
<Resource>Models/Core/UnitCube.mesh</Resource>
|
||||||
<Color A="0.300000012" B="1" G="0.200000003" R="0"/>
|
<Color A="0.300000012" B="1" G="0" R="0"/>
|
||||||
<Transparent>true</Transparent>
|
<Transparent>true</Transparent>
|
||||||
</c:Model>
|
</c:Model>
|
||||||
<c:Team>
|
<c:Team>
|
||||||
@@ -1379,7 +1367,7 @@
|
|||||||
<Axis X="0" Y="1" Z="0"/>
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
</c:RaptorCopter>
|
</c:RaptorCopter>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Orientation X="0" Y="850.207886" Z="0"/>
|
<Orientation X="0" Y="1385.11243" Z="0"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children>
|
||||||
@@ -1388,7 +1376,7 @@
|
|||||||
<c:ExplosionEffect>
|
<c:ExplosionEffect>
|
||||||
<ColorByDistance>true</ColorByDistance>
|
<ColorByDistance>true</ColorByDistance>
|
||||||
<Velocity X="0.800000012" Y="0.0379999988" Z="0"/>
|
<Velocity X="0.800000012" Y="0.0379999988" Z="0"/>
|
||||||
<TimeSinceDeath>0.75205058136495551</TimeSinceDeath>
|
<TimeSinceDeath>0.8256214817261025</TimeSinceDeath>
|
||||||
<ExplosionDuration>3.7999999523162842</ExplosionDuration>
|
<ExplosionDuration>3.7999999523162842</ExplosionDuration>
|
||||||
<EndColor A="0" B="23.5294113" G="11.7647057" R="0"/>
|
<EndColor A="0" B="23.5294113" G="11.7647057" R="0"/>
|
||||||
<Randomness>true</Randomness>
|
<Randomness>true</Randomness>
|
||||||
@@ -1435,7 +1423,7 @@
|
|||||||
<Axis X="0" Y="1" Z="0"/>
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
</c:RaptorCopter>
|
</c:RaptorCopter>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Orientation X="0" Y="850.207886" Z="0"/>
|
<Orientation X="0" Y="1385.11243" Z="0"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children>
|
||||||
@@ -1444,7 +1432,7 @@
|
|||||||
<c:ExplosionEffect>
|
<c:ExplosionEffect>
|
||||||
<Velocity X="0.5" Y="1" Z="0"/>
|
<Velocity X="0.5" Y="1" Z="0"/>
|
||||||
<ExplosionOrigin X="0" Y="0.900000036" Z="0"/>
|
<ExplosionOrigin X="0" Y="0.900000036" Z="0"/>
|
||||||
<TimeSinceDeath>1.2019563319790627</TimeSinceDeath>
|
<TimeSinceDeath>1.8641349174045843</TimeSinceDeath>
|
||||||
</c:ExplosionEffect>
|
</c:ExplosionEffect>
|
||||||
<c:Model>
|
<c:Model>
|
||||||
<Resource>Models/Characters/Assault/AssaultTPose.mesh</Resource>
|
<Resource>Models/Characters/Assault/AssaultTPose.mesh</Resource>
|
||||||
@@ -1487,7 +1475,7 @@
|
|||||||
<Axis X="0" Y="1" Z="0"/>
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
</c:RaptorCopter>
|
</c:RaptorCopter>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Orientation X="0" Y="850.207886" Z="0"/>
|
<Orientation X="0" Y="1385.11243" Z="0"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children>
|
||||||
@@ -1498,7 +1486,7 @@
|
|||||||
<ColorByDistance>true</ColorByDistance>
|
<ColorByDistance>true</ColorByDistance>
|
||||||
<Velocity X="0.300000012" Y="2" Z="0"/>
|
<Velocity X="0.300000012" Y="2" Z="0"/>
|
||||||
<ExplosionOrigin X="0" Y="1.30000007" Z="-0.200000003"/>
|
<ExplosionOrigin X="0" Y="1.30000007" Z="-0.200000003"/>
|
||||||
<TimeSinceDeath>0.68540211563899389</TimeSinceDeath>
|
<TimeSinceDeath>1.8641349174045843</TimeSinceDeath>
|
||||||
<EndColor A="0" B="0.333333343" G="0.933333337" R="3.92156863"/>
|
<EndColor A="0" B="0.333333343" G="0.933333337" R="3.92156863"/>
|
||||||
<Randomness>true</Randomness>
|
<Randomness>true</Randomness>
|
||||||
</c:ExplosionEffect>
|
</c:ExplosionEffect>
|
||||||
@@ -1543,7 +1531,7 @@
|
|||||||
<Axis X="0" Y="1" Z="0"/>
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
</c:RaptorCopter>
|
</c:RaptorCopter>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Orientation X="0" Y="857.984314" Z="0"/>
|
<Orientation X="0" Y="1392.89258" Z="0"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children>
|
||||||
@@ -1553,7 +1541,7 @@
|
|||||||
<ColorByDistance>true</ColorByDistance>
|
<ColorByDistance>true</ColorByDistance>
|
||||||
<Velocity X="0" Y="0.699999988" Z="0"/>
|
<Velocity X="0" Y="0.699999988" Z="0"/>
|
||||||
<ExplosionOrigin X="0" Y="-1.10000002" Z="0"/>
|
<ExplosionOrigin X="0" Y="-1.10000002" Z="0"/>
|
||||||
<TimeSinceDeath>0.95150063648635763</TimeSinceDeath>
|
<TimeSinceDeath>1.2301962937648341</TimeSinceDeath>
|
||||||
<ExplosionDuration>10</ExplosionDuration>
|
<ExplosionDuration>10</ExplosionDuration>
|
||||||
<EndColor A="1" B="0" G="0" R="1"/>
|
<EndColor A="1" B="0" G="0" R="1"/>
|
||||||
<RandomnessScalar>3</RandomnessScalar>
|
<RandomnessScalar>3</RandomnessScalar>
|
||||||
@@ -1601,7 +1589,7 @@
|
|||||||
<Axis X="0" Y="1" Z="0"/>
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
</c:RaptorCopter>
|
</c:RaptorCopter>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Orientation X="0" Y="456.136078" Z="0"/>
|
<Orientation X="0" Y="991.007263" Z="0"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children>
|
||||||
@@ -1611,7 +1599,7 @@
|
|||||||
<ColorByDistance>true</ColorByDistance>
|
<ColorByDistance>true</ColorByDistance>
|
||||||
<Velocity X="6" Y="0.100000001" Z="0"/>
|
<Velocity X="6" Y="0.100000001" Z="0"/>
|
||||||
<ExplosionOrigin X="0" Y="-10" Z="0"/>
|
<ExplosionOrigin X="0" Y="-10" Z="0"/>
|
||||||
<TimeSinceDeath>1.3515288978624223</TimeSinceDeath>
|
<TimeSinceDeath>3.4214855659573402</TimeSinceDeath>
|
||||||
<ExponentialAccelaration>true</ExponentialAccelaration>
|
<ExponentialAccelaration>true</ExponentialAccelaration>
|
||||||
<ExplosionDuration>5</ExplosionDuration>
|
<ExplosionDuration>5</ExplosionDuration>
|
||||||
<Randomness>true</Randomness>
|
<Randomness>true</Randomness>
|
||||||
@@ -1678,10 +1666,10 @@
|
|||||||
</Entity>
|
</Entity>
|
||||||
<Entity name="ShieldedCube">
|
<Entity name="ShieldedCube">
|
||||||
<Components>
|
<Components>
|
||||||
|
<c:Shielded/>
|
||||||
<c:Model>
|
<c:Model>
|
||||||
<Resource>Models/Core/UnitCube.mesh</Resource>
|
<Resource>Models/Core/UnitCube.mesh</Resource>
|
||||||
</c:Model>
|
</c:Model>
|
||||||
<c:Shielded/>
|
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="-3.34650159" Y="1.19966424" Z="3.09996605"/>
|
<Position X="-3.34650159" Y="1.19966424" Z="3.09996605"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
@@ -1792,7 +1780,7 @@
|
|||||||
<c:ExplosionEffect>
|
<c:ExplosionEffect>
|
||||||
<ColorByDistance>true</ColorByDistance>
|
<ColorByDistance>true</ColorByDistance>
|
||||||
<Velocity X="0.800000012" Y="0.0379999988" Z="0"/>
|
<Velocity X="0.800000012" Y="0.0379999988" Z="0"/>
|
||||||
<TimeSinceDeath>1.3682019578975679</TimeSinceDeath>
|
<TimeSinceDeath>0.8256214817261025</TimeSinceDeath>
|
||||||
<ExplosionDuration>3.7999999523162842</ExplosionDuration>
|
<ExplosionDuration>3.7999999523162842</ExplosionDuration>
|
||||||
<EndColor A="0" B="23.5294113" G="11.7647057" R="0"/>
|
<EndColor A="0" B="23.5294113" G="11.7647057" R="0"/>
|
||||||
<Randomness>true</Randomness>
|
<Randomness>true</Randomness>
|
||||||
@@ -1836,12 +1824,12 @@
|
|||||||
<Entity name="PlayerModel">
|
<Entity name="PlayerModel">
|
||||||
<Components>
|
<Components>
|
||||||
<c:Animation/>
|
<c:Animation/>
|
||||||
|
<c:Shielded/>
|
||||||
<c:HiddenForLocalPlayer/>
|
<c:HiddenForLocalPlayer/>
|
||||||
<c:Model>
|
<c:Model>
|
||||||
<Resource>Models/AssaultAnimated.mesh</Resource>
|
<Resource>Models/AssaultAnimated.mesh</Resource>
|
||||||
<Color A="1" B="0" G="0" R="1"/>
|
<Color A="1" B="0" G="0" R="1"/>
|
||||||
</c:Model>
|
</c:Model>
|
||||||
<c:Shielded/>
|
|
||||||
<c:Transform/>
|
<c:Transform/>
|
||||||
</Components>
|
</Components>
|
||||||
<Children/>
|
<Children/>
|
||||||
@@ -2095,7 +2083,7 @@
|
|||||||
<Components>
|
<Components>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon.png</DiffuseTexture>
|
||||||
<Color A="0.699999988" B="0" G="0.200000003" R="1"/>
|
<Color A="0.699999988" B="0" G="0" R="1"/>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="-1.58304751" Y="0.919596612" Z="0"/>
|
<Position X="-1.58304751" Y="0.919596612" Z="0"/>
|
||||||
@@ -2107,7 +2095,7 @@
|
|||||||
<c:CapturePointHUD/>
|
<c:CapturePointHUD/>
|
||||||
<c:Fill>
|
<c:Fill>
|
||||||
<Percentage>1</Percentage>
|
<Percentage>1</Percentage>
|
||||||
<Color A="0.699999988" B="0" G="0.200000003" R="1"/>
|
<Color A="0.699999988" B="0" G="0" R="1"/>
|
||||||
</c:Fill>
|
</c:Fill>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/UnitHexagon_Rotated.png</DiffuseTexture>
|
||||||
@@ -2145,6 +2133,355 @@
|
|||||||
</Entity>
|
</Entity>
|
||||||
</Children>
|
</Children>
|
||||||
</Entity>
|
</Entity>
|
||||||
|
<Entity name="MenuOirign">
|
||||||
|
<Components>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-23.0533829" Y="0.938369572" Z="14.068408"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="Camera">
|
||||||
|
<Components>
|
||||||
|
<c:Camera/>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Widgets/Camera.mesh</Resource>
|
||||||
|
<Visible>false</Visible>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="MenuCenterPoint">
|
||||||
|
<Components>
|
||||||
|
<c:Menu/>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="Page0">
|
||||||
|
<Components>
|
||||||
|
<c:Page/>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="MenuBackground">
|
||||||
|
<Components>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Core/ErrorTexture.png</DiffuseTexture>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0" Z="-1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="Play">
|
||||||
|
<Components>
|
||||||
|
<c:Button/>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Core/White.png</DiffuseTexture>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0.388422519" Z="0.0627754927"/>
|
||||||
|
<Scale X="0.600000024" Y="0.150000006" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="Text">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>Play</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
<Color A="1" B="1" G="0.847058833" R="0"/>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-0.00710564246" Y="-0.203304529" Z="0.00999999978"/>
|
||||||
|
<Scale X="0.300000012" Y="0.699999988" Z="4.30000019"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="Host">
|
||||||
|
<Components>
|
||||||
|
<c:Button/>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Core/White.png</DiffuseTexture>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0.214031488" Z="0.0627754927"/>
|
||||||
|
<Scale X="0.600000024" Y="0.150000006" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="Text">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>Host</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
<Color A="1" B="1" G="0.847058833" R="0"/>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-0.00710564246" Y="-0.203304529" Z="0.00999999978"/>
|
||||||
|
<Scale X="0.300000012" Y="0.699999988" Z="4.30000019"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="Connecting">
|
||||||
|
<Components>
|
||||||
|
<c:Button/>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Core/White.png</DiffuseTexture>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0.0367300175" Z="0.0627754927"/>
|
||||||
|
<Scale X="0.600000024" Y="0.150000006" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="Text">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>Connect</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
<Color A="1" B="1" G="0.847058833" R="0"/>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-0.00710564246" Y="-0.203304529" Z="0.00999999978"/>
|
||||||
|
<Scale X="0.300000012" Y="0.699999988" Z="4.30000019"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="Settings">
|
||||||
|
<Components>
|
||||||
|
<c:Button/>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Core/White.png</DiffuseTexture>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="-0.148274168" Z="0.0627754927"/>
|
||||||
|
<Scale X="0.600000024" Y="0.150000006" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="Text">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>Settings</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
<Color A="1" B="1" G="0.847058833" R="0"/>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-0.00710564246" Y="-0.203304529" Z="0.00999999978"/>
|
||||||
|
<Scale X="0.300000012" Y="0.699999988" Z="4.30000019"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="Quit">
|
||||||
|
<Components>
|
||||||
|
<c:Button/>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Core/White.png</DiffuseTexture>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="-0.335298717" Z="0.0627754927"/>
|
||||||
|
<Scale X="0.600000024" Y="0.150000006" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="Text">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>Quit</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
<Color A="1" B="1" G="0.847058833" R="0"/>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-0.00710564246" Y="-0.203304529" Z="0.00999999978"/>
|
||||||
|
<Scale X="0.300000012" Y="0.699999988" Z="4.30000019"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="Page1">
|
||||||
|
<Components>
|
||||||
|
<c:Page>
|
||||||
|
<ID>1</ID>
|
||||||
|
</c:Page>
|
||||||
|
<c:Transform>
|
||||||
|
<Orientation X="0" Y="0.989000022" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="MenuBackground">
|
||||||
|
<Components>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Core/ErrorTexture.png</DiffuseTexture>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0" Z="-1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="Res1080">
|
||||||
|
<Components>
|
||||||
|
<c:Button/>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Core/White.png</DiffuseTexture>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0.375197947" Z="0.0627754927"/>
|
||||||
|
<Scale X="0.600000024" Y="0.150000006" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="Text">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>1920x1080</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
<Color A="1" B="1" G="0.847058833" R="0"/>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-0.00710564246" Y="-0.203304529" Z="0.00999999978"/>
|
||||||
|
<Scale X="0.300000012" Y="0.699999988" Z="4.30000019"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="Res720">
|
||||||
|
<Components>
|
||||||
|
<c:Button/>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Core/White.png</DiffuseTexture>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0.199327558" Z="0.0627754927"/>
|
||||||
|
<Scale X="0.600000024" Y="0.150000006" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="Text">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>1280x720</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
<Color A="1" B="1" G="0.847058833" R="0"/>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-0.00710564246" Y="-0.203304529" Z="0.00999999978"/>
|
||||||
|
<Scale X="0.300000012" Y="0.699999988" Z="4.30000019"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="Res480">
|
||||||
|
<Components>
|
||||||
|
<c:Button/>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Core/White.png</DiffuseTexture>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0.0159880854" Z="0.0627754927"/>
|
||||||
|
<Scale X="0.600000024" Y="0.150000006" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="Text">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>854x480</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
<Color A="1" B="1" G="0.847058833" R="0"/>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-0.00710564246" Y="-0.203304529" Z="0.00999999978"/>
|
||||||
|
<Scale X="0.300000012" Y="0.699999988" Z="4.30000019"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="FullScreen">
|
||||||
|
<Components>
|
||||||
|
<c:Button/>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Core/White.png</DiffuseTexture>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="-0.164955258" Z="0.0627754927"/>
|
||||||
|
<Scale X="0.600000024" Y="0.150000006" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="Text">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>FullScreen</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
<Color A="1" B="1" G="0.847058833" R="0"/>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-0.00710564246" Y="-0.203304529" Z="0.00999999978"/>
|
||||||
|
<Scale X="0.300000012" Y="0.699999988" Z="4.30000019"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="Text">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>Menu test area</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="4.22317314" Z="0"/>
|
||||||
|
<Orientation X="0" Y="1.68700004" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="ListenerText">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>Sound Test</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Orientation X="0" Y="3.31600022" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
</Children>
|
</Children>
|
||||||
|
|
||||||
</Entity>
|
</Entity>
|
||||||
|
|||||||
@@ -0,0 +1,299 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<Entity name="MenuOirign" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||||
|
|
||||||
|
<Components>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-23.0533829" Y="0.938369572" Z="14.068408"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
|
||||||
|
<Children>
|
||||||
|
<Entity name="Camera">
|
||||||
|
<Components>
|
||||||
|
<c:Camera/>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Widgets/Camera.mesh</Resource>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="MenuCenterPoint">
|
||||||
|
<Components>
|
||||||
|
<c:Menu/>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="Page0">
|
||||||
|
<Components>
|
||||||
|
<c:Page/>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="MenuBackground">
|
||||||
|
<Components>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Core/ErrorTexture.png</DiffuseTexture>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0" Z="-1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="Button">
|
||||||
|
<Components>
|
||||||
|
<c:Button/>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Core/White.png</DiffuseTexture>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0.388422519" Z="0.0627754927"/>
|
||||||
|
<Scale X="0.600000024" Y="0.150000006" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="Text">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>Play</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
<Color A="1" B="1" G="0.847058833" R="0"/>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-0.00710564246" Y="-0.203304529" Z="0.00999999978"/>
|
||||||
|
<Scale X="0.300000012" Y="0.699999988" Z="4.30000019"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="Button">
|
||||||
|
<Components>
|
||||||
|
<c:Button/>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Core/White.png</DiffuseTexture>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0.214031488" Z="0.0627754927"/>
|
||||||
|
<Scale X="0.600000024" Y="0.150000006" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="Text">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>Host</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
<Color A="1" B="1" G="0.847058833" R="0"/>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-0.00710564246" Y="-0.203304529" Z="0.00999999978"/>
|
||||||
|
<Scale X="0.300000012" Y="0.699999988" Z="4.30000019"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="Button">
|
||||||
|
<Components>
|
||||||
|
<c:Button/>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Core/White.png</DiffuseTexture>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0.0367300175" Z="0.0627754927"/>
|
||||||
|
<Scale X="0.600000024" Y="0.150000006" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="Text">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>Connect</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
<Color A="1" B="1" G="0.847058833" R="0"/>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-0.00710564246" Y="-0.203304529" Z="0.00999999978"/>
|
||||||
|
<Scale X="0.300000012" Y="0.699999988" Z="4.30000019"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="Button">
|
||||||
|
<Components>
|
||||||
|
<c:Button/>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Core/White.png</DiffuseTexture>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="-0.148274168" Z="0.0627754927"/>
|
||||||
|
<Scale X="0.600000024" Y="0.150000006" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="Text">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>Settings</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
<Color A="1" B="1" G="0.847058833" R="0"/>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-0.00710564246" Y="-0.203304529" Z="0.00999999978"/>
|
||||||
|
<Scale X="0.300000012" Y="0.699999988" Z="4.30000019"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="Button">
|
||||||
|
<Components>
|
||||||
|
<c:Button/>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Core/White.png</DiffuseTexture>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="-0.335298717" Z="0.0627754927"/>
|
||||||
|
<Scale X="0.600000024" Y="0.150000006" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="Text">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>Quit</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
<Color A="1" B="1" G="0.847058833" R="0"/>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-0.00710564246" Y="-0.203304529" Z="0.00999999978"/>
|
||||||
|
<Scale X="0.300000012" Y="0.699999988" Z="4.30000019"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="Page1">
|
||||||
|
<Components>
|
||||||
|
<c:Page>
|
||||||
|
<ID>1</ID>
|
||||||
|
</c:Page>
|
||||||
|
<c:Transform>
|
||||||
|
<Orientation X="0" Y="0.989000022" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="MenuBackground">
|
||||||
|
<Components>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Core/ErrorTexture.png</DiffuseTexture>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0" Z="-1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="Button">
|
||||||
|
<Components>
|
||||||
|
<c:Button/>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Core/White.png</DiffuseTexture>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0.375197947" Z="0.0627754927"/>
|
||||||
|
<Scale X="0.600000024" Y="0.150000006" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="Text">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>Resolution</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
<Color A="1" B="1" G="0.847058833" R="0"/>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-0.00710564246" Y="-0.203304529" Z="0.00999999978"/>
|
||||||
|
<Scale X="0.300000012" Y="0.699999988" Z="4.30000019"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="Button">
|
||||||
|
<Components>
|
||||||
|
<c:Button/>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Core/White.png</DiffuseTexture>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0.199327558" Z="0.0627754927"/>
|
||||||
|
<Scale X="0.600000024" Y="0.150000006" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="Text">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>Option2</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
<Color A="1" B="1" G="0.847058833" R="0"/>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-0.00710564246" Y="-0.203304529" Z="0.00999999978"/>
|
||||||
|
<Scale X="0.300000012" Y="0.699999988" Z="4.30000019"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="Button">
|
||||||
|
<Components>
|
||||||
|
<c:Button/>
|
||||||
|
<c:Sprite>
|
||||||
|
<DiffuseTexture>Textures/Core/White.png</DiffuseTexture>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0.0159880854" Z="0.0627754927"/>
|
||||||
|
<Scale X="0.600000024" Y="0.150000006" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="Text">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>Butts</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
<Color A="1" B="1" G="0.847058833" R="0"/>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-0.00710564246" Y="-0.203304529" Z="0.00999999978"/>
|
||||||
|
<Scale X="0.300000012" Y="0.699999988" Z="4.30000019"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
|
||||||
|
</Entity>
|
||||||
@@ -47,6 +47,10 @@
|
|||||||
<xs:element ref="c:KillFeed" minOccurs="0"/>
|
<xs:element ref="c:KillFeed" minOccurs="0"/>
|
||||||
<xs:element ref="c:Sprite" minOccurs="0"/>
|
<xs:element ref="c:Sprite" minOccurs="0"/>
|
||||||
<xs:element ref="c:AnimationOffset" minOccurs="0"/>
|
<xs:element ref="c:AnimationOffset" minOccurs="0"/>
|
||||||
|
<xs:element ref="c:Menu" minOccurs="0"/>
|
||||||
|
<xs:element ref="c:Page" minOccurs="0"/>
|
||||||
|
<xs:element ref="c:Button" minOccurs="0"/>
|
||||||
|
<xs:element ref="c:WeaponAttachment" minOccurs="0"/>
|
||||||
</xs:all>
|
</xs:all>
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ void main()
|
|||||||
vec4 bloomColor = texture(BloomTexture, Input.TextureCoordinate);
|
vec4 bloomColor = texture(BloomTexture, Input.TextureCoordinate);
|
||||||
vec4 hdrColorLowRes = texture(SceneTextureLowRes, Input.TextureCoordinate);
|
vec4 hdrColorLowRes = texture(SceneTextureLowRes, Input.TextureCoordinate);
|
||||||
vec4 bloomColorLowRes = texture(BloomTextureLowRes, Input.TextureCoordinate);
|
vec4 bloomColorLowRes = texture(BloomTextureLowRes, Input.TextureCoordinate);
|
||||||
|
|
||||||
|
//hdrColor = hdrColor * SSAO;
|
||||||
hdrColor += bloomColor;
|
hdrColor += bloomColor;
|
||||||
hdrColorLowRes;
|
hdrColorLowRes;
|
||||||
|
|
||||||
@@ -33,7 +35,6 @@ void main()
|
|||||||
|
|
||||||
//gamme correction
|
//gamme correction
|
||||||
result = pow(result, vec3(1.0 / Gamma));
|
result = pow(result, vec3(1.0 / Gamma));
|
||||||
|
|
||||||
fragmentColor = vec4(result, 1.0);
|
fragmentColor = vec4(result, 1.0);
|
||||||
//fragmentColor = hdrColor;
|
//fragmentColor = hdrColor;
|
||||||
//fragmentColor = bloomColor;
|
//fragmentColor = bloomColor;
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
#version 430
|
#version 430
|
||||||
|
|
||||||
|
#define MIN_AMBIENT_LIGHT 0.3
|
||||||
|
|
||||||
uniform mat4 M;
|
uniform mat4 M;
|
||||||
uniform mat4 V;
|
uniform mat4 V;
|
||||||
uniform mat4 P;
|
uniform mat4 P;
|
||||||
@@ -9,15 +11,19 @@ uniform vec2 ScreenDimensions;
|
|||||||
uniform vec4 FillColor;
|
uniform vec4 FillColor;
|
||||||
uniform vec4 AmbientColor;
|
uniform vec4 AmbientColor;
|
||||||
uniform float FillPercentage;
|
uniform float FillPercentage;
|
||||||
|
uniform float GlowIntensity = 10;
|
||||||
|
uniform vec3 CameraPosition;
|
||||||
|
|
||||||
uniform vec2 DiffuseUVRepeat;
|
uniform vec2 DiffuseUVRepeat;
|
||||||
uniform vec2 NormalUVRepeat;
|
uniform vec2 NormalUVRepeat;
|
||||||
uniform vec2 SpecularUVRepeat;
|
uniform vec2 SpecularUVRepeat;
|
||||||
uniform vec2 GlowUVRepeat;
|
uniform vec2 GlowUVRepeat;
|
||||||
layout (binding = 0) uniform sampler2D DiffuseTexture;
|
layout (binding = 0) uniform sampler2D AOTexture;
|
||||||
layout (binding = 1) uniform sampler2D NormalMapTexture;
|
layout (binding = 1) uniform sampler2D DiffuseTexture;
|
||||||
layout (binding = 2) uniform sampler2D SpecularMapTexture;
|
layout (binding = 2) uniform sampler2D NormalMapTexture;
|
||||||
layout (binding = 3) uniform sampler2D GlowMapTexture;
|
layout (binding = 3) uniform sampler2D SpecularMapTexture;
|
||||||
|
layout (binding = 4) uniform sampler2D GlowMapTexture;
|
||||||
|
layout (binding = 5) uniform samplerCube CubeMap;
|
||||||
|
|
||||||
#define TILE_SIZE 16
|
#define TILE_SIZE 16
|
||||||
|
|
||||||
@@ -72,7 +78,7 @@ struct LightResult {
|
|||||||
};
|
};
|
||||||
|
|
||||||
float CalcAttenuation(float radius, float dist, float falloff) {
|
float CalcAttenuation(float radius, float dist, float falloff) {
|
||||||
return 1.0 - smoothstep(radius * 0.3, radius, dist);
|
return 1.0 - smoothstep(radius * falloff, radius, dist);
|
||||||
}
|
}
|
||||||
|
|
||||||
vec4 CalcSpecular(vec4 lightColor, vec4 viewVec, vec4 lightVec, vec4 normal) {
|
vec4 CalcSpecular(vec4 lightColor, vec4 viewVec, vec4 lightVec, vec4 normal) {
|
||||||
@@ -119,6 +125,8 @@ vec4 CalcNormalMappedValue(vec3 normal, vec3 tangent, vec3 bitangent, vec2 textu
|
|||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
|
float ao = texelFetch(AOTexture, ivec2(gl_FragCoord.xy), 0).r;
|
||||||
|
ao = (clamp(1.0 - (1.0 - ao), 0.0, 1.0) + MIN_AMBIENT_LIGHT) / (1.0 + MIN_AMBIENT_LIGHT);
|
||||||
vec4 diffuseTexel = texture2D(DiffuseTexture, Input.TextureCoordinate * DiffuseUVRepeat);
|
vec4 diffuseTexel = texture2D(DiffuseTexture, Input.TextureCoordinate * DiffuseUVRepeat);
|
||||||
vec4 glowTexel = texture2D(GlowMapTexture, Input.TextureCoordinate * GlowUVRepeat);
|
vec4 glowTexel = texture2D(GlowMapTexture, Input.TextureCoordinate * GlowUVRepeat);
|
||||||
vec4 specularTexel = texture2D(SpecularMapTexture, Input.TextureCoordinate * SpecularUVRepeat);
|
vec4 specularTexel = texture2D(SpecularMapTexture, Input.TextureCoordinate * SpecularUVRepeat);
|
||||||
@@ -126,14 +134,18 @@ void main()
|
|||||||
vec4 normal = V * CalcNormalMappedValue(Input.Normal, Input.Tangent, Input.BiTangent, Input.TextureCoordinate * NormalUVRepeat, NormalMapTexture);
|
vec4 normal = V * CalcNormalMappedValue(Input.Normal, Input.Tangent, Input.BiTangent, Input.TextureCoordinate * NormalUVRepeat, NormalMapTexture);
|
||||||
normal = normalize(normal);
|
normal = normalize(normal);
|
||||||
//vec4 normal = normalize(V * vec4(Input.Normal, 0.0));
|
//vec4 normal = normalize(V * vec4(Input.Normal, 0.0));
|
||||||
vec4 viewVec = normalize(-position);
|
vec4 viewVec = normalize(-position);
|
||||||
|
vec3 I = normalize(vec3(M * vec4(Input.Position, 1.0)) - CameraPosition);
|
||||||
|
vec3 R = reflect(-I, Input.Normal);
|
||||||
|
//R = vec3(P * vec4(R, 1.0));
|
||||||
|
vec4 reflectionColor = texture(CubeMap, R);
|
||||||
|
|
||||||
vec2 tilePos;
|
vec2 tilePos;
|
||||||
tilePos.x = int(gl_FragCoord.x/TILE_SIZE);
|
tilePos.x = int(gl_FragCoord.x/TILE_SIZE);
|
||||||
tilePos.y = int(gl_FragCoord.y/TILE_SIZE);
|
tilePos.y = int(gl_FragCoord.y/TILE_SIZE);
|
||||||
|
|
||||||
LightResult totalLighting;
|
LightResult totalLighting;
|
||||||
totalLighting.Diffuse = vec4(AmbientColor.rgb, 1.0);
|
totalLighting.Diffuse = vec4(AmbientColor.rgb * ao, 1.0);
|
||||||
int currentTile = int(floor(gl_FragCoord.x/TILE_SIZE) + (floor(gl_FragCoord.y/TILE_SIZE) * int(ScreenDimensions.x/TILE_SIZE)));
|
int currentTile = int(floor(gl_FragCoord.x/TILE_SIZE) + (floor(gl_FragCoord.y/TILE_SIZE) * int(ScreenDimensions.x/TILE_SIZE)));
|
||||||
|
|
||||||
int start = int(LightGrids.Data[currentTile].Start);
|
int start = int(LightGrids.Data[currentTile].Start);
|
||||||
@@ -151,12 +163,14 @@ void main()
|
|||||||
} else if (light.Type == 2) { //Directional
|
} else if (light.Type == 2) { //Directional
|
||||||
light_result = CalcDirectionalLightSource(V * light.Direction, light.Color, light.Intensity, viewVec, normal);
|
light_result = CalcDirectionalLightSource(V * light.Direction, light.Color, light.Intensity, viewVec, normal);
|
||||||
}
|
}
|
||||||
totalLighting.Diffuse += light_result.Diffuse;
|
totalLighting.Diffuse += vec4(light_result.Diffuse.rgb * ao, light_result.Diffuse.a);
|
||||||
totalLighting.Specular += light_result.Specular;
|
totalLighting.Specular += vec4(light_result.Specular.rgb * ao, light_result.Specular.a);
|
||||||
}
|
}
|
||||||
|
|
||||||
vec4 color_result = mix((Color * diffuseTexel * DiffuseColor), Input.ExplosionColor, Input.ExplosionPercentageElapsed);
|
vec4 color_result = mix((Color * diffuseTexel * DiffuseColor), Input.ExplosionColor, Input.ExplosionPercentageElapsed);
|
||||||
color_result = color_result * (totalLighting.Diffuse + (totalLighting.Specular * specularTexel));
|
color_result = color_result * (totalLighting.Diffuse + (totalLighting.Specular * specularTexel));
|
||||||
|
float specularResult = (specularTexel.r + specularTexel.g + specularTexel.b)/3.0;
|
||||||
|
color_result = color_result * clamp(1/specularTexel, 0, 1)*2 + reflectionColor * clamp(specularTexel, 0, 1)/2;
|
||||||
//vec4 color_result = (DiffuseColor + Input.ExplosionColor) * (totalLighting.Diffuse + (totalLighting.Specular * specularTexel)) * diffuseTexel * Color;
|
//vec4 color_result = (DiffuseColor + Input.ExplosionColor) * (totalLighting.Diffuse + (totalLighting.Specular * specularTexel)) * diffuseTexel * Color;
|
||||||
|
|
||||||
|
|
||||||
@@ -166,9 +180,10 @@ void main()
|
|||||||
color_result += FillColor;
|
color_result += FillColor;
|
||||||
}
|
}
|
||||||
sceneColor = vec4(color_result.xyz, clamp(color_result.a, 0, 1));
|
sceneColor = vec4(color_result.xyz, clamp(color_result.a, 0, 1));
|
||||||
color_result += glowTexel*3;
|
//sceneColor = vec4(reflectionColor.xyz, 1);
|
||||||
|
color_result += glowTexel*GlowIntensity;
|
||||||
|
|
||||||
bloomColor = vec4(clamp(color_result.xyz - 1.0, 0, 100), 1.0);
|
bloomColor = vec4(clamp(color_result.xyz - 1.0, 0, 100), clamp(color_result.a, 0, 1));
|
||||||
|
|
||||||
//Tiled Debug Code
|
//Tiled Debug Code
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -23,12 +23,12 @@ out VertexData{
|
|||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
gl_Position = P*V*M * vec4(Position, 1.0);
|
gl_Position = P*V*M * vec4(Position, 1.0);
|
||||||
|
mat4 TIM = transpose(inverse(M));
|
||||||
Output.Position = Position;
|
Output.Position = Position;
|
||||||
Output.TextureCoordinate = TextureCoords;
|
Output.TextureCoordinate = TextureCoords;
|
||||||
Output.Normal = vec3(M * vec4(Normal, 0.0));
|
Output.Normal = vec3(TIM * vec4(Normal, 0.0));
|
||||||
Output.Tangent = vec3(M * vec4(Tangent, 0.0));
|
Output.Tangent = vec3(TIM * vec4(Tangent, 0.0));
|
||||||
Output.BiTangent = vec3(M * vec4(BiTangent, 0.0));
|
Output.BiTangent = vec3(TIM * vec4(BiTangent, 0.0));
|
||||||
Output.ExplosionColor = vec4(1.0);
|
Output.ExplosionColor = vec4(1.0);
|
||||||
Output.ExplosionPercentageElapsed = 0.0;
|
Output.ExplosionPercentageElapsed = 0.0;
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
#version 430
|
#version 430
|
||||||
|
|
||||||
|
#define MIN_AMBIENT_LIGHT 0.3
|
||||||
|
|
||||||
uniform mat4 M;
|
uniform mat4 M;
|
||||||
uniform mat4 V;
|
uniform mat4 V;
|
||||||
uniform mat4 P;
|
uniform mat4 P;
|
||||||
@@ -23,19 +25,20 @@ uniform vec2 SpecularUVRepeat3;
|
|||||||
uniform vec2 GlowUVRepeat1;
|
uniform vec2 GlowUVRepeat1;
|
||||||
uniform vec2 GlowUVRepeat2;
|
uniform vec2 GlowUVRepeat2;
|
||||||
uniform vec2 GlowUVRepeat3;
|
uniform vec2 GlowUVRepeat3;
|
||||||
layout (binding = 0) uniform sampler2D SplatMapTexture;
|
layout (binding = 0) uniform sampler2D AOTexture;
|
||||||
layout (binding = 1) uniform sampler2D DiffuseTexture1;
|
layout (binding = 1) uniform sampler2D SplatMapTexture;
|
||||||
layout (binding = 2) uniform sampler2D DiffuseTexture2;
|
layout (binding = 2) uniform sampler2D DiffuseTexture1;
|
||||||
layout (binding = 3) uniform sampler2D DiffuseTexture3;
|
layout (binding = 3) uniform sampler2D DiffuseTexture2;
|
||||||
layout (binding = 4) uniform sampler2D NormalMapTexture1;
|
layout (binding = 4) uniform sampler2D DiffuseTexture3;
|
||||||
layout (binding = 5) uniform sampler2D NormalMapTexture2;
|
layout (binding = 5) uniform sampler2D NormalMapTexture1;
|
||||||
layout (binding = 6) uniform sampler2D NormalMapTexture3;
|
layout (binding = 6) uniform sampler2D NormalMapTexture2;
|
||||||
layout (binding = 7) uniform sampler2D SpecularMapTexture1;
|
layout (binding = 7) uniform sampler2D NormalMapTexture3;
|
||||||
layout (binding = 8) uniform sampler2D SpecularMapTexture2;
|
layout (binding = 8) uniform sampler2D SpecularMapTexture1;
|
||||||
layout (binding = 9) uniform sampler2D SpecularMapTexture3;
|
layout (binding = 9) uniform sampler2D SpecularMapTexture2;
|
||||||
layout (binding = 10) uniform sampler2D GlowMapTexture1;
|
layout (binding = 10) uniform sampler2D SpecularMapTexture3;
|
||||||
layout (binding = 11) uniform sampler2D GlowMapTexture2;
|
layout (binding = 11) uniform sampler2D GlowMapTexture1;
|
||||||
layout (binding = 12) uniform sampler2D GlowMapTexture3;
|
layout (binding = 12) uniform sampler2D GlowMapTexture2;
|
||||||
|
layout (binding = 13) uniform sampler2D GlowMapTexture3;
|
||||||
|
|
||||||
#define TILE_SIZE 16
|
#define TILE_SIZE 16
|
||||||
|
|
||||||
@@ -174,6 +177,9 @@ vec4 CalcBlendedNormal(vec4 blendValue, sampler2D R, sampler2D G, sampler2D B,
|
|||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
|
float ao = texelFetch(AOTexture, ivec2(gl_FragCoord.xy), 0).r;
|
||||||
|
ao = (clamp(1.0 - (1.0 - ao), 0.0, 1.0) + MIN_AMBIENT_LIGHT) / (1.0 + MIN_AMBIENT_LIGHT);
|
||||||
|
|
||||||
vec4 splatTexel = texture2D(SplatMapTexture, Input.TextureCoordinate);
|
vec4 splatTexel = texture2D(SplatMapTexture, Input.TextureCoordinate);
|
||||||
|
|
||||||
vec4 diffuseTexel = CalcBlendedTexel(splatTexel, DiffuseTexture1, DiffuseTexture2, DiffuseTexture3,
|
vec4 diffuseTexel = CalcBlendedTexel(splatTexel, DiffuseTexture1, DiffuseTexture2, DiffuseTexture3,
|
||||||
@@ -195,7 +201,7 @@ void main()
|
|||||||
tilePos.y = int(gl_FragCoord.y/TILE_SIZE);
|
tilePos.y = int(gl_FragCoord.y/TILE_SIZE);
|
||||||
|
|
||||||
LightResult totalLighting;
|
LightResult totalLighting;
|
||||||
totalLighting.Diffuse = vec4(AmbientColor.rgb, 1.0);
|
totalLighting.Diffuse = vec4(AmbientColor.rgb * ao, 1.0);
|
||||||
int currentTile = int(floor(gl_FragCoord.x/TILE_SIZE) + (floor(gl_FragCoord.y/TILE_SIZE) * int(ScreenDimensions.x/TILE_SIZE)));
|
int currentTile = int(floor(gl_FragCoord.x/TILE_SIZE) + (floor(gl_FragCoord.y/TILE_SIZE) * int(ScreenDimensions.x/TILE_SIZE)));
|
||||||
|
|
||||||
int start = int(LightGrids.Data[currentTile].Start);
|
int start = int(LightGrids.Data[currentTile].Start);
|
||||||
@@ -213,8 +219,8 @@ void main()
|
|||||||
} else if (light.Type == 2) { //Directional
|
} else if (light.Type == 2) { //Directional
|
||||||
light_result = CalcDirectionalLightSource(V * light.Direction, light.Color, light.Intensity, viewVec, normal);
|
light_result = CalcDirectionalLightSource(V * light.Direction, light.Color, light.Intensity, viewVec, normal);
|
||||||
}
|
}
|
||||||
totalLighting.Diffuse += light_result.Diffuse;
|
totalLighting.Diffuse += vec4(light_result.Diffuse.rgb * ao, light_result.Diffuse.a);
|
||||||
totalLighting.Specular += light_result.Specular;
|
totalLighting.Specular += vec4(light_result.Specular.rgb * ao, light_result.Specular.a);
|
||||||
}
|
}
|
||||||
|
|
||||||
vec4 color_result = mix((Color * diffuseTexel * DiffuseColor), Input.ExplosionColor, Input.ExplosionPercentageElapsed);
|
vec4 color_result = mix((Color * diffuseTexel * DiffuseColor), Input.ExplosionColor, Input.ExplosionPercentageElapsed);
|
||||||
|
|||||||
@@ -0,0 +1,114 @@
|
|||||||
|
#version 430
|
||||||
|
|
||||||
|
//Number of samples per pixel
|
||||||
|
uniform int uNumOfSamples;
|
||||||
|
//#define NUM_SAMPLES (11)
|
||||||
|
|
||||||
|
//Number of turns around the cirle
|
||||||
|
uniform int uNumOfTurns;
|
||||||
|
//#define NUM_TURNS (7)
|
||||||
|
|
||||||
|
layout (binding = 0) uniform sampler2D ViewSpaceZ;
|
||||||
|
|
||||||
|
uniform vec4 uProjInfo;
|
||||||
|
|
||||||
|
uniform float uProjScale;
|
||||||
|
//#define ProjScale 500
|
||||||
|
|
||||||
|
uniform float uRadius;
|
||||||
|
//#define Radius 1.0f
|
||||||
|
|
||||||
|
uniform float uBias;
|
||||||
|
//#define Bias 0.012f
|
||||||
|
|
||||||
|
uniform float uContrast;
|
||||||
|
//#define IntensityDivR6 1
|
||||||
|
|
||||||
|
uniform float uIntensityScale;
|
||||||
|
|
||||||
|
out float AO;
|
||||||
|
|
||||||
|
vec3 getVSPosition(ivec2 ScreenSpaceCoord) {
|
||||||
|
float z = texelFetch(ViewSpaceZ, ScreenSpaceCoord, 0).r;
|
||||||
|
//Get the xy view space coordinates and add the z value from ViewSpaceZ buffer.
|
||||||
|
return vec3((uProjInfo[0] + (ScreenSpaceCoord.x * uProjInfo[1])) * z, (uProjInfo[2] + (ScreenSpaceCoord.y * uProjInfo[3])) * z, z);
|
||||||
|
}
|
||||||
|
|
||||||
|
vec3 getVSFaceNormal(vec3 ViewSpacePosition) {
|
||||||
|
// Get tangets vector for the plane and ViewSpacePositin... don't ask how this functions works. It's pure magic.
|
||||||
|
// They do this and it just works... I would guess that they approximate the function of a plane from pixels close to the pixel were on now.
|
||||||
|
return normalize(cross(dFdx(ViewSpacePosition), dFdy(ViewSpacePosition)));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
vec3 getSampleViewSpacePos(ivec2 ScreenSpaceCoord, int SampleIndex, float RotationAngle, float ScreenSpaceSampleRadius){
|
||||||
|
// Pure Magic...
|
||||||
|
float alpha = float(SampleIndex) * (1.0 / uNumOfSamples);
|
||||||
|
|
||||||
|
// Angle to where to sample
|
||||||
|
float angle = alpha * (uNumOfTurns * 6.28) + RotationAngle;
|
||||||
|
|
||||||
|
//Lenght to were to sample
|
||||||
|
ScreenSpaceSampleRadius = ScreenSpaceSampleRadius * alpha;
|
||||||
|
|
||||||
|
vec2 screenSpaceSampleOffsetVecor = vec2(cos(angle), sin(angle));
|
||||||
|
|
||||||
|
// Get texel coordinate on where to sample by going screenSpaceSampleOffsetVecor direction in ScreenSpaceSampleRadius units from ScreenSpaceCoord (the point being shaded);
|
||||||
|
ivec2 screenSpaceSampleTexel = ivec2(ScreenSpaceSampleRadius * screenSpaceSampleOffsetVecor) + ScreenSpaceCoord;
|
||||||
|
|
||||||
|
return getVSPosition(screenSpaceSampleTexel);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
float sampleAO(ivec2 ScreenSpaceCoord, vec3 Origin, vec3 OriginNormal, float ScreenSpaceSampleRadius, int SampleIndex, float RotationAngle, float Radius) {
|
||||||
|
float radius2 = Radius * Radius;
|
||||||
|
vec3 sampleViewSpacePosition = getSampleViewSpacePos(ScreenSpaceCoord, SampleIndex, RotationAngle, ScreenSpaceSampleRadius);
|
||||||
|
|
||||||
|
vec3 sampleVector = Origin - sampleViewSpacePosition;
|
||||||
|
|
||||||
|
// vv = sampleVectorLenght ^ 2
|
||||||
|
float vv = dot(sampleVector, sampleVector);
|
||||||
|
// vn = angle between sampleVector and Normal
|
||||||
|
float vn = dot(sampleVector, OriginNormal);
|
||||||
|
|
||||||
|
const float epsilon = 0.0001f;
|
||||||
|
|
||||||
|
// vv < radius2 if the vector is shorter then the radius;
|
||||||
|
// vn - bias, offset the angle to reduse self occlusion.
|
||||||
|
// epsilon is here to make divison by 0 impossible.
|
||||||
|
return float(vv < radius2) * max((vn - uBias) / (epsilon + vv), 0.0);
|
||||||
|
//float f = max(radius2 - vv, 0.0);
|
||||||
|
//return f * f * f * max((vn - uBias) / (epsilon + vv), 0.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
ivec2 originScreenCoord = ivec2(gl_FragCoord.xy);
|
||||||
|
|
||||||
|
vec3 origin = getVSPosition(originScreenCoord);
|
||||||
|
|
||||||
|
float radius;
|
||||||
|
if(origin.z < uRadius){
|
||||||
|
radius = origin.z;
|
||||||
|
} else {
|
||||||
|
radius = uRadius;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
vec3 originNormal = getVSFaceNormal(origin);
|
||||||
|
|
||||||
|
float screenSpaceSampleRadius = -uProjScale * radius / origin.z;
|
||||||
|
|
||||||
|
float rotationAngleOffset = 30 * originScreenCoord.x ^ originScreenCoord.y + 10 * originScreenCoord.x * originScreenCoord.y;
|
||||||
|
|
||||||
|
float sum = 0.0;
|
||||||
|
for (int i = 0; i < uNumOfSamples; i++) {
|
||||||
|
sum += sampleAO(originScreenCoord, origin, originNormal, screenSpaceSampleRadius, i, rotationAngleOffset, radius);
|
||||||
|
}
|
||||||
|
|
||||||
|
//float A = max(0.0, 1.0 - sum * (2.0f / uNumOfSamples));
|
||||||
|
float A = 1.0 - sum * (2.0f * uIntensityScale / float(uNumOfSamples));
|
||||||
|
AO = clamp(pow(A, uContrast), 0.0f, 1.0f);
|
||||||
|
//AO = vec4(originNormal, 1.0f);
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
#version 430
|
||||||
|
|
||||||
|
layout (location = 0) in vec3 Position;
|
||||||
|
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
gl_Position = vec4(Position, 1.0);
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
#version 430
|
||||||
|
|
||||||
|
layout (binding = 0) uniform sampler2D DepthBuffer;
|
||||||
|
uniform vec3 ClipInfo;
|
||||||
|
|
||||||
|
out float depthLinear;
|
||||||
|
//Just for Debug, should be depthLinear
|
||||||
|
//out vec4 fragmentColor;
|
||||||
|
void main() {
|
||||||
|
float depthSample = texelFetch(DepthBuffer, ivec2(gl_FragCoord.xy), 0).r;
|
||||||
|
depthLinear = ClipInfo[0] / (ClipInfo[1] * depthSample + ClipInfo[2]);
|
||||||
|
//float depthLinear = (NearClip) / ( -depthSample + 1.0f);
|
||||||
|
//fragmentColor = vec4(depthLinear, depthLinear, depthLinear, 1.0f);
|
||||||
|
}
|
||||||
@@ -7,8 +7,8 @@ uniform mat4 M;
|
|||||||
uniform mat4 V;
|
uniform mat4 V;
|
||||||
uniform mat4 P;
|
uniform mat4 P;
|
||||||
|
|
||||||
layout (binding = 0) uniform sampler2D DiffuseTexture;
|
layout (binding = 1) uniform sampler2D DiffuseTexture;
|
||||||
layout (binding = 1) uniform sampler2D GlowMapTexture;
|
layout (binding = 2) uniform sampler2D GlowMapTexture;
|
||||||
|
|
||||||
|
|
||||||
in VertexData{
|
in VertexData{
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ project(TacticalZ-Engine)
|
|||||||
find_package(OpenGL REQUIRED)
|
find_package(OpenGL REQUIRED)
|
||||||
find_package(GLEW REQUIRED)
|
find_package(GLEW REQUIRED)
|
||||||
find_package(GLFW REQUIRED)
|
find_package(GLFW REQUIRED)
|
||||||
find_package(Boost REQUIRED COMPONENTS system filesystem thread chrono program_options)
|
find_package(Boost REQUIRED COMPONENTS system filesystem thread chrono timer program_options)
|
||||||
find_package(assimp REQUIRED)
|
find_package(assimp REQUIRED)
|
||||||
find_package(ZLIB REQUIRED)
|
find_package(ZLIB REQUIRED)
|
||||||
find_package(PNG REQUIRED)
|
find_package(PNG REQUIRED)
|
||||||
|
|||||||
@@ -207,7 +207,7 @@ bool RayVsModel(const Ray& ray,
|
|||||||
glm::vec3 v0 = Transform::TransformPoint(modelVertices[modelIndices[i++]].Position, modelMatrix);
|
glm::vec3 v0 = Transform::TransformPoint(modelVertices[modelIndices[i++]].Position, modelMatrix);
|
||||||
glm::vec3 v1 = Transform::TransformPoint(modelVertices[modelIndices[i++]].Position, modelMatrix);
|
glm::vec3 v1 = Transform::TransformPoint(modelVertices[modelIndices[i++]].Position, modelMatrix);
|
||||||
glm::vec3 v2 = Transform::TransformPoint(modelVertices[modelIndices[i++]].Position, modelMatrix);
|
glm::vec3 v2 = Transform::TransformPoint(modelVertices[modelIndices[i++]].Position, modelMatrix);
|
||||||
float dist = INFINITY;
|
float dist = outDistance;
|
||||||
float u;
|
float u;
|
||||||
float v;
|
float v;
|
||||||
if (RayVsTriangle(ray, v0, v1, v2, dist, u, v)) {
|
if (RayVsTriangle(ray, v0, v1, v2, dist, u, v)) {
|
||||||
@@ -366,7 +366,8 @@ bool AABBvsTriangle(const AABB& box,
|
|||||||
float verticalStepHeight,
|
float verticalStepHeight,
|
||||||
bool& isOnGround,
|
bool& isOnGround,
|
||||||
glm::vec3& boxVelocity,
|
glm::vec3& boxVelocity,
|
||||||
glm::vec3& outResolution)
|
glm::vec3& outResolution,
|
||||||
|
bool resolveCollision)
|
||||||
{
|
{
|
||||||
//Check so we don't have a zero area triangle when calculating the normal.
|
//Check so we don't have a zero area triangle when calculating the normal.
|
||||||
//Also, don't check a triangle facing away from the player.
|
//Also, don't check a triangle facing away from the player.
|
||||||
@@ -426,7 +427,7 @@ bool AABBvsTriangle(const AABB& box,
|
|||||||
//if projections don't overlap, return false.
|
//if projections don't overlap, return false.
|
||||||
if (!rectangleVsTriangle(boxMin, boxMax, t2D, resolutionVector, resolutionDist, pushedFromTriangleLine)) {
|
if (!rectangleVsTriangle(boxMin, boxMax, t2D, resolutionVector, resolutionDist, pushedFromTriangleLine)) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else if (resolveCollision) {
|
||||||
//Overwrite the smallest resolution if this is smaller.
|
//Overwrite the smallest resolution if this is smaller.
|
||||||
if (resolutionDist < resolveShortest.DistanceSq) {
|
if (resolutionDist < resolveShortest.DistanceSq) {
|
||||||
resolveShortest.Vector = glm::vec3(0.f);
|
resolveShortest.Vector = glm::vec3(0.f);
|
||||||
@@ -463,6 +464,11 @@ bool AABBvsTriangle(const AABB& box,
|
|||||||
if (glm::abs(t) > 1) {
|
if (glm::abs(t) > 1) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!resolveCollision) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
glm::vec3 cornerResolution = (1+t) * diagonal;
|
glm::vec3 cornerResolution = (1+t) * diagonal;
|
||||||
//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);
|
||||||
@@ -537,7 +543,8 @@ bool AABBvsTriangles(const AABB& box,
|
|||||||
glm::vec3& boxVelocity,
|
glm::vec3& boxVelocity,
|
||||||
float verticalStepHeight,
|
float verticalStepHeight,
|
||||||
bool& isOnGround,
|
bool& isOnGround,
|
||||||
glm::vec3& outResolutionVector)
|
glm::vec3& outResolutionVector,
|
||||||
|
bool resolveCollision)
|
||||||
{
|
{
|
||||||
bool hit = false;
|
bool hit = false;
|
||||||
|
|
||||||
@@ -553,7 +560,7 @@ bool AABBvsTriangles(const AABB& box,
|
|||||||
};
|
};
|
||||||
glm::vec3 outVec;
|
glm::vec3 outVec;
|
||||||
bool collideWithGround = isOnGround;
|
bool collideWithGround = isOnGround;
|
||||||
if (AABBvsTriangle(newBox, triVertices, originalBoxVelocity, verticalStepHeight, collideWithGround, boxVelocity, outVec)) {
|
if (AABBvsTriangle(newBox, triVertices, originalBoxVelocity, verticalStepHeight, collideWithGround, boxVelocity, outVec, resolveCollision)) {
|
||||||
hit = true;
|
hit = true;
|
||||||
outResolutionVector += outVec;
|
outResolutionVector += outVec;
|
||||||
newBox = AABB::FromOriginSize(newBox.Origin() + outVec, newBox.Size());
|
newBox = AABB::FromOriginSize(newBox.Origin() + outVec, newBox.Size());
|
||||||
@@ -569,6 +576,44 @@ bool AABBvsTriangles(const AABB& box,
|
|||||||
return hit;
|
return hit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool AABBvsTriangles(const AABB& box,
|
||||||
|
const RawModel::Vertex* modelVertices,
|
||||||
|
const std::vector<unsigned int>& modelIndices,
|
||||||
|
const glm::mat4& modelMatrix,
|
||||||
|
glm::vec3& boxVelocity,
|
||||||
|
float verticalStepHeight,
|
||||||
|
bool& isOnGround,
|
||||||
|
glm::vec3& outResolutionVector)
|
||||||
|
{
|
||||||
|
return AABBvsTriangles(box,
|
||||||
|
modelVertices,
|
||||||
|
modelIndices,
|
||||||
|
modelMatrix,
|
||||||
|
boxVelocity,
|
||||||
|
verticalStepHeight,
|
||||||
|
isOnGround,
|
||||||
|
outResolutionVector,
|
||||||
|
true);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool AABBvsTriangles(const AABB& box,
|
||||||
|
const RawModel::Vertex* modelVertices,
|
||||||
|
const std::vector<unsigned int>& modelIndices,
|
||||||
|
const glm::mat4& modelMatrix)
|
||||||
|
{
|
||||||
|
glm::vec3 vel, outres;
|
||||||
|
bool g;
|
||||||
|
return AABBvsTriangles(box,
|
||||||
|
modelVertices,
|
||||||
|
modelIndices,
|
||||||
|
modelMatrix,
|
||||||
|
vel,
|
||||||
|
0.f,
|
||||||
|
g,
|
||||||
|
outres,
|
||||||
|
false);
|
||||||
|
}
|
||||||
|
|
||||||
boost::optional<EntityAABB> EntityAbsoluteAABB(EntityWrapper& entity, bool takeModelBox)
|
boost::optional<EntityAABB> EntityAbsoluteAABB(EntityWrapper& entity, bool takeModelBox)
|
||||||
{
|
{
|
||||||
AABB modelSpaceBox;
|
AABB modelSpaceBox;
|
||||||
@@ -648,8 +693,9 @@ boost::optional<EntityAABB> EntityFirstHitByRay(const Ray& ray, std::vector<Enti
|
|||||||
if (!entityBox.Entity.HasComponent("Model")) {
|
if (!entityBox.Entity.HasComponent("Model")) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
std::string res = entityBox.Entity["Model"]["Resource"];
|
auto& cModel = entityBox.Entity["Model"];
|
||||||
if (res.empty()) {
|
std::string res = cModel["Resource"];
|
||||||
|
if (res.empty() || (bool)cModel["Transparent"] || !((bool)cModel["Visible"])) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
Model* model;
|
Model* model;
|
||||||
|
|||||||
@@ -3,24 +3,71 @@
|
|||||||
#include "Core/AABB.h"
|
#include "Core/AABB.h"
|
||||||
#include "Rendering/Model.h"
|
#include "Rendering/Model.h"
|
||||||
|
|
||||||
void CollisionSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper& component, double dt)
|
void CollisionSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper& cPhysics, double dt)
|
||||||
{
|
{
|
||||||
if (!entity.HasComponent("Physics")) {
|
if (!entity.HasComponent("Collidable")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ComponentWrapper& cPhysics = entity["Physics"];
|
|
||||||
|
|
||||||
boost::optional<EntityAABB> boundingBox = Collision::EntityAbsoluteAABB(entity);
|
boost::optional<EntityAABB> boundingBox = Collision::EntityAbsoluteAABB(entity);
|
||||||
if (!boundingBox) {
|
if (!boundingBox) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ComponentWrapper& cTransform = entity["Transform"];
|
ComponentWrapper& cTransform = entity["Transform"];
|
||||||
EntityAABB& boxA = *boundingBox;
|
EntityAABB& boxA = *boundingBox;
|
||||||
|
bool everHitTheGround = false;
|
||||||
|
|
||||||
|
glm::vec3 size = boxA.Size();
|
||||||
|
float diameter = std::min(size.x, size.z);
|
||||||
|
glm::vec3 prevOrigin = (glm::vec3)cPhysics["PrevOrigin"];
|
||||||
|
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.
|
||||||
|
bool traceCollision = rayLength > diameter;
|
||||||
|
//hack solution: If prevOrigin is less than -9000 in all dimensions,
|
||||||
|
//then it means it is not set, i.e. this is the first collision check for the entity.
|
||||||
|
if (traceCollision && glm::any(glm::greaterThan((glm::vec3)cPhysics["PrevOrigin"], glm::vec3(-9000.f)))) {
|
||||||
|
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&) {
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Collide against octree items
|
// Collide against octree items
|
||||||
m_OctreeResult.clear();
|
m_OctreeResult.clear();
|
||||||
m_Octree->ObjectsInSameRegion(*boundingBox, m_OctreeResult);
|
m_Octree->ObjectsInSameRegion(*boundingBox, m_OctreeResult);
|
||||||
bool everHitTheGround = false;
|
|
||||||
for (auto& boxB : m_OctreeResult) {
|
for (auto& boxB : m_OctreeResult) {
|
||||||
glm::vec3 resolutionVector;
|
glm::vec3 resolutionVector;
|
||||||
if (boxA.Entity == boxB.Entity) {
|
if (boxA.Entity == boxB.Entity) {
|
||||||
@@ -64,4 +111,6 @@ void CollisionSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper& c
|
|||||||
if (!everHitTheGround) {
|
if (!everHitTheGround) {
|
||||||
(bool)cPhysics["IsOnGround"] = false;
|
(bool)cPhysics["IsOnGround"] = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
(glm::vec3&)cPhysics["PrevOrigin"] = boxA.Origin();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
#include "Core/ComponentPool.h"
|
#include "Core/ComponentPool.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ComponentWrapper ComponentPoolForwardIterator::operator*() const
|
ComponentWrapper ComponentPoolForwardIterator::operator*() const
|
||||||
{
|
{
|
||||||
char* data = &(*m_MemoryPoolIterator);
|
char* data = &(*m_MemoryPoolIterator);
|
||||||
@@ -32,6 +30,34 @@ ComponentPoolForwardIterator& ComponentPoolForwardIterator::operator++()
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ComponentPool::ComponentPool(const ComponentPool& other)
|
||||||
|
: m_ComponentInfo(other.m_ComponentInfo)
|
||||||
|
, m_Pool(other.m_Pool)
|
||||||
|
, m_EntityToComponent()
|
||||||
|
{
|
||||||
|
// Update EntityToComponent pointers
|
||||||
|
for (char& ptr : m_Pool) {
|
||||||
|
EntityID entity = *reinterpret_cast<EntityID*>(&ptr);
|
||||||
|
m_EntityToComponent[entity] = &ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Duplicate strings
|
||||||
|
for (auto& name : m_ComponentInfo.StringFields) {
|
||||||
|
for (auto& c : *this) {
|
||||||
|
std::string& val = c[name];
|
||||||
|
ComponentWrapper::SolidifyStrings(c);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ComponentPool::~ComponentPool()
|
||||||
|
{
|
||||||
|
// Destroy component data
|
||||||
|
for (auto& c : *this) {
|
||||||
|
ComponentWrapper::Destroy(c.Info, c.Data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//const ::ComponentInfo& ComponentPool::ComponentInfo() const
|
//const ::ComponentInfo& ComponentPool::ComponentInfo() const
|
||||||
//{
|
//{
|
||||||
// return m_ComponentInfo;
|
// return m_ComponentInfo;
|
||||||
@@ -39,10 +65,19 @@ ComponentPoolForwardIterator& ComponentPoolForwardIterator::operator++()
|
|||||||
|
|
||||||
ComponentWrapper ComponentPool::Allocate(EntityID entity)
|
ComponentWrapper ComponentPool::Allocate(EntityID entity)
|
||||||
{
|
{
|
||||||
|
// Allocate pool data
|
||||||
char* data = m_Pool.Allocate();
|
char* data = m_Pool.Allocate();
|
||||||
|
// Copy EntityID
|
||||||
memcpy(data, &entity, sizeof(EntityID));
|
memcpy(data, &entity, sizeof(EntityID));
|
||||||
|
|
||||||
m_EntityToComponent[entity] = data;
|
m_EntityToComponent[entity] = data;
|
||||||
return ComponentWrapper(m_ComponentInfo, data);
|
ComponentWrapper component(m_ComponentInfo, data);
|
||||||
|
|
||||||
|
// Copy defaults
|
||||||
|
memcpy(component.Data, m_ComponentInfo.Defaults.get(), m_ComponentInfo.Stride);
|
||||||
|
ComponentWrapper::SolidifyStrings(component);
|
||||||
|
|
||||||
|
return component;
|
||||||
}
|
}
|
||||||
|
|
||||||
ComponentWrapper ComponentPool::GetByEntity(EntityID ent)
|
ComponentWrapper ComponentPool::GetByEntity(EntityID ent)
|
||||||
@@ -57,6 +92,7 @@ bool ComponentPool::KnowsEntity(EntityID ent)
|
|||||||
|
|
||||||
void ComponentPool::Delete(ComponentWrapper& wrapper)
|
void ComponentPool::Delete(ComponentWrapper& wrapper)
|
||||||
{
|
{
|
||||||
|
ComponentWrapper::Destroy(wrapper.Info, wrapper.Data);
|
||||||
m_EntityToComponent.erase(wrapper.EntityID);
|
m_EntityToComponent.erase(wrapper.EntityID);
|
||||||
m_Pool.Free(wrapper.Data - sizeof(EntityID));
|
m_Pool.Free(wrapper.Data - sizeof(EntityID));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -185,6 +185,9 @@ void EntityFilePreprocessor::parseComponentInfo()
|
|||||||
field.Offset = fieldOffset;
|
field.Offset = fieldOffset;
|
||||||
field.Stride = stride;
|
field.Stride = stride;
|
||||||
compInfo.FieldsInOrder.push_back(name);
|
compInfo.FieldsInOrder.push_back(name);
|
||||||
|
if (field.Type == "string") {
|
||||||
|
compInfo.StringFields.push_back(name);
|
||||||
|
}
|
||||||
fieldOffset += stride;
|
fieldOffset += stride;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -201,7 +204,7 @@ void EntityFilePreprocessor::parseDefaults()
|
|||||||
|
|
||||||
for (auto& ci : m_ComponentInfo) {
|
for (auto& ci : m_ComponentInfo) {
|
||||||
// Allocate memory for default values
|
// Allocate memory for default values
|
||||||
ci.second.Defaults = std::shared_ptr<char>(new char[ci.second.Stride]);
|
ci.second.Defaults = boost::shared_array<char>(new char[ci.second.Stride], std::bind(&ComponentWrapper::Destroy, ci.second, std::placeholders::_1));
|
||||||
memset(ci.second.Defaults.get(), 0, ci.second.Stride);
|
memset(ci.second.Defaults.get(), 0, ci.second.Stride);
|
||||||
|
|
||||||
std::string componentName = ci.first;
|
std::string componentName = ci.first;
|
||||||
|
|||||||
@@ -51,6 +51,13 @@ EntityWrapper EntityWrapper::FirstParentWithComponent(const std::string& compone
|
|||||||
return EntityWrapper::Invalid;
|
return EntityWrapper::Invalid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::vector<EntityWrapper> EntityWrapper::ChildrenWithComponent(const std::string& componentType)
|
||||||
|
{
|
||||||
|
std::vector<EntityWrapper> childrenWithComponent;
|
||||||
|
childrenWithComponentRecursive(componentType, *this, childrenWithComponent);
|
||||||
|
return childrenWithComponent;
|
||||||
|
}
|
||||||
|
|
||||||
bool EntityWrapper::IsChildOf(EntityWrapper potentialParent)
|
bool EntityWrapper::IsChildOf(EntityWrapper potentialParent)
|
||||||
{
|
{
|
||||||
EntityWrapper entity = *this;
|
EntityWrapper entity = *this;
|
||||||
@@ -131,3 +138,18 @@ EntityWrapper EntityWrapper::firstChildByNameRecursive(const std::string& name,
|
|||||||
return EntityWrapper::Invalid;
|
return EntityWrapper::Invalid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EntityWrapper::childrenWithComponentRecursive(const std::string& componentType, EntityWrapper& entity, std::vector<EntityWrapper>& childrenWithComponent)
|
||||||
|
{
|
||||||
|
auto itPair = this->World->GetChildren(entity.ID);
|
||||||
|
if (itPair.first == itPair.second) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (auto it = itPair.first; it != itPair.second; ++it) {
|
||||||
|
if (entity.HasComponent(componentType)) {
|
||||||
|
childrenWithComponent.push_back(entity);
|
||||||
|
}
|
||||||
|
childrenWithComponentRecursive(componentType, entity, childrenWithComponent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,76 @@
|
|||||||
|
#include "Core/PerformanceTimer.h"
|
||||||
|
#include <ctime>
|
||||||
|
#include <fstream>
|
||||||
|
|
||||||
|
cpu_timer PerformanceTimer::m_Timer;
|
||||||
|
std::map<std::string, cpu_timer> PerformanceTimer::timers;
|
||||||
|
std::string PerformanceTimer::currentTimerRunning = "";
|
||||||
|
|
||||||
|
void PerformanceTimer::StartTimer(std::string nameOfTimer)
|
||||||
|
{
|
||||||
|
timers[nameOfTimer].stop();
|
||||||
|
timers[nameOfTimer].start();
|
||||||
|
currentTimerRunning = nameOfTimer;
|
||||||
|
}
|
||||||
|
|
||||||
|
void PerformanceTimer::StartTimerAndStopPrevious(std::string nameOfTimer)
|
||||||
|
{
|
||||||
|
//stop the current timer and start some other - useful to not have to stop timers all the time
|
||||||
|
if (currentTimerRunning != "") {
|
||||||
|
timers[currentTimerRunning].stop();
|
||||||
|
}
|
||||||
|
timers[nameOfTimer].stop();
|
||||||
|
timers[nameOfTimer].start();
|
||||||
|
currentTimerRunning = nameOfTimer;
|
||||||
|
}
|
||||||
|
|
||||||
|
void PerformanceTimer::StopTimer(std::string nameOfTimer)
|
||||||
|
{
|
||||||
|
timers[nameOfTimer].stop();
|
||||||
|
currentTimerRunning = nameOfTimer;
|
||||||
|
}
|
||||||
|
|
||||||
|
void PerformanceTimer::SetFrameNumber(int frameNumber)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void PerformanceTimer::ResetAllTimers()
|
||||||
|
{
|
||||||
|
//stop all timers
|
||||||
|
for (auto aTimer : timers)
|
||||||
|
{
|
||||||
|
aTimer.second.stop();
|
||||||
|
}
|
||||||
|
currentTimerRunning = "";
|
||||||
|
timers.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
void PerformanceTimer::CreateExcelData()
|
||||||
|
{
|
||||||
|
//get time
|
||||||
|
std::time_t t = std::time(NULL);
|
||||||
|
char tStr[16];
|
||||||
|
std::strftime(tStr, 32, " %a %H-%M-%S", std::localtime(&t));
|
||||||
|
std::string time(tStr);
|
||||||
|
std::string path("TacticalZ");
|
||||||
|
path += time + ".csv";
|
||||||
|
std::ofstream someFileStream;
|
||||||
|
someFileStream.open(path, std::ofstream::out);
|
||||||
|
someFileStream << "classname" << ',' << "walltime" << ',' << "userTime" << ',' << "systemTime" << '\n';
|
||||||
|
|
||||||
|
//write all timers to file
|
||||||
|
for (auto aTimer : timers)
|
||||||
|
{
|
||||||
|
//remove the "class" name in front of the string
|
||||||
|
auto className = aTimer.first;
|
||||||
|
if (className.find("class ") != std::string::npos) {
|
||||||
|
className.replace(0, 6, "");
|
||||||
|
}
|
||||||
|
auto wallTime = (double)aTimer.second.elapsed().wall*1e-3;
|
||||||
|
auto userTime = (double)aTimer.second.elapsed().user*1e-3;
|
||||||
|
auto systemTime = (double)aTimer.second.elapsed().system*1e-3;
|
||||||
|
|
||||||
|
someFileStream << className << "," << wallTime << ',' << userTime << ',' << systemTime << '\n';
|
||||||
|
}
|
||||||
|
someFileStream.close();
|
||||||
|
}
|
||||||
@@ -9,7 +9,20 @@ World::~World()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
EntityID World::CreateEntity(EntityID parent /*= 0*/)
|
World::World(const World& other)
|
||||||
|
: m_EventBroker(other.m_EventBroker)
|
||||||
|
, m_CurrentEntityID(other.m_CurrentEntityID)
|
||||||
|
, m_EntityParents(other.m_EntityParents)
|
||||||
|
, m_EntityChildren(other.m_EntityChildren)
|
||||||
|
, m_EntityNames(other.m_EntityNames)
|
||||||
|
{
|
||||||
|
// Deep copy component pools
|
||||||
|
for (auto& kv : other.m_ComponentPools) {
|
||||||
|
m_ComponentPools[kv.first] = new ComponentPool(*kv.second);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
EntityID World::CreateEntity(EntityID parent /*= EntityID_Invalid*/)
|
||||||
{
|
{
|
||||||
EntityID newEntity = generateEntityID();
|
EntityID newEntity = generateEntityID();
|
||||||
if (newEntity == parent) {
|
if (newEntity == parent) {
|
||||||
@@ -44,10 +57,8 @@ ComponentWrapper World::AttachComponent(EntityID entity, const std::string& comp
|
|||||||
ComponentPool* pool = m_ComponentPools.at(componentType);
|
ComponentPool* pool = m_ComponentPools.at(componentType);
|
||||||
const ComponentInfo& ci = pool->ComponentInfo();
|
const ComponentInfo& ci = pool->ComponentInfo();
|
||||||
|
|
||||||
// Allocate space for the component
|
// Allocate component with default values
|
||||||
ComponentWrapper c = pool->Allocate(entity);
|
ComponentWrapper c = pool->Allocate(entity);
|
||||||
// Write default values
|
|
||||||
memcpy(c.Data, ci.Defaults.get(), ci.Stride);
|
|
||||||
|
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user