Compare commits
95 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8e9ddc7b9d | |||
| cc10e5500b | |||
| 9bac141a6b | |||
| 9942747d41 | |||
| 28d576bfc0 | |||
| 66d0f9fa47 | |||
| 157a54e845 | |||
| 7759af2c5a | |||
| ac096bbf77 | |||
| 81634578d9 | |||
| 2f61171d16 | |||
| aa16a15693 | |||
| 26337ff243 | |||
| 7bdb0d410f | |||
| 172fb8dfc2 | |||
| 0ca627eb8b | |||
| 530c0fd9b0 | |||
| f036817c0c | |||
| e45d0e8232 | |||
| 8ebf818c19 | |||
| 62d1cb9a69 | |||
| edb305b307 | |||
| 0aedeb61b4 | |||
| 44398eac58 | |||
| 06bddd9d54 | |||
| 4937bee46a | |||
| bb0531a459 | |||
| 8bd38bc465 | |||
| 8ceaae995d | |||
| 5f959ded89 | |||
| 0fbc482f9c | |||
| 2eb863757b | |||
| 91aedcbb14 | |||
| cac0522ae7 | |||
| 26dde21e3d | |||
| 23e6a15c7f | |||
| e96ad44e44 | |||
| a3ab844cc4 | |||
| 03493df213 | |||
| 7febb7681c | |||
| e000408593 | |||
| 33627f917c | |||
| 0869afd529 | |||
| 56a13d03fc | |||
| dad18a200f | |||
| dab58e09a0 | |||
| cd6967b310 | |||
| ab70aed840 | |||
| d6e3a47182 | |||
| 038a706e28 | |||
| f9808a61f7 | |||
| a8a4b5d2a2 | |||
| 67dfbfff01 | |||
| bdcb33d992 | |||
| a0d60160dd | |||
| 15c54d2be6 | |||
| e444a86ec5 | |||
| 8a8c375d3a | |||
| 981dc3467e | |||
| 42af029a26 | |||
| 37355b1afc | |||
| 2e5dfc609a | |||
| 8936b3d6c3 | |||
| ad49af2f8c | |||
| 5a7034dfcd | |||
| 9721cb6a7d | |||
| c36c7d1ea6 | |||
| 3209e36176 | |||
| 8a3564ad49 | |||
| 9581e9ac84 | |||
| ba6d2b758d | |||
| 12dd1d21de | |||
| e0de91cce3 | |||
| 3828616b60 | |||
| 9cbc582be2 | |||
| ec3ed1f46f | |||
| 68a88ed756 | |||
| 9cc8124847 | |||
| 078d6eb712 | |||
| a369c26a28 | |||
| 16124b7aa7 | |||
| a7c57da2c9 | |||
| 1227a795d7 | |||
| 1cc92f4800 | |||
| 3613d66d32 | |||
| 20c6caa408 | |||
| b7fac7103d | |||
| d3ffb9768b | |||
| 2c56b03b2b | |||
| 4fd578c764 | |||
| 67dffafe5a | |||
| 7dbb9e452b | |||
| cf3d1b5b00 | |||
| 9783f9c650 | |||
| f72dea3852 |
+1
-1
Submodule assets updated: 007b54bd67...bc6e7df04c
@@ -84,6 +84,18 @@ bool AABBvsTriangles(const AABB& box,
|
|||||||
const std::vector<unsigned int>& modelIndices,
|
const std::vector<unsigned int>& modelIndices,
|
||||||
const glm::mat4& modelMatrix);
|
const glm::mat4& modelMatrix);
|
||||||
|
|
||||||
|
enum Output
|
||||||
|
{
|
||||||
|
OutContained,
|
||||||
|
OutSeparated,
|
||||||
|
OutIntersecting
|
||||||
|
};
|
||||||
|
//Detects intersection and containment.
|
||||||
|
Output AABBvsTrianglesWContainment(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.
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ private:
|
|||||||
// Utility functions
|
// Utility functions
|
||||||
EntityWrapper importEntity(EntityWrapper parent, boost::filesystem::path filePath);
|
EntityWrapper importEntity(EntityWrapper parent, boost::filesystem::path filePath);
|
||||||
void setWidgetMode(EditorGUI::WidgetMode mode);
|
void setWidgetMode(EditorGUI::WidgetMode mode);
|
||||||
|
bool isAnyParentMissingTransform(EntityID entityID);
|
||||||
|
|
||||||
// GUI callbacks
|
// GUI callbacks
|
||||||
void OnEntitySelected(EntityWrapper entity);
|
void OnEntitySelected(EntityWrapper entity);
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ public:
|
|||||||
virtual const glm::vec3 Rotation() const { return m_Rotation; }
|
virtual const glm::vec3 Rotation() const { return m_Rotation; }
|
||||||
virtual bool Jumping() const { return m_Jumping; }
|
virtual bool Jumping() const { return m_Jumping; }
|
||||||
virtual bool Crouching() const { return m_Crouching; }
|
virtual bool Crouching() const { return m_Crouching; }
|
||||||
|
virtual bool CrouchingLastFrame() const { return m_CrouchingLastFrame; }
|
||||||
virtual bool DoubleJumping() const { return m_DoubleJumping; }
|
virtual bool DoubleJumping() const { return m_DoubleJumping; }
|
||||||
virtual void SetDoubleJumping(bool isDoubleJumping) {
|
virtual void SetDoubleJumping(bool isDoubleJumping) {
|
||||||
m_DoubleJumping = isDoubleJumping;
|
m_DoubleJumping = isDoubleJumping;
|
||||||
@@ -44,6 +45,7 @@ protected:
|
|||||||
bool m_Jumping = false;
|
bool m_Jumping = false;
|
||||||
bool m_DoubleJumping = false;
|
bool m_DoubleJumping = false;
|
||||||
bool m_Crouching = false;
|
bool m_Crouching = false;
|
||||||
|
bool m_CrouchingLastFrame = false;
|
||||||
//assault dash membervariables - needed to calculate the doubletap- and dashlogic
|
//assault dash membervariables - needed to calculate the doubletap- and dashlogic
|
||||||
double m_AssaultDashDoubleTapDeltaTime = 0.0;
|
double m_AssaultDashDoubleTapDeltaTime = 0.0;
|
||||||
//i will let m_AssaultDashDoubleTapSensitivityTimer stay hardcoded, its not really a gamevariable (more an inputvariable),
|
//i will let m_AssaultDashDoubleTapSensitivityTimer stay hardcoded, its not really a gamevariable (more an inputvariable),
|
||||||
@@ -82,6 +84,7 @@ void FirstPersonInputController<EventContext>::Reset()
|
|||||||
{
|
{
|
||||||
m_Rotation = glm::vec3(0.f, 0.f, 0.f);
|
m_Rotation = glm::vec3(0.f, 0.f, 0.f);
|
||||||
m_Jumping = false;
|
m_Jumping = false;
|
||||||
|
m_CrouchingLastFrame = m_Crouching;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename EventContext>
|
template <typename EventContext>
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ public:
|
|||||||
void Connect(std::string address, int port);
|
void Connect(std::string address, int port);
|
||||||
void Update() override;
|
void Update() override;
|
||||||
private:
|
private:
|
||||||
//UDPClient m_Unreliable;
|
UDPClient m_Unreliable;
|
||||||
TCPClient m_Reliable;
|
TCPClient m_Reliable;
|
||||||
std::vector<Events::PlayerSpawned> m_PlayerSpawnEvents;
|
std::vector<Events::PlayerSpawned> m_PlayerSpawnEvents;
|
||||||
void parseSpawnEvents();
|
void parseSpawnEvents();
|
||||||
@@ -81,7 +81,7 @@ private:
|
|||||||
std::vector<Events::InputCommand> m_InputCommandBuffer;
|
std::vector<Events::InputCommand> m_InputCommandBuffer;
|
||||||
|
|
||||||
// Private member functions
|
// Private member functions
|
||||||
size_t receive(char* data);
|
size_t receive(char* data);
|
||||||
void disconnect();
|
void disconnect();
|
||||||
void parseMessageType(Packet& packet);
|
void parseMessageType(Packet& packet);
|
||||||
void updateFields(Packet& packet, const ComponentInfo& componentInfo, const EntityID& entityID);
|
void updateFields(Packet& packet, const ComponentInfo& componentInfo, const EntityID& entityID);
|
||||||
@@ -139,7 +139,7 @@ private:
|
|||||||
std::vector<ServerInfo> m_Serverlist;
|
std::vector<ServerInfo> m_Serverlist;
|
||||||
bool m_SearchingForServers = false;
|
bool m_SearchingForServers = false;
|
||||||
std::clock_t m_StartSearchTime;
|
std::clock_t m_StartSearchTime;
|
||||||
double m_SearchingTime = 2000; // Config I guess
|
double m_SearchingTime = 200; // Config I guess
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ protected:
|
|||||||
void logReceivedData(int bytesReceived);
|
void logReceivedData(int bytesReceived);
|
||||||
void saveToFile();
|
void saveToFile();
|
||||||
void updateNetworkData();
|
void updateNetworkData();
|
||||||
|
void popNetworkSegmentOfHeader(Packet& packet);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -16,7 +16,9 @@ public:
|
|||||||
Packet(char* data, const size_t sizeOfPacket);
|
Packet(char* data, const size_t sizeOfPacket);
|
||||||
Packet(MessageType type);
|
Packet(MessageType type);
|
||||||
~Packet();
|
~Packet();
|
||||||
void Init(MessageType type, unsigned int& packetID);
|
void Init(MessageType type, unsigned int& packetID,
|
||||||
|
int groupIndex, int groupSize,
|
||||||
|
int packetGroup);
|
||||||
|
|
||||||
// Add primitive types like int, float, char...
|
// Add primitive types like int, float, char...
|
||||||
template<typename T>
|
template<typename T>
|
||||||
@@ -25,7 +27,8 @@ public:
|
|||||||
// Check if we are trying to add more than the package can fit.
|
// Check if we are trying to add more than the package can fit.
|
||||||
if (m_MaxPacketSize < m_Offset + sizeof(T)) {
|
if (m_MaxPacketSize < m_Offset + sizeof(T)) {
|
||||||
if (m_MaxPacketSize >= 32000) {
|
if (m_MaxPacketSize >= 32000) {
|
||||||
LOG_WARNING("Package::WritePrimitive(): New size is huge %i bytes\n", m_MaxPacketSize*2);
|
// This will spam couse 8 players are over 100 000 bytes
|
||||||
|
//LOG_WARNING("Package::WritePrimitive(): New size is huge %i bytes\n", m_MaxPacketSize*2);
|
||||||
}
|
}
|
||||||
resizeData();
|
resizeData();
|
||||||
}
|
}
|
||||||
@@ -57,13 +60,19 @@ public:
|
|||||||
void UpdateSize();
|
void UpdateSize();
|
||||||
char* ReadData(int SizeOfData);
|
char* ReadData(int SizeOfData);
|
||||||
void ChangePacketID(unsigned int& packetID);
|
void ChangePacketID(unsigned int& packetID);
|
||||||
|
void ChangeGroupIndex(int groupIndex);
|
||||||
|
void ChangeGroupSize(int groupSize);
|
||||||
|
void ChangeGroup(int group);
|
||||||
size_t Size() { return m_Offset; };
|
size_t Size() { return m_Offset; };
|
||||||
char* Data() { return m_Data; };
|
char* Data() { return m_Data; };
|
||||||
MessageType GetMessageType();
|
MessageType GetMessageType();
|
||||||
|
size_t Group();
|
||||||
size_t DataReadSize() { return m_ReturnDataOffset; }
|
size_t DataReadSize() { return m_ReturnDataOffset; }
|
||||||
size_t MaxSize() { return m_MaxPacketSize; }
|
size_t MaxSize() { return m_MaxPacketSize; }
|
||||||
size_t HeaderSize() { return m_HeaderSize; }
|
size_t HeaderSize() { return m_HeaderSize; }
|
||||||
|
size_t GroupIndex();
|
||||||
|
size_t GroupSize();
|
||||||
|
size_t PacketID();
|
||||||
private:
|
private:
|
||||||
char* m_Data;
|
char* m_Data;
|
||||||
size_t m_ReturnDataOffset = 0;
|
size_t m_ReturnDataOffset = 0;
|
||||||
@@ -72,6 +81,13 @@ private:
|
|||||||
size_t m_HeaderSize = 0;
|
size_t m_HeaderSize = 0;
|
||||||
void resizeData();
|
void resizeData();
|
||||||
void resizeData(int size);
|
void resizeData(int size);
|
||||||
|
|
||||||
|
size_t packetSizeOffset = 0;
|
||||||
|
size_t groupOffset = 0;
|
||||||
|
size_t groupIndexOffset = 0;
|
||||||
|
size_t groupSizeOffset = 0;
|
||||||
|
size_t messageTypeOffset = 0;
|
||||||
|
size_t packetIDOffset = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -14,6 +14,7 @@ struct PlayerDefinition {
|
|||||||
unsigned short TCPPort;
|
unsigned short TCPPort;
|
||||||
// use for tcp connections
|
// use for tcp connections
|
||||||
boost::shared_ptr<boost::asio::ip::tcp::socket> TCPSocket;
|
boost::shared_ptr<boost::asio::ip::tcp::socket> TCPSocket;
|
||||||
|
int PacketGroup = 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
// Network channels
|
// Network channels
|
||||||
TCPServer m_Reliable;
|
TCPServer m_Reliable;
|
||||||
//UDPServer m_Unreliable;
|
UDPServer m_Unreliable;
|
||||||
UDPServer m_ServerlistRequest;
|
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;
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
#ifndef UDPClient_h__
|
#ifndef UDPClient_h__
|
||||||
#define UDPClient_h__
|
#define UDPClient_h__
|
||||||
|
#include <map>
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
#include <boost/asio.hpp>
|
#include <boost/asio.hpp>
|
||||||
#include "Network/NetworkClient.h"
|
#include "Network/NetworkClient.h"
|
||||||
@@ -13,16 +15,27 @@ public:
|
|||||||
bool Connect(std::string playerName, std::string address, int port);
|
bool Connect(std::string playerName, std::string address, int port);
|
||||||
void Disconnect();
|
void Disconnect();
|
||||||
void Receive(Packet& packet);
|
void Receive(Packet& packet);
|
||||||
void Send(Packet & packet);
|
void ReceivePackets();
|
||||||
|
void Send(Packet& packet);
|
||||||
void Broadcast(Packet& packet, int port);
|
void Broadcast(Packet& packet, int port);
|
||||||
bool IsSocketAvailable();
|
bool IsSocketAvailable();
|
||||||
|
// Returns false if no packets are available
|
||||||
|
bool GetNextPacket(Packet& packet);
|
||||||
private:
|
private:
|
||||||
|
typedef std::map<unsigned int, std::vector<std::pair<int, boost::shared_ptr<char>>>> PacketMap;
|
||||||
// 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 m_LastReceivedSnapshotGroup = 0;
|
||||||
int readBuffer();
|
int readBuffer();
|
||||||
|
void readPartOfPacket();
|
||||||
PacketID m_SendPacketID = 0;
|
PacketID m_SendPacketID = 0;
|
||||||
|
//map:(packetGroup, vector:(pair:(groupIndex, packetData)))
|
||||||
|
PacketMap m_PacketSegmentMap;
|
||||||
|
bool hasReceivedPacket(int packetGroup, int groupIndex);
|
||||||
|
// 2^19
|
||||||
|
const int m_SizeOfSocketBuffer = 524288;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include "NetworkServer.h"
|
#include "NetworkServer.h"
|
||||||
#include <boost/asio/ip/udp.hpp>
|
#include <boost/asio/ip/udp.hpp>
|
||||||
|
#define MAXPACKETSIZE 64000
|
||||||
|
|
||||||
class UDPServer : public NetworkServer
|
class UDPServer : public NetworkServer
|
||||||
{
|
{
|
||||||
@@ -13,6 +14,7 @@ public:
|
|||||||
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 SendToConnectedPlayers(Packet & packet, std::map<PlayerID, PlayerDefinition>& playersTosendTo);
|
||||||
void Send(Packet & packet);
|
void Send(Packet & packet);
|
||||||
void Send(Packet & packet, boost::asio::ip::udp::endpoint endpoint);
|
void Send(Packet & packet, boost::asio::ip::udp::endpoint endpoint);
|
||||||
void Broadcast(Packet & packet, int port);
|
void Broadcast(Packet & packet, int port);
|
||||||
|
|||||||
@@ -13,7 +13,6 @@
|
|||||||
#include "Texture.h"
|
#include "Texture.h"
|
||||||
#include "ShadowPass.h"
|
#include "ShadowPass.h"
|
||||||
#include "BlurHUD.h"
|
#include "BlurHUD.h"
|
||||||
#include "TextPass.h"
|
|
||||||
|
|
||||||
class DrawFinalPass
|
class DrawFinalPass
|
||||||
{
|
{
|
||||||
@@ -23,7 +22,7 @@ public:
|
|||||||
void InitializeTextures();
|
void InitializeTextures();
|
||||||
void InitializeFrameBuffers();
|
void InitializeFrameBuffers();
|
||||||
void InitializeShaderPrograms();
|
void InitializeShaderPrograms();
|
||||||
void Draw(RenderScene& scene, BlurHUD* blurHUDPass, TextPass* textPass);
|
void Draw(RenderScene& scene, BlurHUD* blurHUDPass);
|
||||||
void ClearBuffer();
|
void ClearBuffer();
|
||||||
void OnWindowResize();
|
void OnWindowResize();
|
||||||
|
|
||||||
|
|||||||
@@ -26,24 +26,13 @@ struct ModelJob : RenderJob
|
|||||||
ModelID = model->ResourceID;
|
ModelID = model->ResourceID;
|
||||||
Type = matProp.type;
|
Type = matProp.type;
|
||||||
::RawModel::MaterialBasic* matGroup = matProp.material;
|
::RawModel::MaterialBasic* matGroup = matProp.material;
|
||||||
|
ShaderID = matProp.ShaderID;
|
||||||
switch(matProp.type){
|
switch(matProp.type){
|
||||||
case ::RawModel::MaterialType::Basic:
|
case ::RawModel::MaterialType::Basic:
|
||||||
if (Model->IsSkinned()) {
|
|
||||||
ShaderID = ResourceManager::Load<ShaderProgram>("#ForwardPlusSkinnedProgram")->ResourceID;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
ShaderID = ResourceManager::Load<ShaderProgram>("#ForwardPlusProgram")->ResourceID;
|
|
||||||
}
|
|
||||||
TextureID = 0;
|
TextureID = 0;
|
||||||
break;
|
break;
|
||||||
case ::RawModel::MaterialType::SingleTextures:
|
case ::RawModel::MaterialType::SingleTextures:
|
||||||
{
|
{
|
||||||
if (Model->IsSkinned()) {
|
|
||||||
ShaderID = ResourceManager::Load<ShaderProgram>("#ForwardPlusSkinnedProgram")->ResourceID;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
ShaderID = ResourceManager::Load<ShaderProgram>("#ForwardPlusProgram")->ResourceID;
|
|
||||||
}
|
|
||||||
::RawModel::MaterialSingleTextures* singleTextures = static_cast<::RawModel::MaterialSingleTextures*>(matProp.material);
|
::RawModel::MaterialSingleTextures* singleTextures = static_cast<::RawModel::MaterialSingleTextures*>(matProp.material);
|
||||||
TextureID = (singleTextures->ColorMap.Texture) ? singleTextures->ColorMap.Texture->ResourceID : 0;
|
TextureID = (singleTextures->ColorMap.Texture) ? singleTextures->ColorMap.Texture->ResourceID : 0;
|
||||||
if (modelComponent["DiffuseTexture"]) {
|
if (modelComponent["DiffuseTexture"]) {
|
||||||
@@ -65,12 +54,6 @@ struct ModelJob : RenderJob
|
|||||||
break;
|
break;
|
||||||
case ::RawModel::MaterialType::SplatMapping:
|
case ::RawModel::MaterialType::SplatMapping:
|
||||||
{
|
{
|
||||||
if (Model->IsSkinned()) {
|
|
||||||
ShaderID = ResourceManager::Load<ShaderProgram>("#ForwardPlusSplatMapSkinnedProgram")->ResourceID;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
ShaderID = ResourceManager::Load<ShaderProgram>("#ForwardPlusSplatMapProgram")->ResourceID;
|
|
||||||
}
|
|
||||||
::RawModel::MaterialSplatMapping* SplatTextures = static_cast<::RawModel::MaterialSplatMapping*>(matProp.material);
|
::RawModel::MaterialSplatMapping* SplatTextures = static_cast<::RawModel::MaterialSplatMapping*>(matProp.material);
|
||||||
|
|
||||||
SplatMap = &SplatTextures->SplatMap;
|
SplatMap = &SplatTextures->SplatMap;
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
#include "../Core/ResourceManager.h"
|
#include "../Core/ResourceManager.h"
|
||||||
#include "Texture.h"
|
#include "Texture.h"
|
||||||
#include "Skeleton.h"
|
#include "Skeleton.h"
|
||||||
|
#include "ShaderProgram.h"
|
||||||
|
|
||||||
#include "boost\endian\buffers.hpp"
|
#include "boost\endian\buffers.hpp"
|
||||||
|
|
||||||
@@ -87,6 +88,7 @@ public:
|
|||||||
struct MaterialProperties {
|
struct MaterialProperties {
|
||||||
MaterialType type;
|
MaterialType type;
|
||||||
MaterialBasic* material;
|
MaterialBasic* material;
|
||||||
|
unsigned int ShaderID = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
const Vertex* Vertices() const {
|
const Vertex* Vertices() const {
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void renderText(std::string text, Font* font, TextJob::AlignmentEnum alignment, glm::vec4 color, glm::mat4 modelMatrix, glm::mat4 projectionMatrix, glm::mat4 viewMatrix);
|
void renderText(std::string text, Font* font, TextJob::AlignmentEnum alignment, glm::vec4 color, glm::mat4 modelMatrix, glm::mat4 projectionMatrix, glm::mat4 viewMatrix);
|
||||||
|
std::string parseColors(std::string text, std::map<int, glm::vec4>& colorChanges, glm::vec4 originalColor);
|
||||||
|
|
||||||
Font* font;
|
Font* font;
|
||||||
GLuint VAO, VBO;
|
GLuint VAO, VBO;
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
#ifndef Events_ChangeBGM_h__
|
||||||
|
#define Events_ChangeBGM_h__
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include "../Engine/Core/EventBroker.h"
|
||||||
|
|
||||||
|
namespace Events
|
||||||
|
{
|
||||||
|
|
||||||
|
struct ChangeBGM : Event
|
||||||
|
{
|
||||||
|
std::string FilePath = "";
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
#endif // Events_ChangeBGM_h__
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
#ifndef Events_PlayAnnouncerVoice_h__
|
||||||
|
#define Events_PlayAnnouncerVoice_h__
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include "../Engine/Core/EventBroker.h"
|
||||||
|
|
||||||
|
namespace Events
|
||||||
|
{
|
||||||
|
|
||||||
|
struct PlayAnonuncerVoice : public Event
|
||||||
|
{
|
||||||
|
std::string FilePath = "";
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -12,7 +12,8 @@ namespace Events
|
|||||||
// Sound behavior is thereby specified in the SoundEmitter component.
|
// Sound behavior is thereby specified in the SoundEmitter component.
|
||||||
struct PlaySoundOnEntity : public Event
|
struct PlaySoundOnEntity : public Event
|
||||||
{
|
{
|
||||||
EntityID EmitterID = 0;
|
EntityWrapper Emitter = EntityWrapper::Invalid;
|
||||||
|
float Gain = 1.f;
|
||||||
std::string FilePath = "";
|
std::string FilePath = "";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
#ifndef Events_SetAnnouncerGain_h__
|
||||||
|
#define Events_SetAnnouncerGain_h__
|
||||||
|
|
||||||
|
#include "../Engine/Core/EventBroker.h"
|
||||||
|
|
||||||
|
namespace Events
|
||||||
|
{
|
||||||
|
|
||||||
|
struct SetAnnouncerGain : public Event
|
||||||
|
{
|
||||||
|
float Gain = 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif //
|
||||||
@@ -9,32 +9,35 @@
|
|||||||
#include "OpenAL/al.h"
|
#include "OpenAL/al.h"
|
||||||
#include "OpenAL/alc.h"
|
#include "OpenAL/alc.h"
|
||||||
|
|
||||||
#include "imgui/imgui.h"
|
#include "../Engine/Core/World.h"
|
||||||
|
#include "../Engine/Core/EventBroker.h"
|
||||||
#include "Core/World.h"
|
|
||||||
#include "Core/EventBroker.h"
|
|
||||||
#include "../Engine/Core/ResourceManager.h"
|
#include "../Engine/Core/ResourceManager.h"
|
||||||
#include "../Engine/Core/ConfigFile.h"
|
#include "../Engine/Core/ConfigFile.h"
|
||||||
#include "Core/Transform.h" // Absolute transform
|
#include "../Engine/Core/Transform.h"
|
||||||
#include "Sound/Sound.h"
|
#include "../Engine/Sound/Sound.h"
|
||||||
#include "../Engine/Sound/EPlayQueueOnEntity.h"
|
#include "../Engine/Sound/EPlayQueueOnEntity.h"
|
||||||
#include "Sound/EPlaySoundOnEntity.h"
|
#include "../Engine/Sound/EPlaySoundOnEntity.h"
|
||||||
#include "Sound/EPlaySoundOnPosition.h"
|
#include "../Engine/Sound/EPlaySoundOnPosition.h"
|
||||||
#include "Sound/EPlayBackgroundMusic.h"
|
#include "../Engine/Sound/EPlayBackgroundMusic.h"
|
||||||
#include "Sound/EPauseSound.h"
|
#include "../Engine/Sound/EPlayAnnouncerVoice.h"
|
||||||
#include "Sound/EContinueSound.h"
|
#include "../Engine/Sound/EPauseSound.h"
|
||||||
#include "Sound/EStopSound.h"
|
#include "../Engine/Sound/EContinueSound.h"
|
||||||
#include "Sound/ESetBGMGain.h"
|
#include "../Engine/Sound/EStopSound.h"
|
||||||
#include "Sound/ESetSFXGain.h"
|
#include "../Engine/Sound/ESetBGMGain.h"
|
||||||
#include "Core/EPause.h"
|
#include "../Engine/Sound/ESetSFXGain.h"
|
||||||
#include "Core/EComponentAttached.h"
|
#include "../Engine/Sound/ESetAnnouncerGain.h"
|
||||||
|
#include "../Engine/Sound/EChangeBGM.h"
|
||||||
|
#include "../Engine/Core/EPause.h"
|
||||||
|
#include "../Engine/Core/EComponentAttached.h"
|
||||||
#include "../Core/EPlayerSpawned.h"
|
#include "../Core/EPlayerSpawned.h"
|
||||||
|
|
||||||
|
|
||||||
typedef std::pair<ALuint, std::vector<ALuint>> QueuedBuffers;
|
typedef std::pair<ALuint, std::vector<ALuint>> QueuedBuffers;
|
||||||
|
|
||||||
enum class SoundType {
|
enum class SoundType {
|
||||||
SFX,
|
SFX,
|
||||||
BGM
|
BGM,
|
||||||
|
Announcer
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Source
|
struct Source
|
||||||
@@ -43,6 +46,7 @@ struct Source
|
|||||||
Sound* SoundResource = nullptr;
|
Sound* SoundResource = nullptr;
|
||||||
ALuint ALsource;
|
ALuint ALsource;
|
||||||
SoundType Type;
|
SoundType Type;
|
||||||
|
float Duration;
|
||||||
};
|
};
|
||||||
|
|
||||||
class SoundManager
|
class SoundManager
|
||||||
@@ -74,14 +78,20 @@ private:
|
|||||||
ALenum getSourceState(ALuint source);
|
ALenum getSourceState(ALuint source);
|
||||||
void setGain(Source* source, float gain);
|
void setGain(Source* source, float gain);
|
||||||
void setSoundProperties(Source* source, ComponentWrapper* soundComponent);
|
void setSoundProperties(Source* source, ComponentWrapper* soundComponent);
|
||||||
|
float getDurationSeconds(Source* source);
|
||||||
|
float getTimeOffsetSeconds(Source* source);
|
||||||
|
|
||||||
// Specific logic
|
// Specific logic
|
||||||
void playSound(Source* source);
|
void playSound(Source* source);
|
||||||
// Need to be the same format (sample rate etc)
|
// Needs to be the same format (sample rate etc)
|
||||||
void playQueue(QueuedBuffers qb);
|
void playQueue(QueuedBuffers qb);
|
||||||
void stopSound(Source* source);
|
void stopSound(Source* source);
|
||||||
Source* createSource(std::string filePath);
|
Source* createSource(std::string filePath);
|
||||||
std::unordered_map<EntityID, Source*> m_Sources;
|
std::unordered_map<EntityID, Source*> m_Sources;
|
||||||
|
void matchBGMLoop();
|
||||||
|
Source* m_CurrentBGM = nullptr;
|
||||||
|
Source* m_CurrentBGMCombo = nullptr;
|
||||||
|
bool m_DrumLoopHasBeenStarted = false;
|
||||||
|
|
||||||
// Logic
|
// Logic
|
||||||
World* m_World = nullptr;
|
World* m_World = nullptr;
|
||||||
@@ -93,6 +103,7 @@ private:
|
|||||||
|
|
||||||
float m_BGMVolumeChannel = 1.0f;
|
float m_BGMVolumeChannel = 1.0f;
|
||||||
float m_SFXVolumeChannel = 1.0f;
|
float m_SFXVolumeChannel = 1.0f;
|
||||||
|
float m_AnnouncerVolumeChannel = 1.0f;
|
||||||
EntityWrapper m_LocalPlayer = EntityWrapper();
|
EntityWrapper m_LocalPlayer = EntityWrapper();
|
||||||
|
|
||||||
// Events
|
// Events
|
||||||
@@ -102,6 +113,8 @@ private:
|
|||||||
bool OnPlaySoundOnPosition(const Events::PlaySoundOnPosition &e);
|
bool OnPlaySoundOnPosition(const Events::PlaySoundOnPosition &e);
|
||||||
EventRelay<SoundManager, Events::PlayBackgroundMusic> m_EPlayBackgroundMusic;
|
EventRelay<SoundManager, Events::PlayBackgroundMusic> m_EPlayBackgroundMusic;
|
||||||
bool OnPlayBackgroundMusic(const Events::PlayBackgroundMusic &e);
|
bool OnPlayBackgroundMusic(const Events::PlayBackgroundMusic &e);
|
||||||
|
EventRelay<SoundManager, Events::PlayAnonuncerVoice> m_EPlayAnnouncerVoice;
|
||||||
|
bool OnPlayAnnouncerVoice(const Events::PlayAnonuncerVoice& e);
|
||||||
EventRelay<SoundManager, Events::PauseSound> m_EPauseSound;
|
EventRelay<SoundManager, Events::PauseSound> m_EPauseSound;
|
||||||
bool OnPauseSound(const Events::PauseSound &e);
|
bool OnPauseSound(const Events::PauseSound &e);
|
||||||
EventRelay<SoundManager, Events::StopSound> m_EStopSound;
|
EventRelay<SoundManager, Events::StopSound> m_EStopSound;
|
||||||
@@ -112,6 +125,8 @@ private:
|
|||||||
bool OnSetBGMGain(const Events::SetBGMGain &e);
|
bool OnSetBGMGain(const Events::SetBGMGain &e);
|
||||||
EventRelay<SoundManager, Events::SetSFXGain> m_ESetSFXGain;
|
EventRelay<SoundManager, Events::SetSFXGain> m_ESetSFXGain;
|
||||||
bool OnSetSFXGain(const Events::SetSFXGain &e);
|
bool OnSetSFXGain(const Events::SetSFXGain &e);
|
||||||
|
EventRelay<SoundManager, Events::SetAnnouncerGain> m_ESetAnnouncerGain;
|
||||||
|
bool OnSetAnnouncerGain(const Events::SetAnnouncerGain& e);
|
||||||
EventRelay<SoundManager, Events::ComponentAttached> m_EComponentAttached;
|
EventRelay<SoundManager, Events::ComponentAttached> m_EComponentAttached;
|
||||||
bool OnComponentAttached(const Events::ComponentAttached &e);
|
bool OnComponentAttached(const Events::ComponentAttached &e);
|
||||||
EventRelay<SoundManager, Events::Pause> m_EPause;
|
EventRelay<SoundManager, Events::Pause> m_EPause;
|
||||||
@@ -122,6 +137,8 @@ private:
|
|||||||
bool OnPlayerSpawned(const Events::PlayerSpawned &e);
|
bool OnPlayerSpawned(const Events::PlayerSpawned &e);
|
||||||
EventRelay<SoundManager, Events::PlayQueueOnEntity> m_EPlayQueueOnEntity;
|
EventRelay<SoundManager, Events::PlayQueueOnEntity> m_EPlayQueueOnEntity;
|
||||||
bool OnPlayQueueOnEntity(const Events::PlayQueueOnEntity &e);
|
bool OnPlayQueueOnEntity(const Events::PlayQueueOnEntity &e);
|
||||||
|
EventRelay<SoundManager, Events::ChangeBGM> m_EChangeBGM;
|
||||||
|
bool OnChangeBGM(const Events::ChangeBGM &e);
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
#include "Core/Event.h"
|
#include "Core/Event.h"
|
||||||
#include "Systems/SpawnerSystem.h"
|
#include "Systems/SpawnerSystem.h"
|
||||||
|
|
||||||
|
|
||||||
#include "GUI/EButtonClicked.h"
|
#include "GUI/EButtonClicked.h"
|
||||||
#include "GUI/EButtonPressed.h"
|
#include "GUI/EButtonPressed.h"
|
||||||
#include "GUI/EButtonReleased.h"
|
#include "GUI/EButtonReleased.h"
|
||||||
@@ -24,6 +23,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
IRenderer* m_Renderer;
|
IRenderer* m_Renderer;
|
||||||
|
void OpenSubMenu(const Events::InputCommand& e);
|
||||||
|
|
||||||
EventRelay<MainMenuSystem, Events::ButtonClicked> m_EClicked;
|
EventRelay<MainMenuSystem, Events::ButtonClicked> m_EClicked;
|
||||||
bool OnButtonClick(const Events::ButtonClicked& e);
|
bool OnButtonClick(const Events::ButtonClicked& e);
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ private:
|
|||||||
// Used to track afterimages for sprint effect.
|
// Used to track afterimages for sprint effect.
|
||||||
float m_SprintEffectTimer;
|
float m_SprintEffectTimer;
|
||||||
// The logic for making the sound play when player is moving
|
// The logic for making the sound play when player is moving
|
||||||
void playerStep(double dt);
|
void playerStep(double dt, EntityWrapper player);
|
||||||
// Spawn a hexagon at origin of an Entity
|
// Spawn a hexagon at origin of an Entity
|
||||||
void spawnHexagon(EntityWrapper target);
|
void spawnHexagon(EntityWrapper target);
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
#define Systems_SoundSystem_h__
|
#define Systems_SoundSystem_h__
|
||||||
|
|
||||||
#include <random>
|
#include <random>
|
||||||
|
#include <chrono>
|
||||||
|
|
||||||
#include "../Engine/Core/System.h"
|
#include "../Engine/Core/System.h"
|
||||||
#include "../Engine/Core/ResourceManager.h"
|
#include "../Engine/Core/ResourceManager.h"
|
||||||
@@ -20,9 +21,10 @@
|
|||||||
#include "../Engine/Collision/ETrigger.h"
|
#include "../Engine/Collision/ETrigger.h"
|
||||||
#include "../Engine/Sound/EPlaySoundOnEntity.h"
|
#include "../Engine/Sound/EPlaySoundOnEntity.h"
|
||||||
#include "../Engine/Sound/EPlayBackgroundMusic.h"
|
#include "../Engine/Sound/EPlayBackgroundMusic.h"
|
||||||
|
#include "../Engine/Sound/EPlayAnnouncerVoice.h"
|
||||||
#include "../Game/Events/EDoubleJump.h"
|
#include "../Game/Events/EDoubleJump.h"
|
||||||
#include "../Game/Events/EDashAbility.h"
|
#include "../Game/Events/EDashAbility.h"
|
||||||
|
#include "../Engine/Sound/EChangeBGM.h"
|
||||||
|
|
||||||
class SoundSystem : public PureSystem, ImpureSystem
|
class SoundSystem : public PureSystem, ImpureSystem
|
||||||
{
|
{
|
||||||
@@ -33,14 +35,10 @@ public:
|
|||||||
private:
|
private:
|
||||||
std::string m_Announcer = "";
|
std::string m_Announcer = "";
|
||||||
// Logic for playing a sound when a player jumps
|
// Logic for playing a sound when a player jumps
|
||||||
void playerJumps();
|
void playerJumps(EntityWrapper player);
|
||||||
|
|
||||||
// Temporary solution for play test.
|
|
||||||
bool m_DrumsIsPlaying = false;
|
|
||||||
double m_DrumTimer = 0.0;
|
|
||||||
bool drumTimer(double dt);
|
|
||||||
|
|
||||||
std::default_random_engine generator;
|
std::default_random_engine m_RandomGenerator;
|
||||||
|
std::uniform_int_distribution<int> m_RandIntDistribution;
|
||||||
|
|
||||||
EventRelay<SoundSystem, Events::PlayerSpawned> m_EPlayerSpawned;
|
EventRelay<SoundSystem, Events::PlayerSpawned> m_EPlayerSpawned;
|
||||||
bool OnPlayerSpawned(const Events::PlayerSpawned &e);
|
bool OnPlayerSpawned(const Events::PlayerSpawned &e);
|
||||||
@@ -48,10 +46,6 @@ private:
|
|||||||
bool OnInputCommand(const Events::InputCommand &e);
|
bool OnInputCommand(const Events::InputCommand &e);
|
||||||
EventRelay<SoundSystem, Events::DoubleJump> m_EDoubleJump;
|
EventRelay<SoundSystem, Events::DoubleJump> m_EDoubleJump;
|
||||||
bool OnDoubleJump(const Events::DoubleJump &e);
|
bool OnDoubleJump(const Events::DoubleJump &e);
|
||||||
EventRelay<SoundSystem, Events::DashAbility> m_EDashAbility;
|
|
||||||
bool OnDashAbility(const Events::DashAbility &e);
|
|
||||||
EventRelay<SoundSystem, Events::TriggerTouch> m_ETriggerTouch;
|
|
||||||
bool OnTriggerTouch(const Events::TriggerTouch &e);
|
|
||||||
EventRelay<SoundSystem, Events::Captured> m_ECaptured;
|
EventRelay<SoundSystem, Events::Captured> m_ECaptured;
|
||||||
bool OnCaptured(const Events::Captured &e);
|
bool OnCaptured(const Events::Captured &e);
|
||||||
EventRelay<SoundSystem, Events::PlayerDamage> m_EPlayerDamage;
|
EventRelay<SoundSystem, Events::PlayerDamage> m_EPlayerDamage;
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include "Core/System.h"
|
#include "Core/System.h"
|
||||||
#include "Input/EInputCommand.h"
|
#include "Input/EInputCommand.h"
|
||||||
|
#include "Network/EPlayerDisconnected.h"
|
||||||
|
|
||||||
class SpectatorCameraSystem : public ImpureSystem
|
class SpectatorCameraSystem : public ImpureSystem
|
||||||
{
|
{
|
||||||
@@ -17,6 +18,8 @@ private:
|
|||||||
|
|
||||||
EventRelay<SpectatorCameraSystem, Events::InputCommand> m_EInputCommand;
|
EventRelay<SpectatorCameraSystem, Events::InputCommand> m_EInputCommand;
|
||||||
bool OnInputCommand(const Events::InputCommand& e);
|
bool OnInputCommand(const Events::InputCommand& e);
|
||||||
|
EventRelay<SpectatorCameraSystem, Events::PlayerDisconnected> m_EDisconnect;
|
||||||
|
bool OnDisconnect(const Events::PlayerDisconnected& e);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -5,6 +5,7 @@
|
|||||||
#include "Collision/Collision.h"
|
#include "Collision/Collision.h"
|
||||||
#include "Core/EPlayerDamage.h"
|
#include "Core/EPlayerDamage.h"
|
||||||
#include "Sound/EPlaySoundOnEntity.h"
|
#include "Sound/EPlaySoundOnEntity.h"
|
||||||
|
#include "Sound/EPlaySoundOnEntity.h"
|
||||||
|
|
||||||
class DefenderWeaponBehaviour : public WeaponBehaviour<DefenderWeaponBehaviour>
|
class DefenderWeaponBehaviour : public WeaponBehaviour<DefenderWeaponBehaviour>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ ResourceLoading=true
|
|||||||
[Sound]
|
[Sound]
|
||||||
BGMVolume=1.0
|
BGMVolume=1.0
|
||||||
SFXVolume=1.0
|
SFXVolume=1.0
|
||||||
|
AnnouncerVolume=1.0
|
||||||
Announcer=female
|
Announcer=female
|
||||||
|
|
||||||
[SSAO]
|
[SSAO]
|
||||||
|
|||||||
@@ -29,4 +29,6 @@ K=TakeDamage,1500
|
|||||||
F2=PerformanceTimingResetAllTimers
|
F2=PerformanceTimingResetAllTimers
|
||||||
F3=PerformanceTimingCreateExcelData
|
F3=PerformanceTimingCreateExcelData
|
||||||
Comma=SwapToClassPick
|
Comma=SwapToClassPick
|
||||||
Period=SwapToTeamPick
|
Period=SwapToTeamPick
|
||||||
|
Enter=PickClass,1
|
||||||
|
F5=DisconnectFromServer
|
||||||
@@ -68,4 +68,6 @@
|
|||||||
<xs:include schemaLocation="Components/NetworkComponent.xsd"/>
|
<xs:include schemaLocation="Components/NetworkComponent.xsd"/>
|
||||||
<xs:include schemaLocation="Components/ServerIdentity.xsd"/>
|
<xs:include schemaLocation="Components/ServerIdentity.xsd"/>
|
||||||
<xs:include schemaLocation="Components/ServerList.xsd"/>
|
<xs:include schemaLocation="Components/ServerList.xsd"/>
|
||||||
|
<xs:include schemaLocation="Components/ConfigBtnResolution.xsd"/>
|
||||||
|
<xs:include schemaLocation="Components/ConfigBtnFloat.xsd"/>
|
||||||
</xs:schema>
|
</xs:schema>
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<ConfigBtnFloat xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ConfigBtnFloat.xsd">
|
||||||
|
<Header></Header>
|
||||||
|
<Field></Field>
|
||||||
|
<PressValue></PressValue>
|
||||||
|
</ConfigBtnFloat>
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
<?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="ConfigBtnFloat">
|
||||||
|
<xs:annotation><xs:documentation>Used with a Button component, this button will change a variable in the config file.</xs:documentation></xs:annotation>
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:all>
|
||||||
|
<xs:element name="Header" type="t:string" minOccurs="0">
|
||||||
|
<xs:annotation><xs:documentation>The header of the section in config.</xs:documentation></xs:annotation>
|
||||||
|
</xs:element>
|
||||||
|
<xs:element name="Field" type="t:string" minOccurs="0">
|
||||||
|
<xs:annotation><xs:documentation>The name of the field to be changed in the config.</xs:documentation></xs:annotation>
|
||||||
|
</xs:element>
|
||||||
|
<xs:element name="PressValue" type="t:float" minOccurs="0">
|
||||||
|
<xs:annotation><xs:documentation>The value to give the field.</xs:documentation></xs:annotation>
|
||||||
|
</xs:element>
|
||||||
|
</xs:all>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
</xs:schema>
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<ConfigBtnResolution xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ConfigBtnResolution.xsd">
|
||||||
|
<Header></Header>
|
||||||
|
<Field></Field>
|
||||||
|
<PressValue></PressValue>
|
||||||
|
</ConfigBtnResolution>
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
<?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="ConfigBtnResolution">
|
||||||
|
<xs:annotation><xs:documentation>Used with a Button component, this button will change a variable in the config file.</xs:documentation></xs:annotation>
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:all>
|
||||||
|
<xs:element name="Width" type="t:int" minOccurs="0">
|
||||||
|
<xs:annotation><xs:documentation>Value of the resolution width.</xs:documentation></xs:annotation>
|
||||||
|
</xs:element>
|
||||||
|
<xs:element name="Height" type="t:int" minOccurs="0">
|
||||||
|
<xs:annotation><xs:documentation>Value of the resolution height.</xs:documentation></xs:annotation>
|
||||||
|
</xs:element>
|
||||||
|
</xs:all>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
</xs:schema>
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
<Gain>1.0</Gain>
|
<Gain>1.0</Gain>
|
||||||
<Pitch>1.0</Pitch>
|
<Pitch>1.0</Pitch>
|
||||||
<Loop>false</Loop>
|
<Loop>false</Loop>
|
||||||
<MaxDistance>20.0</MaxDistance>
|
<MaxDistance>220.0</MaxDistance>
|
||||||
<RollOffFactor>1.0</RollOffFactor>
|
<RollOffFactor>10</RollOffFactor>
|
||||||
<ReferenceDistance>1.0</ReferenceDistance>
|
<ReferenceDistance>1.0</ReferenceDistance>
|
||||||
</SoundEmitter>
|
</SoundEmitter>
|
||||||
@@ -9,6 +9,6 @@
|
|||||||
<KeepRatioX>false</KeepRatioX>
|
<KeepRatioX>false</KeepRatioX>
|
||||||
<KeepRatioY>false</KeepRatioY>
|
<KeepRatioY>false</KeepRatioY>
|
||||||
<KeepRatio>false</KeepRatio>
|
<KeepRatio>false</KeepRatio>
|
||||||
<Linear>false</Linear>
|
<Linear>true</Linear>
|
||||||
<BlurBackground>false</BlurBackground>
|
<BlurBackground>false</BlurBackground>
|
||||||
</Sprite>
|
</Sprite>
|
||||||
|
|||||||
@@ -2,21 +2,26 @@
|
|||||||
<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:NetworkComponent/>
|
|
||||||
<c:AmmoPickup/>
|
<c:AmmoPickup/>
|
||||||
<c:Model>
|
<c:Trigger/>
|
||||||
<Resource>Models/Props/PickUps/AmmoPickUp.mesh</Resource>
|
|
||||||
</c:Model>
|
|
||||||
<c:RaptorCopter>
|
<c:RaptorCopter>
|
||||||
<Speed>8</Speed>
|
<Speed>8</Speed>
|
||||||
<Axis X="0" Y="0.100000001" Z="0"/>
|
<Axis X="0" Y="0.100000001" Z="0"/>
|
||||||
</c:RaptorCopter>
|
</c:RaptorCopter>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Props/PickUps/AmmoPickUp.mesh</Resource>
|
||||||
|
</c:Model>
|
||||||
|
<c:NetworkComponent/>
|
||||||
|
<c:PointLight>
|
||||||
|
<Color A="1" B="1" G="0.0823529437" R="1"/>
|
||||||
|
<Radius>1.5</Radius>
|
||||||
|
<Intensity>3</Intensity>
|
||||||
|
</c:PointLight>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0" Y="2.36784196" Z="0"/>
|
<Position X="0" Y="2.36784196" Z="-0.0281207096"/>
|
||||||
|
<Orientation X="0" Y="18843.5469" Z="0"/>
|
||||||
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
|
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
|
||||||
<Orientation X="0" Y="18717.9453" Z="0"/>
|
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
<c:Trigger/>
|
|
||||||
</Components>
|
</Components>
|
||||||
|
|
||||||
<Children/>
|
<Children/>
|
||||||
|
|||||||
+10167
-6806
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,169 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<Entity name="Origin" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||||
|
|
||||||
|
<Components>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
|
||||||
|
<Children>
|
||||||
|
<Entity name="Anchor1">
|
||||||
|
<Components>
|
||||||
|
<c:RaptorCopter>
|
||||||
|
<Speed>0.30000001192092896</Speed>
|
||||||
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
|
</c:RaptorCopter>
|
||||||
|
<c:FloatingEffect>
|
||||||
|
<Period>30</Period>
|
||||||
|
<Time>342.91836260588383</Time>
|
||||||
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
|
<Amplitude>3.5</Amplitude>
|
||||||
|
</c:FloatingEffect>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="1.47803104" Z="0"/>
|
||||||
|
<Orientation X="0" Y="220.263962" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Props/CapturePoint/CrystalsLayer1.mesh</Resource>
|
||||||
|
<Color A="1" B="1" G="0.392156869" R="0"/>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="Anchor2">
|
||||||
|
<Components>
|
||||||
|
<c:RaptorCopter>
|
||||||
|
<Speed>0.5</Speed>
|
||||||
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
|
</c:RaptorCopter>
|
||||||
|
<c:FloatingEffect>
|
||||||
|
<Period>20</Period>
|
||||||
|
<Time>448.85134971162591</Time>
|
||||||
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
|
<Amplitude>3</Amplitude>
|
||||||
|
</c:FloatingEffect>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="1.05921149" Z="0"/>
|
||||||
|
<Orientation X="0" Y="360.699402" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Props/CapturePoint/CrystalsLayer2.mesh</Resource>
|
||||||
|
<Color A="1" B="1" G="0.392156869" R="0"/>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="Anchor0">
|
||||||
|
<Components>
|
||||||
|
<c:RaptorCopter>
|
||||||
|
<Speed>0.10000000149011612</Speed>
|
||||||
|
<Axis X="0" Y="-1" Z="0"/>
|
||||||
|
</c:RaptorCopter>
|
||||||
|
<c:FloatingEffect>
|
||||||
|
<Period>10</Period>
|
||||||
|
<Time>495.36799589902654</Time>
|
||||||
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
|
<Amplitude>0.5</Amplitude>
|
||||||
|
</c:FloatingEffect>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-0" Y="-0.11458683" Z="-0"/>
|
||||||
|
<Orientation X="0" Y="-68.9721527" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Props/CapturePoint/CenterCrystal.mesh</Resource>
|
||||||
|
<Color A="1" B="1" G="0.392156869" R="0"/>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="LightOrigin1">
|
||||||
|
<Components>
|
||||||
|
<c:RaptorCopter>
|
||||||
|
<Speed>1</Speed>
|
||||||
|
<Axis X="0.400000006" Y="1" Z="0"/>
|
||||||
|
</c:RaptorCopter>
|
||||||
|
<c:Transform>
|
||||||
|
<Orientation X="16.781414" Y="41.9535484" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:PointLight>
|
||||||
|
<Color A="1" B="1" G="0.588235319" R="0"/>
|
||||||
|
<Radius>4.5</Radius>
|
||||||
|
<Falloff>0.5</Falloff>
|
||||||
|
</c:PointLight>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="1.1234858" Y="0.720658064" Z="3.40589333"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:PointLight>
|
||||||
|
<Color A="1" B="1" G="0.588235319" R="0"/>
|
||||||
|
<Radius>4.5</Radius>
|
||||||
|
<Falloff>0.5</Falloff>
|
||||||
|
</c:PointLight>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0.4723185" Y="0" Z="-4.12240839"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:PointLight>
|
||||||
|
<Color A="1" B="1" G="0.588235319" R="0"/>
|
||||||
|
<Radius>4.5</Radius>
|
||||||
|
<Falloff>0.5</Falloff>
|
||||||
|
</c:PointLight>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-2.91954184" Y="1.54033804" Z="-0.0577439293"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:PointLight>
|
||||||
|
<Color A="1" B="1" G="0.588235319" R="0"/>
|
||||||
|
<Radius>4.5</Radius>
|
||||||
|
<Falloff>0.5</Falloff>
|
||||||
|
</c:PointLight>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="1.48998797" Y="-3.06706786" Z="-1.78805089"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
|
||||||
|
</Entity>
|
||||||
@@ -0,0 +1,174 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<Entity name="Origin" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||||
|
|
||||||
|
<Components>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="14.8518229" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
|
||||||
|
<Children>
|
||||||
|
<Entity name="Anchor1">
|
||||||
|
<Components>
|
||||||
|
<c:RaptorCopter>
|
||||||
|
<Speed>0.30000001192092896</Speed>
|
||||||
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
|
</c:RaptorCopter>
|
||||||
|
<c:FloatingEffect>
|
||||||
|
<Period>30</Period>
|
||||||
|
<Time>1125.9779108477385</Time>
|
||||||
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
|
<Amplitude>3.5</Amplitude>
|
||||||
|
</c:FloatingEffect>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-0" Y="-0.711852849" Z="-0"/>
|
||||||
|
<Orientation X="0" Y="455.182343" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Props/CapturePoint/CrystalsLayer1.mesh</Resource>
|
||||||
|
<Color A="1" B="2" G="0.784313738" R="0"/>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
|
<Transparent>true</Transparent>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="Anchor2">
|
||||||
|
<Components>
|
||||||
|
<c:RaptorCopter>
|
||||||
|
<Speed>0.5</Speed>
|
||||||
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
|
</c:RaptorCopter>
|
||||||
|
<c:FloatingEffect>
|
||||||
|
<Period>20</Period>
|
||||||
|
<Time>1231.9108979534806</Time>
|
||||||
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
|
<Amplitude>3</Amplitude>
|
||||||
|
</c:FloatingEffect>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-0" Y="-1.69476664" Z="-0"/>
|
||||||
|
<Orientation X="0" Y="752.229553" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Props/CapturePoint/CrystalsLayer2.mesh</Resource>
|
||||||
|
<Color A="1" B="2" G="0.784313738" R="0"/>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
|
<Transparent>true</Transparent>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="Anchor0">
|
||||||
|
<Components>
|
||||||
|
<c:RaptorCopter>
|
||||||
|
<Speed>0.10000000149011612</Speed>
|
||||||
|
<Axis X="0" Y="-1" Z="0"/>
|
||||||
|
</c:RaptorCopter>
|
||||||
|
<c:FloatingEffect>
|
||||||
|
<Period>10</Period>
|
||||||
|
<Time>1278.4275441408811</Time>
|
||||||
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
|
<Amplitude>0.5</Amplitude>
|
||||||
|
</c:FloatingEffect>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-0" Y="-0.417467505" Z="-0"/>
|
||||||
|
<Orientation X="0" Y="-147.27742" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Props/CapturePoint/CenterCrystal.mesh</Resource>
|
||||||
|
<Color A="1" B="2" G="0.784313738" R="0"/>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
|
<Transparent>true</Transparent>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="LightOrigin1">
|
||||||
|
<Components>
|
||||||
|
<c:RaptorCopter>
|
||||||
|
<Speed>1</Speed>
|
||||||
|
<Axis X="0.400000006" Y="1" Z="0"/>
|
||||||
|
</c:RaptorCopter>
|
||||||
|
<c:Transform>
|
||||||
|
<Orientation X="330.00589" Y="825.014587" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:PointLight>
|
||||||
|
<Color A="1" B="1" G="0.588235319" R="0"/>
|
||||||
|
<Radius>4.5</Radius>
|
||||||
|
<Falloff>0.5</Falloff>
|
||||||
|
</c:PointLight>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="1.1234858" Y="0.720658064" Z="3.40589333"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:PointLight>
|
||||||
|
<Color A="1" B="1" G="0.588235319" R="0"/>
|
||||||
|
<Radius>4.5</Radius>
|
||||||
|
<Falloff>0.5</Falloff>
|
||||||
|
</c:PointLight>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0.4723185" Y="0" Z="-4.12240839"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:PointLight>
|
||||||
|
<Color A="1" B="1" G="0.588235319" R="0"/>
|
||||||
|
<Radius>4.5</Radius>
|
||||||
|
<Falloff>0.5</Falloff>
|
||||||
|
</c:PointLight>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-2.91954184" Y="1.54033804" Z="-0.0577439293"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:PointLight>
|
||||||
|
<Color A="1" B="1" G="0.588235319" R="0"/>
|
||||||
|
<Radius>4.5</Radius>
|
||||||
|
<Falloff>0.5</Falloff>
|
||||||
|
</c:PointLight>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="1.48998797" Y="-3.06706786" Z="-1.78805089"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
|
||||||
|
</Entity>
|
||||||
@@ -0,0 +1,173 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<Entity name="Origin" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||||
|
|
||||||
|
<Components>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="14.8518229" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
|
||||||
|
<Children>
|
||||||
|
<Entity name="Anchor1">
|
||||||
|
<Components>
|
||||||
|
<c:RaptorCopter>
|
||||||
|
<Speed>0.30000001192092896</Speed>
|
||||||
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
|
</c:RaptorCopter>
|
||||||
|
<c:FloatingEffect>
|
||||||
|
<Period>30</Period>
|
||||||
|
<Time>1816.9423460293749</Time>
|
||||||
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
|
<Amplitude>3.5</Amplitude>
|
||||||
|
</c:FloatingEffect>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-0" Y="-1.38488328" Z="-0"/>
|
||||||
|
<Orientation X="0" Y="662.475891" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Props/CapturePoint/CrystalsLayer1.mesh</Resource>
|
||||||
|
<Color A="1" B="0" G="0.235294119" R="1.09803927"/>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="Anchor2">
|
||||||
|
<Components>
|
||||||
|
<c:RaptorCopter>
|
||||||
|
<Speed>0.5</Speed>
|
||||||
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
|
</c:RaptorCopter>
|
||||||
|
<c:FloatingEffect>
|
||||||
|
<Period>20</Period>
|
||||||
|
<Time>1922.875333135117</Time>
|
||||||
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
|
<Amplitude>3</Amplitude>
|
||||||
|
</c:FloatingEffect>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="2.35616231" Z="0"/>
|
||||||
|
<Orientation X="0" Y="1097.71094" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Props/CapturePoint/CrystalsLayer2.mesh</Resource>
|
||||||
|
<Color A="1" B="0" G="0.235294119" R="1.09803927"/>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="Anchor0">
|
||||||
|
<Components>
|
||||||
|
<c:RaptorCopter>
|
||||||
|
<Speed>0.10000000149011612</Speed>
|
||||||
|
<Axis X="0" Y="-1" Z="0"/>
|
||||||
|
</c:RaptorCopter>
|
||||||
|
<c:FloatingEffect>
|
||||||
|
<Period>10</Period>
|
||||||
|
<Time>1969.3919793225175</Time>
|
||||||
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
|
<Amplitude>0.5</Amplitude>
|
||||||
|
</c:FloatingEffect>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-0" Y="-0.186382934" Z="-0"/>
|
||||||
|
<Orientation X="0" Y="-216.374603" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Props/CapturePoint/CenterCrystal.mesh</Resource>
|
||||||
|
<Color A="1" B="0" G="0.235294119" R="1.09803927"/>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-0" Y="-0" Z="-0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="LightOrigin1">
|
||||||
|
<Components>
|
||||||
|
<c:RaptorCopter>
|
||||||
|
<Speed>1</Speed>
|
||||||
|
<Axis X="0.400000006" Y="1" Z="0"/>
|
||||||
|
</c:RaptorCopter>
|
||||||
|
<c:Transform>
|
||||||
|
<Orientation X="606.394653" Y="1515.97461" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:PointLight>
|
||||||
|
<Color A="1" B="0" G="0" R="1"/>
|
||||||
|
<Radius>4.5</Radius>
|
||||||
|
<Falloff>0.5</Falloff>
|
||||||
|
</c:PointLight>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="1.1234858" Y="0.720658064" Z="3.40589333"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:PointLight>
|
||||||
|
<Color A="1" B="0" G="0" R="1"/>
|
||||||
|
<Radius>4.5</Radius>
|
||||||
|
<Falloff>0.5</Falloff>
|
||||||
|
</c:PointLight>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0.4723185" Y="0" Z="-4.12240839"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:PointLight>
|
||||||
|
<Color A="1" B="0" G="0" R="1"/>
|
||||||
|
<Radius>4.5</Radius>
|
||||||
|
<Falloff>0.5</Falloff>
|
||||||
|
</c:PointLight>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-2.91954184" Y="1.54033804" Z="-0.0577439293"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:PointLight>
|
||||||
|
<Color A="1" B="0" G="0" R="1"/>
|
||||||
|
<Radius>4.5</Radius>
|
||||||
|
<Falloff>0.5</Falloff>
|
||||||
|
</c:PointLight>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="1.48998797" Y="-3.06706786" Z="-1.78805089"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
|
||||||
|
</Entity>
|
||||||
@@ -0,0 +1,167 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<Entity name="Origin" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||||
|
|
||||||
|
<Components>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="14.8518229" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
|
||||||
|
<Children>
|
||||||
|
<Entity name="Anchor1">
|
||||||
|
<Components>
|
||||||
|
<c:RaptorCopter>
|
||||||
|
<Speed>0.30000001192092896</Speed>
|
||||||
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
|
</c:RaptorCopter>
|
||||||
|
<c:FloatingEffect>
|
||||||
|
<Period>30</Period>
|
||||||
|
<Time>1622.3711487379048</Time>
|
||||||
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
|
<Amplitude>3.5</Amplitude>
|
||||||
|
</c:FloatingEffect>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="1.66753078" Z="0"/>
|
||||||
|
<Orientation X="0" Y="604.103943" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Props/CapturePoint/CrystalsLayer1.mesh</Resource>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="Anchor2">
|
||||||
|
<Components>
|
||||||
|
<c:RaptorCopter>
|
||||||
|
<Speed>0.5</Speed>
|
||||||
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
|
</c:RaptorCopter>
|
||||||
|
<c:FloatingEffect>
|
||||||
|
<Period>20</Period>
|
||||||
|
<Time>1728.3041358436469</Time>
|
||||||
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
|
<Amplitude>3</Amplitude>
|
||||||
|
</c:FloatingEffect>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="1.5237397" Z="0"/>
|
||||||
|
<Orientation X="0" Y="1000.42615" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Props/CapturePoint/CrystalsLayer2.mesh</Resource>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="Anchor0">
|
||||||
|
<Components>
|
||||||
|
<c:RaptorCopter>
|
||||||
|
<Speed>0.10000000149011612</Speed>
|
||||||
|
<Axis X="0" Y="-1" Z="0"/>
|
||||||
|
</c:RaptorCopter>
|
||||||
|
<c:FloatingEffect>
|
||||||
|
<Period>10</Period>
|
||||||
|
<Time>1774.8207820310474</Time>
|
||||||
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
|
<Amplitude>0.5</Amplitude>
|
||||||
|
</c:FloatingEffect>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0.0561612286" Z="0"/>
|
||||||
|
<Orientation X="0" Y="-196.917053" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Props/CapturePoint/CenterCrystal.mesh</Resource>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
|
<Transparent>true</Transparent>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-0" Y="-0" Z="-0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="LightOrigin1">
|
||||||
|
<Components>
|
||||||
|
<c:RaptorCopter>
|
||||||
|
<Speed>1</Speed>
|
||||||
|
<Axis X="0.400000006" Y="1" Z="0"/>
|
||||||
|
</c:RaptorCopter>
|
||||||
|
<c:Transform>
|
||||||
|
<Orientation X="528.564453" Y="1321.40454" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:PointLight>
|
||||||
|
<Radius>4.5</Radius>
|
||||||
|
<Falloff>0.5</Falloff>
|
||||||
|
</c:PointLight>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="1.1234858" Y="0.720658064" Z="3.40589333"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:PointLight>
|
||||||
|
<Radius>4.5</Radius>
|
||||||
|
<Falloff>0.5</Falloff>
|
||||||
|
</c:PointLight>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0.4723185" Y="0" Z="-4.12240839"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:PointLight>
|
||||||
|
<Radius>4.5</Radius>
|
||||||
|
<Falloff>0.5</Falloff>
|
||||||
|
</c:PointLight>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-2.91954184" Y="1.54033804" Z="-0.0577439293"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:PointLight>
|
||||||
|
<Radius>4.5</Radius>
|
||||||
|
<Falloff>0.5</Falloff>
|
||||||
|
</c:PointLight>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="1.48998797" Y="-3.06706786" Z="-1.78805089"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
|
||||||
|
</Entity>
|
||||||
@@ -0,0 +1,171 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<Entity name="Origin" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||||
|
|
||||||
|
<Components>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="7.3052454" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
|
||||||
|
<Children>
|
||||||
|
<Entity name="Anchor0">
|
||||||
|
<Components>
|
||||||
|
<c:RaptorCopter>
|
||||||
|
<Speed>0.20000000298023224</Speed>
|
||||||
|
<Axis X="0" Y="-1" Z="0"/>
|
||||||
|
</c:RaptorCopter>
|
||||||
|
<c:FloatingEffect>
|
||||||
|
<Period>10</Period>
|
||||||
|
<Time>1323.7395571102679</Time>
|
||||||
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
|
<Amplitude>0.5</Amplitude>
|
||||||
|
</c:FloatingEffect>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0.355862439" Z="0"/>
|
||||||
|
<Orientation X="0" Y="-363.932587" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Props/CapturePoint/CenterCrystalBlue.mesh</Resource>
|
||||||
|
<Color A="1" B="0" G="0" R="0"/>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="LightOrigin1">
|
||||||
|
<Components>
|
||||||
|
<c:RaptorCopter>
|
||||||
|
<Speed>1</Speed>
|
||||||
|
<Axis X="0.400000006" Y="1" Z="0"/>
|
||||||
|
</c:RaptorCopter>
|
||||||
|
<c:Transform>
|
||||||
|
<Orientation X="348.130463" Y="870.325134" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:PointLight>
|
||||||
|
<Color A="1" B="1" G="1" R="0"/>
|
||||||
|
<Radius>4.5</Radius>
|
||||||
|
<Falloff>0.5</Falloff>
|
||||||
|
</c:PointLight>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="1.1234858" Y="0.720658064" Z="3.40589333"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:PointLight>
|
||||||
|
<Color A="1" B="1" G="1" R="0"/>
|
||||||
|
<Radius>4.5</Radius>
|
||||||
|
<Falloff>0.5</Falloff>
|
||||||
|
</c:PointLight>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0.4723185" Y="0" Z="-4.12240839"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:PointLight>
|
||||||
|
<Color A="1" B="1" G="1" R="0"/>
|
||||||
|
<Radius>4.5</Radius>
|
||||||
|
<Falloff>0.5</Falloff>
|
||||||
|
</c:PointLight>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-2.91954184" Y="1.54033804" Z="-0.0577439293"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:PointLight>
|
||||||
|
<Color A="1" B="1" G="1" R="0"/>
|
||||||
|
<Radius>4.5</Radius>
|
||||||
|
<Falloff>0.5</Falloff>
|
||||||
|
</c:PointLight>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="1.48998797" Y="-3.06706786" Z="-1.78805089"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="Anchor1">
|
||||||
|
<Components>
|
||||||
|
<c:RaptorCopter>
|
||||||
|
<Speed>0.5</Speed>
|
||||||
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
|
</c:RaptorCopter>
|
||||||
|
<c:FloatingEffect>
|
||||||
|
<Period>30</Period>
|
||||||
|
<Time>1171.2899238171258</Time>
|
||||||
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
|
<Amplitude>3.5</Amplitude>
|
||||||
|
</c:FloatingEffect>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0.93411696" Z="0"/>
|
||||||
|
<Orientation X="0" Y="1483.0957" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Props/CapturePoint/CrystalsLayer1Blue.mesh</Resource>
|
||||||
|
<Color A="1" B="0" G="0" R="0"/>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="Anchor2">
|
||||||
|
<Components>
|
||||||
|
<c:RaptorCopter>
|
||||||
|
<Speed>0.5</Speed>
|
||||||
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
|
</c:RaptorCopter>
|
||||||
|
<c:FloatingEffect>
|
||||||
|
<Period>20</Period>
|
||||||
|
<Time>1277.2229109228683</Time>
|
||||||
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
|
<Amplitude>3</Amplitude>
|
||||||
|
</c:FloatingEffect>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-0" Y="-2.29767179" Z="-0"/>
|
||||||
|
<Orientation X="0" Y="2074.16089" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Props/CapturePoint/CrystalsLayer2Blue.mesh</Resource>
|
||||||
|
<Color A="1" B="0" G="0" R="0"/>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
|
||||||
|
</Entity>
|
||||||
@@ -2,21 +2,26 @@
|
|||||||
<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:NetworkComponent/>
|
|
||||||
<c:HealthPickup/>
|
<c:HealthPickup/>
|
||||||
<c:Model>
|
<c:Trigger/>
|
||||||
<Resource>Models/Props/PickUps/HealthPickUp.mesh</Resource>
|
|
||||||
</c:Model>
|
|
||||||
<c:RaptorCopter>
|
<c:RaptorCopter>
|
||||||
<Speed>8</Speed>
|
<Speed>8</Speed>
|
||||||
<Axis X="0" Y="0.100000001" Z="0"/>
|
<Axis X="0" Y="0.100000001" Z="0"/>
|
||||||
</c:RaptorCopter>
|
</c:RaptorCopter>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Props/PickUps/HealthPickUp.mesh</Resource>
|
||||||
|
</c:Model>
|
||||||
|
<c:NetworkComponent/>
|
||||||
|
<c:PointLight>
|
||||||
|
<Color A="1" B="0" G="1" R="1"/>
|
||||||
|
<Radius>1.5</Radius>
|
||||||
|
<Intensity>3</Intensity>
|
||||||
|
</c:PointLight>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0" Y="2.36784196" Z="0"/>
|
<Position X="0" Y="2.36800003" Z="0"/>
|
||||||
|
<Orientation X="0" Y="19005.3867" Z="0"/>
|
||||||
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
|
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
|
||||||
<Orientation X="0" Y="18767.0273" Z="0"/>
|
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
<c:Trigger/>
|
|
||||||
</Components>
|
</Components>
|
||||||
|
|
||||||
<Children/>
|
<Children/>
|
||||||
|
|||||||
@@ -0,0 +1,102 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<Entity name="MuzzleFlashBlue" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||||
|
|
||||||
|
<Components>
|
||||||
|
<c:Lifetime>
|
||||||
|
<Lifetime>0.039999999105930328</Lifetime>
|
||||||
|
</c:Lifetime>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
|
||||||
|
<Children>
|
||||||
|
<Entity name="PlaneRight">
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Effects/MuzzleFlash/Blue/PlaneRight.mesh</Resource>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
|
<Transparent>true</Transparent>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="Cone1Outside">
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Effects/MuzzleFlash/Blue/Cone1Outside.mesh</Resource>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
|
<Transparent>true</Transparent>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="Cone1Inside">
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Effects/MuzzleFlash/Blue/Cone1Inside.mesh</Resource>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
|
<Transparent>true</Transparent>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="Cone2Outside">
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Effects/MuzzleFlash/Blue/Cone2Outside.mesh</Resource>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
|
<Transparent>true</Transparent>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="Cone2Inside">
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Effects/MuzzleFlash/Blue/Cone2Inside.mesh</Resource>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
|
<Transparent>true</Transparent>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="PlaneUp">
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Effects/MuzzleFlash/Blue/PlaneUp.mesh</Resource>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
|
<Transparent>true</Transparent>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="PlaneDown">
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Effects/MuzzleFlash/Blue/PlaneDown.mesh</Resource>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
|
<Transparent>true</Transparent>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="PlaneLeft">
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Effects/MuzzleFlash/Blue/PlaneLeft.mesh</Resource>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
|
<Transparent>true</Transparent>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
|
||||||
|
</Entity>
|
||||||
@@ -0,0 +1,102 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<Entity name="MuzzleFlashFire" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||||
|
|
||||||
|
<Components>
|
||||||
|
<c:Lifetime>
|
||||||
|
<Lifetime>0.039999999105930328</Lifetime>
|
||||||
|
</c:Lifetime>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
|
||||||
|
<Children>
|
||||||
|
<Entity name="PlaneRight">
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Effects/MuzzleFlash/Fire/PlaneRight.mesh</Resource>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
|
<Transparent>true</Transparent>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="Cone1Outside">
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Effects/MuzzleFlash/Fire/Cone1Outside.mesh</Resource>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
|
<Transparent>true</Transparent>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="Cone1Inside">
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Effects/MuzzleFlash/Fire/Cone1Inside.mesh</Resource>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
|
<Transparent>true</Transparent>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="Cone2Outside">
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Effects/MuzzleFlash/Fire/Cone2Outside.mesh</Resource>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
|
<Transparent>true</Transparent>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="Cone2Inside">
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Effects/MuzzleFlash/Fire/Cone2Inside.mesh</Resource>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
|
<Transparent>true</Transparent>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="PlaneUp">
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Effects/MuzzleFlash/Fire/PlaneUp.mesh</Resource>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
|
<Transparent>true</Transparent>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="PlaneDown">
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Effects/MuzzleFlash/Fire/PlaneDown.mesh</Resource>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
|
<Transparent>true</Transparent>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="PlaneLeft">
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Effects/MuzzleFlash/Fire/PlaneLeft.mesh</Resource>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
|
<Transparent>true</Transparent>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
|
||||||
|
</Entity>
|
||||||
@@ -0,0 +1,102 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<Entity name="MuzzleFlashGay" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||||
|
|
||||||
|
<Components>
|
||||||
|
<c:Lifetime>
|
||||||
|
<Lifetime>0.039999999105930328</Lifetime>
|
||||||
|
</c:Lifetime>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
|
||||||
|
<Children>
|
||||||
|
<Entity name="PlaneRight">
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Effects/MuzzleFlash/Rainbow/PlaneRight.mesh</Resource>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
|
<Transparent>true</Transparent>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="Cone1Outside">
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Effects/MuzzleFlash/Rainbow/Cone1Outside.mesh</Resource>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
|
<Transparent>true</Transparent>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="Cone1Inside">
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Effects/MuzzleFlash/Rainbow/Cone1Inside.mesh</Resource>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
|
<Transparent>true</Transparent>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="Cone2Outside">
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Effects/MuzzleFlash/Rainbow/Cone2Outside.mesh</Resource>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
|
<Transparent>true</Transparent>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="Cone2Inside">
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Effects/MuzzleFlash/Rainbow/Cone2Inside.mesh</Resource>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
|
<Transparent>true</Transparent>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="PlaneUp">
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Effects/MuzzleFlash/Rainbow/PlaneUp.mesh</Resource>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
|
<Transparent>true</Transparent>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="PlaneDown">
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Effects/MuzzleFlash/Rainbow/PlaneDown.mesh</Resource>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
|
<Transparent>true</Transparent>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="PlaneLeft">
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Effects/MuzzleFlash/Rainbow/PlaneLeft.mesh</Resource>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
|
<Transparent>true</Transparent>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
|
||||||
|
</Entity>
|
||||||
@@ -0,0 +1,102 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<Entity name="MuzzleFlashRed" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||||
|
|
||||||
|
<Components>
|
||||||
|
<c:Lifetime>
|
||||||
|
<Lifetime>0.039999999105930328</Lifetime>
|
||||||
|
</c:Lifetime>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
|
||||||
|
<Children>
|
||||||
|
<Entity name="PlaneRight">
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Effects/MuzzleFlash/Red/PlaneRight.mesh</Resource>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
|
<Transparent>true</Transparent>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="Cone1Outside">
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Effects/MuzzleFlash/Red/Cone1Outside.mesh</Resource>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
|
<Transparent>true</Transparent>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="Cone1Inside">
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Effects/MuzzleFlash/Red/Cone1Inside.mesh</Resource>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
|
<Transparent>true</Transparent>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="Cone2Outside">
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Effects/MuzzleFlash/Red/Cone2Outside.mesh</Resource>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
|
<Transparent>true</Transparent>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="Cone2Inside">
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Effects/MuzzleFlash/Red/Cone2Inside.mesh</Resource>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
|
<Transparent>true</Transparent>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="PlaneUp">
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Effects/MuzzleFlash/Red/PlaneUp.mesh</Resource>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
|
<Transparent>true</Transparent>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="PlaneDown">
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Effects/MuzzleFlash/Red/PlaneDown.mesh</Resource>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
|
<Transparent>true</Transparent>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="PlaneLeft">
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource>Models/Effects/MuzzleFlash/Red/PlaneLeft.mesh</Resource>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
|
<Transparent>true</Transparent>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
|
||||||
|
</Entity>
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,195 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<Entity name="Options" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||||
|
|
||||||
|
<Components>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
|
||||||
|
<Children>
|
||||||
|
<Entity name="Background_Origin">
|
||||||
|
<Components>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="Background">
|
||||||
|
<Components>
|
||||||
|
<c:Sprite>
|
||||||
|
<Model>Models/Core/UnitQuad.mesh</Model>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<DiffuseTexture>Textures/Core/White.png</DiffuseTexture>
|
||||||
|
<BlurBackground>true</BlurBackground>
|
||||||
|
<Color A="0.196078435" B="0" G="0" R="0"/>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Scale X="0.300000012" Y="0.5" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="Title_Origin">
|
||||||
|
<Components>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="UnderLine">
|
||||||
|
<Components>
|
||||||
|
<c:Sprite>
|
||||||
|
<Model>Models/Core/UnitQuad.mesh</Model>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<DiffuseTexture>Textures/Core/White.png</DiffuseTexture>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0.00500000035" Y="0.198000014" Z="0.0199999996"/>
|
||||||
|
<Scale X="0.270000011" Y="0.00100000005" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="Text">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>Options</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
<Alignment>
|
||||||
|
<Left/>
|
||||||
|
</Alignment>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-0.131999999" Y="0.202000007" Z="0.0199999996"/>
|
||||||
|
<Scale X="0.0320000015" Y="0.0310000014" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="Buttons_anchor">
|
||||||
|
<Components>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0" Y="0.168000013" Z="0.0199999996"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="Res1080">
|
||||||
|
<Components>
|
||||||
|
<c:Button/>
|
||||||
|
<c:ConfigBtnResolution>
|
||||||
|
<Width>1920</Width>
|
||||||
|
<Height>1080</Height>
|
||||||
|
</c:ConfigBtnResolution>
|
||||||
|
<c:Sprite>
|
||||||
|
<Model>Models/Core/UnitQuad.mesh</Model>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<DiffuseTexture>Textures/Core/White.png</DiffuseTexture>
|
||||||
|
<BlurBackground>true</BlurBackground>
|
||||||
|
<Color A="0.392156869" B="1" G="1" R="1"/>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-0.088000007" Y="0" Z="0"/>
|
||||||
|
<Scale X="0.0820000023" Y="0.0299999993" 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="0" G="0" R="0"/>
|
||||||
|
<Alignment>
|
||||||
|
<Left/>
|
||||||
|
</Alignment>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-0.361000031" Y="-0.562000036" Z="0.0199999996"/>
|
||||||
|
<Scale X="0.180000007" Y="0.469000012" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="Res768">
|
||||||
|
<Components>
|
||||||
|
<c:Button/>
|
||||||
|
<c:ConfigBtnResolution>
|
||||||
|
<Width>1366</Width>
|
||||||
|
<Height>768</Height>
|
||||||
|
</c:ConfigBtnResolution>
|
||||||
|
<c:Sprite>
|
||||||
|
<Model>Models/Core/UnitQuad.mesh</Model>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<DiffuseTexture>Textures/Core/White.png</DiffuseTexture>
|
||||||
|
<BlurBackground>true</BlurBackground>
|
||||||
|
<Color A="0.392156869" B="1" G="1" R="1"/>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Scale X="0.0820000023" Y="0.0299999993" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="Text">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>1366x768</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
<Color A="1" B="0" G="0" R="0"/>
|
||||||
|
<Alignment>
|
||||||
|
<Left/>
|
||||||
|
</Alignment>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-0.380000025" Y="-0.561999977" Z="0.0199999996"/>
|
||||||
|
<Scale X="0.180000007" Y="0.469000012" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="Res720">
|
||||||
|
<Components>
|
||||||
|
<c:Button/>
|
||||||
|
<c:ConfigBtnResolution>
|
||||||
|
<Width>1280</Width>
|
||||||
|
<Height>720</Height>
|
||||||
|
</c:ConfigBtnResolution>
|
||||||
|
<c:Sprite>
|
||||||
|
<Model>Models/Core/UnitQuad.mesh</Model>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<DiffuseTexture>Textures/Core/White.png</DiffuseTexture>
|
||||||
|
<BlurBackground>true</BlurBackground>
|
||||||
|
<Color A="0.392156869" B="1" G="1" R="1"/>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0.088000007" Y="0" Z="0"/>
|
||||||
|
<Scale X="0.0820000023" Y="0.0299999993" 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="0" G="0" R="0"/>
|
||||||
|
<Alignment>
|
||||||
|
<Left/>
|
||||||
|
</Alignment>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-0.387000024" Y="-0.561999977" Z="0.0199999996"/>
|
||||||
|
<Scale X="0.180000007" Y="0.469000012" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
|
||||||
|
</Entity>
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
<Entity name="ServerList" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
<Entity name="Play" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||||
|
|
||||||
<Components>
|
<Components>
|
||||||
<c:ServerList>
|
<c:ServerList>
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
<Entity name="Identities_Origin">
|
<Entity name="Identities_Origin">
|
||||||
<Components>
|
<Components>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0" Y="0.181182757" Z="0"/>
|
<Position X="0" Y="0.172000006" Z="0"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children>
|
||||||
@@ -33,9 +33,10 @@
|
|||||||
<Entity name="Background">
|
<Entity name="Background">
|
||||||
<Components>
|
<Components>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
|
<Model>Models/Core/UnitQuad.mesh</Model>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
<DiffuseTexture>Textures/Core/White.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/White.png</DiffuseTexture>
|
||||||
<BlurBackground>true</BlurBackground>
|
<BlurBackground>true</BlurBackground>
|
||||||
<GlowMap></GlowMap>
|
|
||||||
<Color A="0.196078435" B="0" G="0" R="0"/>
|
<Color A="0.196078435" B="0" G="0" R="0"/>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
@@ -48,9 +49,10 @@
|
|||||||
<Components>
|
<Components>
|
||||||
<c:Button/>
|
<c:Button/>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
|
<Model>Models/Core/UnitQuad.mesh</Model>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
<DiffuseTexture>Textures/Core/White.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/White.png</DiffuseTexture>
|
||||||
<BlurBackground>true</BlurBackground>
|
<BlurBackground>true</BlurBackground>
|
||||||
<GlowMap></GlowMap>
|
|
||||||
<Color A="0.588235319" B="1" G="1" R="1"/>
|
<Color A="0.588235319" B="1" G="1" R="1"/>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:InputCmdButton>
|
<c:InputCmdButton>
|
||||||
@@ -66,8 +68,9 @@
|
|||||||
<Entity name="RefreshIcon">
|
<Entity name="RefreshIcon">
|
||||||
<Components>
|
<Components>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DiffuseTexture>Textures/Icons/rotate.png</DiffuseTexture>
|
<Model>Models/Core/UnitQuad.mesh</Model>
|
||||||
<GlowMap></GlowMap>
|
<GlowMap></GlowMap>
|
||||||
|
<DiffuseTexture>Textures/Icons/rotate.png</DiffuseTexture>
|
||||||
<Color A="1" B="1" G="0" R="1"/>
|
<Color A="1" B="1" G="0" R="1"/>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
@@ -79,6 +82,43 @@
|
|||||||
</Entity>
|
</Entity>
|
||||||
</Children>
|
</Children>
|
||||||
</Entity>
|
</Entity>
|
||||||
|
<Entity name="Title_Origin">
|
||||||
|
<Components>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="UnderLine">
|
||||||
|
<Components>
|
||||||
|
<c:Sprite>
|
||||||
|
<Model>Models/Core/UnitQuad.mesh</Model>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<DiffuseTexture>Textures/Core/White.png</DiffuseTexture>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0.00500000035" Y="0.198000014" Z="0.0199999996"/>
|
||||||
|
<Scale X="0.270000011" Y="0.00100000005" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="Text">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>Servers</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
|
<Alignment>
|
||||||
|
<Left/>
|
||||||
|
</Alignment>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="-0.131999999" Y="0.202000007" Z="0.0199999996"/>
|
||||||
|
<Scale X="0.0320000015" Y="0.0310000014" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
</Children>
|
</Children>
|
||||||
|
|
||||||
</Entity>
|
</Entity>
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
<Entity>
|
<Entity>
|
||||||
<Components>
|
<Components>
|
||||||
<c:CapturePointGameMode>
|
<c:CapturePointGameMode>
|
||||||
<RespawnTime>7.0999304984909202</RespawnTime>
|
<RespawnTime>0.53338721940212963</RespawnTime>
|
||||||
</c:CapturePointGameMode>
|
</c:CapturePointGameMode>
|
||||||
<c:Transform/>
|
<c:Transform/>
|
||||||
</Components>
|
</Components>
|
||||||
@@ -2828,7 +2828,7 @@
|
|||||||
</c:Model>
|
</c:Model>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0" Y="2.36784196" Z="0"/>
|
<Position X="0" Y="2.36784196" Z="0"/>
|
||||||
<Orientation X="0" Y="25992.9746" Z="0"/>
|
<Orientation X="0" Y="26060.2324" Z="0"/>
|
||||||
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
|
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
@@ -2870,7 +2870,7 @@
|
|||||||
</c:Model>
|
</c:Model>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0" Y="2.36784196" Z="0"/>
|
<Position X="0" Y="2.36784196" Z="0"/>
|
||||||
<Orientation X="0" Y="90523.6719" Z="0"/>
|
<Orientation X="0" Y="90593.4219" Z="0"/>
|
||||||
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
|
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
@@ -2912,7 +2912,7 @@
|
|||||||
</c:Model>
|
</c:Model>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0" Y="2.36784196" Z="0"/>
|
<Position X="0" Y="2.36784196" Z="0"/>
|
||||||
<Orientation X="0" Y="90461.8125" Z="0"/>
|
<Orientation X="0" Y="90531.5625" Z="0"/>
|
||||||
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
|
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
@@ -2954,7 +2954,7 @@
|
|||||||
</c:Model>
|
</c:Model>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0" Y="2.36800003" Z="0"/>
|
<Position X="0" Y="2.36800003" Z="0"/>
|
||||||
<Orientation X="0" Y="71578.0156" Z="0"/>
|
<Orientation X="0" Y="71647.7656" Z="0"/>
|
||||||
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
|
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
@@ -2996,7 +2996,7 @@
|
|||||||
</c:Model>
|
</c:Model>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0" Y="2.36800003" Z="0"/>
|
<Position X="0" Y="2.36800003" Z="0"/>
|
||||||
<Orientation X="0" Y="25923.3281" Z="0"/>
|
<Orientation X="0" Y="25990.5859" Z="0"/>
|
||||||
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
|
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
@@ -3038,7 +3038,7 @@
|
|||||||
</c:Model>
|
</c:Model>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0" Y="2.36784196" Z="0"/>
|
<Position X="0" Y="2.36784196" Z="0"/>
|
||||||
<Orientation X="0" Y="81128.9531" Z="0"/>
|
<Orientation X="0" Y="81198.7031" Z="0"/>
|
||||||
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
|
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
@@ -3080,7 +3080,7 @@
|
|||||||
</c:Model>
|
</c:Model>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0" Y="2.36784196" Z="0"/>
|
<Position X="0" Y="2.36784196" Z="0"/>
|
||||||
<Orientation X="0" Y="78866.125" Z="0"/>
|
<Orientation X="0" Y="78935.875" Z="0"/>
|
||||||
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
|
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
@@ -3122,7 +3122,7 @@
|
|||||||
</c:Model>
|
</c:Model>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0" Y="2.36784196" Z="0"/>
|
<Position X="0" Y="2.36784196" Z="0"/>
|
||||||
<Orientation X="0" Y="90523.6719" Z="0"/>
|
<Orientation X="0" Y="90593.4219" Z="0"/>
|
||||||
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
|
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
@@ -3164,7 +3164,7 @@
|
|||||||
</c:Model>
|
</c:Model>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0" Y="2.36784196" Z="0"/>
|
<Position X="0" Y="2.36784196" Z="0"/>
|
||||||
<Orientation X="0" Y="78866.125" Z="0"/>
|
<Orientation X="0" Y="78935.875" Z="0"/>
|
||||||
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
|
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
@@ -5261,7 +5261,7 @@
|
|||||||
</c:Model>
|
</c:Model>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0" Y="2.36800003" Z="0"/>
|
<Position X="0" Y="2.36800003" Z="0"/>
|
||||||
<Orientation X="0" Y="71424.8125" Z="0"/>
|
<Orientation X="0" Y="71494.5625" Z="0"/>
|
||||||
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
|
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
@@ -5303,7 +5303,7 @@
|
|||||||
</c:Model>
|
</c:Model>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0" Y="2.36784196" Z="0"/>
|
<Position X="0" Y="2.36784196" Z="0"/>
|
||||||
<Orientation X="0" Y="47480.0781" Z="0"/>
|
<Orientation X="0" Y="47550.7578" Z="0"/>
|
||||||
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
|
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
@@ -6869,7 +6869,7 @@
|
|||||||
</c:Model>
|
</c:Model>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0" Y="2.36800003" Z="0"/>
|
<Position X="0" Y="2.36800003" Z="0"/>
|
||||||
<Orientation X="0" Y="71548.5938" Z="0"/>
|
<Orientation X="0" Y="71618.3438" Z="0"/>
|
||||||
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
|
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
@@ -6911,7 +6911,7 @@
|
|||||||
</c:Model>
|
</c:Model>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0" Y="2.36784196" Z="0"/>
|
<Position X="0" Y="2.36784196" Z="0"/>
|
||||||
<Orientation X="0" Y="90490.5469" Z="0"/>
|
<Orientation X="0" Y="90560.2969" Z="0"/>
|
||||||
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
|
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
@@ -6953,7 +6953,7 @@
|
|||||||
</c:Model>
|
</c:Model>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0" Y="2.36784196" Z="0"/>
|
<Position X="0" Y="2.36784196" Z="0"/>
|
||||||
<Orientation X="0" Y="78833" Z="0"/>
|
<Orientation X="0" Y="78902.75" Z="0"/>
|
||||||
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
|
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
@@ -6995,7 +6995,7 @@
|
|||||||
</c:Model>
|
</c:Model>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0" Y="2.36784196" Z="0"/>
|
<Position X="0" Y="2.36784196" Z="0"/>
|
||||||
<Orientation X="0" Y="81095.8281" Z="0"/>
|
<Orientation X="0" Y="81165.5781" Z="0"/>
|
||||||
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
|
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
@@ -7037,7 +7037,7 @@
|
|||||||
</c:Model>
|
</c:Model>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0" Y="2.36784196" Z="0"/>
|
<Position X="0" Y="2.36784196" Z="0"/>
|
||||||
<Orientation X="0" Y="90428.6875" Z="0"/>
|
<Orientation X="0" Y="90498.4375" Z="0"/>
|
||||||
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
|
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
@@ -7079,7 +7079,7 @@
|
|||||||
</c:Model>
|
</c:Model>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0" Y="2.36784196" Z="0"/>
|
<Position X="0" Y="2.36784196" Z="0"/>
|
||||||
<Orientation X="0" Y="25960.2227" Z="0"/>
|
<Orientation X="0" Y="26027.4805" Z="0"/>
|
||||||
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
|
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
@@ -7121,7 +7121,7 @@
|
|||||||
</c:Model>
|
</c:Model>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0" Y="2.36784196" Z="0"/>
|
<Position X="0" Y="2.36784196" Z="0"/>
|
||||||
<Orientation X="0" Y="90490.5469" Z="0"/>
|
<Orientation X="0" Y="90560.2969" Z="0"/>
|
||||||
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
|
<Scale X="0.600000024" Y="0.600000024" Z="0.600000024"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
@@ -8796,7 +8796,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="97.568718" Z="0"/>
|
<Orientation X="0" Y="165.48909" Z="0"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children>
|
||||||
@@ -8808,7 +8808,7 @@
|
|||||||
</c:RaptorCopter>
|
</c:RaptorCopter>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0" Y="26" Z="40"/>
|
<Position X="0" Y="26" Z="40"/>
|
||||||
<Orientation X="0" Y="-112.035805" Z="0"/>
|
<Orientation X="0" Y="-247.882935" Z="0"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children>
|
||||||
@@ -8858,10 +8858,11 @@
|
|||||||
<Components>
|
<Components>
|
||||||
<c:Button/>
|
<c:Button/>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
|
<Model>Models/Core/UnitQuad.mesh</Model>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
<DiffuseTexture>Textures/Core/White.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/White.png</DiffuseTexture>
|
||||||
<BlurBackground>true</BlurBackground>
|
<BlurBackground>true</BlurBackground>
|
||||||
<GlowMap></GlowMap>
|
|
||||||
<DepthSort>false</DepthSort>
|
|
||||||
<Color A="0.392156869" B="0" G="0" R="0"/>
|
<Color A="0.392156869" B="0" G="0" R="0"/>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:InputCmdButton>
|
<c:InputCmdButton>
|
||||||
@@ -8874,6 +8875,44 @@
|
|||||||
</Components>
|
</Components>
|
||||||
<Children/>
|
<Children/>
|
||||||
</Entity>
|
</Entity>
|
||||||
|
<Entity name="ButtonCorner_Origin">
|
||||||
|
<Components>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="BottomRight">
|
||||||
|
<Components>
|
||||||
|
<c:Sprite>
|
||||||
|
<Model>Models/Core/UnitQuad.mesh</Model>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<DiffuseTexture>Textures/HUD/ButtonCorner_16.png</DiffuseTexture>
|
||||||
|
<Linear>false</Linear>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0.0970000029" Y="-0.0219999999" Z="0.00499999989"/>
|
||||||
|
<Orientation X="0" Y="0" Z="4.71199989"/>
|
||||||
|
<Scale X="0.00499999989" Y="0.00499999989" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="TopRight">
|
||||||
|
<Components>
|
||||||
|
<c:Sprite>
|
||||||
|
<Model>Models/Core/UnitQuad.mesh</Model>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<DiffuseTexture>Textures/HUD/ButtonCorner_16.png</DiffuseTexture>
|
||||||
|
<Linear>false</Linear>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0.0970000029" Y="0.0220000017" Z="0.00499999989"/>
|
||||||
|
<Scale X="0.00499999989" Y="0.00499999989" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
<Entity name="Text">
|
<Entity name="Text">
|
||||||
<Components>
|
<Components>
|
||||||
<c:Text>
|
<c:Text>
|
||||||
@@ -8890,40 +8929,6 @@
|
|||||||
</Components>
|
</Components>
|
||||||
<Children/>
|
<Children/>
|
||||||
</Entity>
|
</Entity>
|
||||||
<Entity name="ButtonCorner_Origin">
|
|
||||||
<Components>
|
|
||||||
<c:Transform/>
|
|
||||||
</Components>
|
|
||||||
<Children>
|
|
||||||
<Entity name="TopRight">
|
|
||||||
<Components>
|
|
||||||
<c:Sprite>
|
|
||||||
<DiffuseTexture>Textures/HUD/ButtonCorner_16.png</DiffuseTexture>
|
|
||||||
<GlowMap></GlowMap>
|
|
||||||
</c:Sprite>
|
|
||||||
<c:Transform>
|
|
||||||
<Position X="0.0970000029" Y="0.0220000017" Z="0.00499999989"/>
|
|
||||||
<Scale X="0.00499999989" Y="0.00499999989" Z="1"/>
|
|
||||||
</c:Transform>
|
|
||||||
</Components>
|
|
||||||
<Children/>
|
|
||||||
</Entity>
|
|
||||||
<Entity name="BottomRight">
|
|
||||||
<Components>
|
|
||||||
<c:Sprite>
|
|
||||||
<DiffuseTexture>Textures/HUD/ButtonCorner_16.png</DiffuseTexture>
|
|
||||||
<GlowMap></GlowMap>
|
|
||||||
</c:Sprite>
|
|
||||||
<c:Transform>
|
|
||||||
<Position X="0.0970000029" Y="-0.0219999999" Z="0.00499999989"/>
|
|
||||||
<Orientation X="0" Y="0" Z="4.71199989"/>
|
|
||||||
<Scale X="0.00499999989" Y="0.00499999989" Z="1"/>
|
|
||||||
</c:Transform>
|
|
||||||
</Components>
|
|
||||||
<Children/>
|
|
||||||
</Entity>
|
|
||||||
</Children>
|
|
||||||
</Entity>
|
|
||||||
</Children>
|
</Children>
|
||||||
</Entity>
|
</Entity>
|
||||||
<Entity name="ButtonPos_3">
|
<Entity name="ButtonPos_3">
|
||||||
@@ -8937,10 +8942,11 @@
|
|||||||
<Components>
|
<Components>
|
||||||
<c:Button/>
|
<c:Button/>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
|
<Model>Models/Core/UnitQuad.mesh</Model>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
<DiffuseTexture>Textures/Core/White.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/White.png</DiffuseTexture>
|
||||||
<BlurBackground>true</BlurBackground>
|
<BlurBackground>true</BlurBackground>
|
||||||
<GlowMap></GlowMap>
|
|
||||||
<DepthSort>false</DepthSort>
|
|
||||||
<Color A="0.392156869" B="0" G="0" R="0"/>
|
<Color A="0.392156869" B="0" G="0" R="0"/>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
@@ -8973,8 +8979,10 @@
|
|||||||
<Entity name="TopRight">
|
<Entity name="TopRight">
|
||||||
<Components>
|
<Components>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DiffuseTexture>Textures/HUD/ButtonCorner_16.png</DiffuseTexture>
|
<Model>Models/Core/UnitQuad.mesh</Model>
|
||||||
<GlowMap></GlowMap>
|
<GlowMap></GlowMap>
|
||||||
|
<DiffuseTexture>Textures/HUD/ButtonCorner_16.png</DiffuseTexture>
|
||||||
|
<Linear>false</Linear>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0.0970000029" Y="0.0220000017" Z="0.00499999989"/>
|
<Position X="0.0970000029" Y="0.0220000017" Z="0.00499999989"/>
|
||||||
@@ -8986,8 +8994,10 @@
|
|||||||
<Entity name="BottomRight">
|
<Entity name="BottomRight">
|
||||||
<Components>
|
<Components>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DiffuseTexture>Textures/HUD/ButtonCorner_16.png</DiffuseTexture>
|
<Model>Models/Core/UnitQuad.mesh</Model>
|
||||||
<GlowMap></GlowMap>
|
<GlowMap></GlowMap>
|
||||||
|
<DiffuseTexture>Textures/HUD/ButtonCorner_16.png</DiffuseTexture>
|
||||||
|
<Linear>false</Linear>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0.0970000029" Y="-0.0219999999" Z="0.00499999989"/>
|
<Position X="0.0970000029" Y="-0.0219999999" Z="0.00499999989"/>
|
||||||
@@ -9008,16 +9018,59 @@
|
|||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children>
|
||||||
|
<Entity name="ButtonCorner_Origin">
|
||||||
|
<Components>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity name="BottomRight">
|
||||||
|
<Components>
|
||||||
|
<c:Sprite>
|
||||||
|
<Model>Models/Core/UnitQuad.mesh</Model>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<DiffuseTexture>Textures/HUD/ButtonCorner_16.png</DiffuseTexture>
|
||||||
|
<Linear>false</Linear>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0.0970000029" Y="-0.0219999999" Z="0.00499999989"/>
|
||||||
|
<Orientation X="0" Y="0" Z="4.71199989"/>
|
||||||
|
<Scale X="0.00499999989" Y="0.00499999989" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
<Entity name="TopRight">
|
||||||
|
<Components>
|
||||||
|
<c:Sprite>
|
||||||
|
<Model>Models/Core/UnitQuad.mesh</Model>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
|
<DiffuseTexture>Textures/HUD/ButtonCorner_16.png</DiffuseTexture>
|
||||||
|
<Linear>false</Linear>
|
||||||
|
</c:Sprite>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0.0970000029" Y="0.0220000017" Z="0.00499999989"/>
|
||||||
|
<Scale X="0.00499999989" Y="0.00499999989" Z="1"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
<Entity name="Button_2">
|
<Entity name="Button_2">
|
||||||
<Components>
|
<Components>
|
||||||
<c:Button/>
|
<c:Button/>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
|
<Model>Models/Core/UnitQuad.mesh</Model>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
<DiffuseTexture>Textures/Core/White.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/White.png</DiffuseTexture>
|
||||||
<BlurBackground>true</BlurBackground>
|
<BlurBackground>true</BlurBackground>
|
||||||
<GlowMap></GlowMap>
|
|
||||||
<DepthSort>false</DepthSort>
|
|
||||||
<Color A="0.392156869" B="0" G="0" R="0"/>
|
<Color A="0.392156869" B="0" G="0" R="0"/>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
|
<c:InputCmdButton>
|
||||||
|
<Command>Options</Command>
|
||||||
|
<PressValue>1</PressValue>
|
||||||
|
</c:InputCmdButton>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Scale X="0.200000003" Y="0.0500000007" Z="1"/>
|
<Scale X="0.200000003" Y="0.0500000007" Z="1"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
@@ -9027,7 +9080,7 @@
|
|||||||
<Entity name="Text">
|
<Entity name="Text">
|
||||||
<Components>
|
<Components>
|
||||||
<c:Text>
|
<c:Text>
|
||||||
<Content>Option</Content>
|
<Content>Options</Content>
|
||||||
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||||
<Alignment>
|
<Alignment>
|
||||||
<Right/>
|
<Right/>
|
||||||
@@ -9040,40 +9093,6 @@
|
|||||||
</Components>
|
</Components>
|
||||||
<Children/>
|
<Children/>
|
||||||
</Entity>
|
</Entity>
|
||||||
<Entity name="ButtonCorner_Origin">
|
|
||||||
<Components>
|
|
||||||
<c:Transform/>
|
|
||||||
</Components>
|
|
||||||
<Children>
|
|
||||||
<Entity name="TopRight">
|
|
||||||
<Components>
|
|
||||||
<c:Sprite>
|
|
||||||
<DiffuseTexture>Textures/HUD/ButtonCorner_16.png</DiffuseTexture>
|
|
||||||
<GlowMap></GlowMap>
|
|
||||||
</c:Sprite>
|
|
||||||
<c:Transform>
|
|
||||||
<Position X="0.0970000029" Y="0.0220000017" Z="0.00499999989"/>
|
|
||||||
<Scale X="0.00499999989" Y="0.00499999989" Z="1"/>
|
|
||||||
</c:Transform>
|
|
||||||
</Components>
|
|
||||||
<Children/>
|
|
||||||
</Entity>
|
|
||||||
<Entity name="BottomRight">
|
|
||||||
<Components>
|
|
||||||
<c:Sprite>
|
|
||||||
<DiffuseTexture>Textures/HUD/ButtonCorner_16.png</DiffuseTexture>
|
|
||||||
<GlowMap></GlowMap>
|
|
||||||
</c:Sprite>
|
|
||||||
<c:Transform>
|
|
||||||
<Position X="0.0970000029" Y="-0.0219999999" Z="0.00499999989"/>
|
|
||||||
<Orientation X="0" Y="0" Z="4.71199989"/>
|
|
||||||
<Scale X="0.00499999989" Y="0.00499999989" Z="1"/>
|
|
||||||
</c:Transform>
|
|
||||||
</Components>
|
|
||||||
<Children/>
|
|
||||||
</Entity>
|
|
||||||
</Children>
|
|
||||||
</Entity>
|
|
||||||
</Children>
|
</Children>
|
||||||
</Entity>
|
</Entity>
|
||||||
<Entity name="ButtonPos_4">
|
<Entity name="ButtonPos_4">
|
||||||
@@ -9087,10 +9106,11 @@
|
|||||||
<Components>
|
<Components>
|
||||||
<c:Button/>
|
<c:Button/>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
|
<DepthSort>false</DepthSort>
|
||||||
|
<Model>Models/Core/UnitQuad.mesh</Model>
|
||||||
|
<GlowMap></GlowMap>
|
||||||
<DiffuseTexture>Textures/Core/White.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Core/White.png</DiffuseTexture>
|
||||||
<BlurBackground>true</BlurBackground>
|
<BlurBackground>true</BlurBackground>
|
||||||
<GlowMap></GlowMap>
|
|
||||||
<DepthSort>false</DepthSort>
|
|
||||||
<Color A="0.392156869" B="0" G="0" R="0"/>
|
<Color A="0.392156869" B="0" G="0" R="0"/>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
@@ -9123,8 +9143,10 @@
|
|||||||
<Entity name="TopRight">
|
<Entity name="TopRight">
|
||||||
<Components>
|
<Components>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DiffuseTexture>Textures/HUD/ButtonCorner_16.png</DiffuseTexture>
|
<Model>Models/Core/UnitQuad.mesh</Model>
|
||||||
<GlowMap></GlowMap>
|
<GlowMap></GlowMap>
|
||||||
|
<DiffuseTexture>Textures/HUD/ButtonCorner_16.png</DiffuseTexture>
|
||||||
|
<Linear>false</Linear>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0.0970000029" Y="0.0220000017" Z="0.00499999989"/>
|
<Position X="0.0970000029" Y="0.0220000017" Z="0.00499999989"/>
|
||||||
@@ -9136,8 +9158,10 @@
|
|||||||
<Entity name="BottomRight">
|
<Entity name="BottomRight">
|
||||||
<Components>
|
<Components>
|
||||||
<c:Sprite>
|
<c:Sprite>
|
||||||
<DiffuseTexture>Textures/HUD/ButtonCorner_16.png</DiffuseTexture>
|
<Model>Models/Core/UnitQuad.mesh</Model>
|
||||||
<GlowMap></GlowMap>
|
<GlowMap></GlowMap>
|
||||||
|
<DiffuseTexture>Textures/HUD/ButtonCorner_16.png</DiffuseTexture>
|
||||||
|
<Linear>false</Linear>
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0.0970000029" Y="-0.0219999999" Z="0.00499999989"/>
|
<Position X="0.0970000029" Y="-0.0219999999" Z="0.00499999989"/>
|
||||||
@@ -9169,6 +9193,15 @@
|
|||||||
</Components>
|
</Components>
|
||||||
<Children/>
|
<Children/>
|
||||||
</Entity>
|
</Entity>
|
||||||
|
<Entity name="OptionsSpawner">
|
||||||
|
<Components>
|
||||||
|
<c:Spawner>
|
||||||
|
<EntityFile>Schema/Entities/OptionMenu.xml</EntityFile>
|
||||||
|
</c:Spawner>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
</Children>
|
</Children>
|
||||||
</Entity>
|
</Entity>
|
||||||
</Children>
|
</Children>
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
<c:Model>
|
<c:Model>
|
||||||
<Resource>models/core/unitcube.mesh</Resource>
|
<Resource>models/core/unitcube.mesh</Resource>
|
||||||
<Color A="1" B="0.980392158" G="1" R="1"/>
|
<Color A="1" B="0.980392158" G="1" R="1"/>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
</c:Model>
|
</c:Model>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="-0.100000001" Y="0" Z="0"/>
|
<Position X="-0.100000001" Y="0" Z="0"/>
|
||||||
@@ -28,6 +29,7 @@
|
|||||||
<c:Model>
|
<c:Model>
|
||||||
<Resource>models/core/unitcube.mesh</Resource>
|
<Resource>models/core/unitcube.mesh</Resource>
|
||||||
<Color A="1" B="0" G="0" R="1"/>
|
<Color A="1" B="0" G="0" R="1"/>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
</c:Model>
|
</c:Model>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="-14.500001" Y="1.50000012" Z="16.9222012"/>
|
<Position X="-14.500001" Y="1.50000012" Z="16.9222012"/>
|
||||||
@@ -52,6 +54,7 @@
|
|||||||
<c:Model>
|
<c:Model>
|
||||||
<Resource>models/core/unitcube.mesh</Resource>
|
<Resource>models/core/unitcube.mesh</Resource>
|
||||||
<Color A="1" B="1" G="0" R="0"/>
|
<Color A="1" B="1" G="0" R="0"/>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
</c:Model>
|
</c:Model>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="-14.500001" Y="1.50000012" Z="-17.6888409"/>
|
<Position X="-14.500001" Y="1.50000012" Z="-17.6888409"/>
|
||||||
@@ -67,6 +70,7 @@
|
|||||||
<c:Model>
|
<c:Model>
|
||||||
<Resource>models/core/unitcube.mesh</Resource>
|
<Resource>models/core/unitcube.mesh</Resource>
|
||||||
<Color A="1" B="0" G="0" R="1"/>
|
<Color A="1" B="0" G="0" R="1"/>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
</c:Model>
|
</c:Model>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="12.1000004" Y="1.50000012" Z="16.9222012"/>
|
<Position X="12.1000004" Y="1.50000012" Z="16.9222012"/>
|
||||||
@@ -82,6 +86,7 @@
|
|||||||
<c:Model>
|
<c:Model>
|
||||||
<Resource>models/core/unitcube.mesh</Resource>
|
<Resource>models/core/unitcube.mesh</Resource>
|
||||||
<Color A="1" B="1" G="0" R="0"/>
|
<Color A="1" B="1" G="0" R="0"/>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
</c:Model>
|
</c:Model>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="12.1228638" Y="1.50000012" Z="-17.9642811"/>
|
<Position X="12.1228638" Y="1.50000012" Z="-17.9642811"/>
|
||||||
@@ -198,6 +203,7 @@
|
|||||||
<c:Model>
|
<c:Model>
|
||||||
<Resource>models/core/unitcube.mesh</Resource>
|
<Resource>models/core/unitcube.mesh</Resource>
|
||||||
<Color A="1" B="39.2156868" G="0" R="3.13725495"/>
|
<Color A="1" B="39.2156868" G="0" R="3.13725495"/>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
</c:Model>
|
</c:Model>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Scale X="-70" Y="-70" Z="-70"/>
|
<Scale X="-70" Y="-70" Z="-70"/>
|
||||||
@@ -210,7 +216,7 @@
|
|||||||
<c:Transform/>
|
<c:Transform/>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children>
|
||||||
<Entity name="-">
|
<Entity name="CapP">
|
||||||
<Components>
|
<Components>
|
||||||
<c:AABB/>
|
<c:AABB/>
|
||||||
<c:CapturePoint>
|
<c:CapturePoint>
|
||||||
@@ -254,6 +260,13 @@
|
|||||||
</Components>
|
</Components>
|
||||||
<Children/>
|
<Children/>
|
||||||
</Entity>
|
</Entity>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:PointLight/>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
</Children>
|
</Children>
|
||||||
</Entity>
|
</Entity>
|
||||||
<Entity name="Blue">
|
<Entity name="Blue">
|
||||||
@@ -265,7 +278,25 @@
|
|||||||
<Scale X="3.4000001" Y="4.70000029" Z="0.700000048"/>
|
<Scale X="3.4000001" Y="4.70000029" Z="0.700000048"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children/>
|
<Children>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource></Resource>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:PointLight/>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
</Entity>
|
</Entity>
|
||||||
<Entity name="Spectator">
|
<Entity name="Spectator">
|
||||||
<Components>
|
<Components>
|
||||||
@@ -276,7 +307,43 @@
|
|||||||
<Scale X="1" Y="5.70000029" Z="1"/>
|
<Scale X="1" Y="5.70000029" Z="1"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children/>
|
<Children>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:PointLight/>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource></Resource>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:PointLight/>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource></Resource>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
</Entity>
|
</Entity>
|
||||||
</Children>
|
</Children>
|
||||||
</Entity>
|
</Entity>
|
||||||
@@ -287,11 +354,11 @@
|
|||||||
<c:Transform/>
|
<c:Transform/>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children>
|
||||||
<Entity name="-">
|
<Entity name="CapP">
|
||||||
<Components>
|
<Components>
|
||||||
<c:AABB/>
|
<c:AABB/>
|
||||||
<c:CapturePoint>
|
<c:CapturePoint>
|
||||||
<CaptureTimer>-15</CaptureTimer>
|
<CaptureTimer>12</CaptureTimer>
|
||||||
<HomePointForTeam>
|
<HomePointForTeam>
|
||||||
<Blue/>
|
<Blue/>
|
||||||
</HomePointForTeam>
|
</HomePointForTeam>
|
||||||
@@ -317,7 +384,38 @@
|
|||||||
<Scale X="4.4000001" Y="2" Z="3.70000029"/>
|
<Scale X="4.4000001" Y="2" Z="3.70000029"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children/>
|
<Children>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:Model>
|
||||||
|
<Resource></Resource>
|
||||||
|
</c:Model>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children>
|
||||||
|
<Entity>
|
||||||
|
<Components>
|
||||||
|
<c:Transform/>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
|
</Entity>
|
||||||
|
</Children>
|
||||||
</Entity>
|
</Entity>
|
||||||
<Entity name="Blue">
|
<Entity name="Blue">
|
||||||
<Components>
|
<Components>
|
||||||
|
|||||||
@@ -71,6 +71,8 @@
|
|||||||
<xs:element ref="c:NetworkComponent" minOccurs="0"/>
|
<xs:element ref="c:NetworkComponent" minOccurs="0"/>
|
||||||
<xs:element ref="c:ServerIdentity" minOccurs="0"/>
|
<xs:element ref="c:ServerIdentity" minOccurs="0"/>
|
||||||
<xs:element ref="c:ServerList" minOccurs="0"/>
|
<xs:element ref="c:ServerList" minOccurs="0"/>
|
||||||
|
<xs:element ref="c:ConfigBtnResolution" minOccurs="0"/>
|
||||||
|
<xs:element ref="c:ConfigBtnFloat" minOccurs="0"/>
|
||||||
</xs:all>
|
</xs:all>
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
|
|||||||
@@ -29,9 +29,10 @@ void main()
|
|||||||
vec4 color_result = Color * diffuseTexel;
|
vec4 color_result = Color * diffuseTexel;
|
||||||
|
|
||||||
float pos = ((P * vec4(Input.Position, 1)).y + 1.0)/2.0;
|
float pos = ((P * vec4(Input.Position, 1)).y + 1.0)/2.0;
|
||||||
float fillResult = floor(pos*FillPercentage);
|
|
||||||
|
|
||||||
color_result = FillColor*diffuseTexel.a*fillResult + color_result*(1-fillResult);
|
if(pos <= FillPercentage) {
|
||||||
|
color_result = FillColor*diffuseTexel.a;
|
||||||
|
}
|
||||||
|
|
||||||
sceneColor = vec4(color_result.xyz, clamp(color_result.a, 0, 1));
|
sceneColor = vec4(color_result.xyz, clamp(color_result.a, 0, 1));
|
||||||
|
|
||||||
|
|||||||
@@ -360,7 +360,14 @@ constexpr bool FaceIsGround(float faceNormalY)
|
|||||||
//An array containing 3 int pairs { 0, 2 }, { 0, 1 }, { 1, 2 }
|
//An array containing 3 int pairs { 0, 2 }, { 0, 1 }, { 1, 2 }
|
||||||
constexpr std::array<std::pair<int, int>, 3> dimensionPairs({ std::pair<int, int>(0, 2), std::pair<int, int>(0, 1), std::pair<int, int>(1, 2) });
|
constexpr std::array<std::pair<int, int>, 3> dimensionPairs({ std::pair<int, int>(0, 2), std::pair<int, int>(0, 1), std::pair<int, int>(1, 2) });
|
||||||
|
|
||||||
bool AABBvsTriangle(const AABB& box,
|
enum class BoxTriRes
|
||||||
|
{
|
||||||
|
Front,
|
||||||
|
Behind,
|
||||||
|
Intersect
|
||||||
|
};
|
||||||
|
|
||||||
|
BoxTriRes AABBvsTriangle(const AABB& box,
|
||||||
const std::array<glm::vec3, 3>& triPos,
|
const std::array<glm::vec3, 3>& triPos,
|
||||||
const glm::vec3& originalBoxVelocity,
|
const glm::vec3& originalBoxVelocity,
|
||||||
float verticalStepHeight,
|
float verticalStepHeight,
|
||||||
@@ -374,7 +381,7 @@ bool AABBvsTriangle(const AABB& box,
|
|||||||
//Less checks, and we should be able to walk out from models if we are trapped inside.
|
//Less checks, and we should be able to walk out from models if we are trapped inside.
|
||||||
glm::vec3 triNormal = glm::cross(triPos[1] - triPos[0], triPos[2] - triPos[0]);
|
glm::vec3 triNormal = glm::cross(triPos[1] - triPos[0], triPos[2] - triPos[0]);
|
||||||
if (!vectorHasLength(triNormal) || (glm::dot(triNormal, originalBoxVelocity) > 0)) {
|
if (!vectorHasLength(triNormal) || (glm::dot(triNormal, originalBoxVelocity) > 0)) {
|
||||||
return false;
|
return BoxTriRes::Behind;
|
||||||
}
|
}
|
||||||
triNormal = glm::normalize(triNormal);
|
triNormal = glm::normalize(triNormal);
|
||||||
|
|
||||||
@@ -409,6 +416,9 @@ bool AABBvsTriangle(const AABB& box,
|
|||||||
const glm::vec3& min = box.MinCorner();
|
const glm::vec3& min = box.MinCorner();
|
||||||
const glm::vec3& max = box.MaxCorner();
|
const glm::vec3& max = box.MaxCorner();
|
||||||
|
|
||||||
|
// If there is no intersection, whether the box center is in front of or behind the triangle.
|
||||||
|
BoxTriRes noIntersection = glm::dot(triNormal, origin - triPos[0]) > 0 ? BoxTriRes::Front : BoxTriRes::Behind;
|
||||||
|
|
||||||
//For each projection in xy-, xz-, and yx-planes.
|
//For each projection in xy-, xz-, and yx-planes.
|
||||||
for (std::pair<int, int> dim : dimensionPairs) {
|
for (std::pair<int, int> dim : dimensionPairs) {
|
||||||
//2D Triangle.
|
//2D Triangle.
|
||||||
@@ -426,7 +436,7 @@ bool AABBvsTriangle(const AABB& box,
|
|||||||
bool pushedFromTriangleLine;
|
bool pushedFromTriangleLine;
|
||||||
//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 noIntersection;
|
||||||
} else if (resolveCollision) {
|
} 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) {
|
||||||
@@ -462,14 +472,15 @@ bool AABBvsTriangle(const AABB& box,
|
|||||||
float t = glm::dot(triNormal, triPos[0] - origin) / glm::dot(triNormal, diagonal);
|
float t = glm::dot(triNormal, triPos[0] - origin) / glm::dot(triNormal, diagonal);
|
||||||
//If intersection point between plane and diagonal is within the box.
|
//If intersection point between plane and diagonal is within the box.
|
||||||
if (glm::abs(t) > 1) {
|
if (glm::abs(t) > 1) {
|
||||||
return false;
|
return noIntersection;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!resolveCollision) {
|
if (!resolveCollision) {
|
||||||
return true;
|
return BoxTriRes::Intersect;
|
||||||
}
|
}
|
||||||
|
|
||||||
glm::vec3 cornerResolution = (1+t) * diagonal;
|
glm::vec3 cornerResolution = (1+t) * diagonal;
|
||||||
|
cornerResolution = glm::dot(cornerResolution, triNormal) * triNormal;
|
||||||
//Overwrite the smallest resolution if cornerResolution is smaller.
|
//Overwrite the smallest resolution if cornerResolution is smaller.
|
||||||
float lenSq = glm::length2(cornerResolution);
|
float lenSq = glm::length2(cornerResolution);
|
||||||
if (lenSq < resolveShortest.DistanceSq) {
|
if (lenSq < resolveShortest.DistanceSq) {
|
||||||
@@ -498,7 +509,7 @@ bool AABBvsTriangle(const AABB& box,
|
|||||||
case ResolveDimZ:
|
case ResolveDimZ:
|
||||||
//If we get here, the resolution is along one coordinate axis.
|
//If we get here, the resolution is along one coordinate axis.
|
||||||
//set velocity to 0 in y if it is along y-axis.
|
//set velocity to 0 in y if it is along y-axis.
|
||||||
return true;
|
return BoxTriRes::Intersect;
|
||||||
case Line:
|
case Line:
|
||||||
projNorm = glm::normalize(outResolution);
|
projNorm = glm::normalize(outResolution);
|
||||||
break;
|
break;
|
||||||
@@ -533,10 +544,10 @@ bool AABBvsTriangle(const AABB& box,
|
|||||||
boxVelocity = boxVelocity - glm::dot(boxVelocity, projNorm) * projNorm;
|
boxVelocity = boxVelocity - glm::dot(boxVelocity, projNorm) * projNorm;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return BoxTriRes::Intersect;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AABBvsTriangles(const AABB& box,
|
Output AABBvsTriangles(const AABB& box,
|
||||||
const RawModel::Vertex* modelVertices,
|
const RawModel::Vertex* modelVertices,
|
||||||
const std::vector<unsigned int>& modelIndices,
|
const std::vector<unsigned int>& modelIndices,
|
||||||
const glm::mat4& modelMatrix,
|
const glm::mat4& modelMatrix,
|
||||||
@@ -546,8 +557,8 @@ bool AABBvsTriangles(const AABB& box,
|
|||||||
glm::vec3& outResolutionVector,
|
glm::vec3& outResolutionVector,
|
||||||
bool resolveCollision)
|
bool resolveCollision)
|
||||||
{
|
{
|
||||||
bool hit = false;
|
bool intersect = false;
|
||||||
|
Output out = Output::OutContained;
|
||||||
bool everHitTheGround = false;
|
bool everHitTheGround = false;
|
||||||
AABB newBox = box;
|
AABB newBox = box;
|
||||||
outResolutionVector = glm::vec3(0.f);
|
outResolutionVector = glm::vec3(0.f);
|
||||||
@@ -560,20 +571,27 @@ 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, resolveCollision)) {
|
switch (AABBvsTriangle(newBox, triVertices, originalBoxVelocity, verticalStepHeight, collideWithGround, boxVelocity, outVec, resolveCollision)) {
|
||||||
hit = true;
|
case Collision::BoxTriRes::Front:
|
||||||
|
out = Output::OutSeparated;
|
||||||
|
break;
|
||||||
|
case Collision::BoxTriRes::Intersect:
|
||||||
|
intersect = true;
|
||||||
outResolutionVector += outVec;
|
outResolutionVector += outVec;
|
||||||
newBox = AABB::FromOriginSize(newBox.Origin() + outVec, newBox.Size());
|
newBox = AABB::FromOriginSize(newBox.Origin() + outVec, newBox.Size());
|
||||||
if (collideWithGround) {
|
if (collideWithGround) {
|
||||||
everHitTheGround = isOnGround = true;
|
everHitTheGround = isOnGround = true;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!everHitTheGround) {
|
if (!everHitTheGround) {
|
||||||
isOnGround = false;
|
isOnGround = false;
|
||||||
}
|
}
|
||||||
return hit;
|
return intersect ? Output::OutIntersecting : out;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AABBvsTriangles(const AABB& box,
|
bool AABBvsTriangles(const AABB& box,
|
||||||
@@ -593,13 +611,31 @@ bool AABBvsTriangles(const AABB& box,
|
|||||||
verticalStepHeight,
|
verticalStepHeight,
|
||||||
isOnGround,
|
isOnGround,
|
||||||
outResolutionVector,
|
outResolutionVector,
|
||||||
true);
|
true) == Output::OutIntersecting;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AABBvsTriangles(const AABB& box,
|
bool AABBvsTriangles(const AABB& box,
|
||||||
const RawModel::Vertex* modelVertices,
|
const RawModel::Vertex* modelVertices,
|
||||||
const std::vector<unsigned int>& modelIndices,
|
const std::vector<unsigned int>& modelIndices,
|
||||||
const glm::mat4& modelMatrix)
|
const glm::mat4& modelMatrix)
|
||||||
|
{
|
||||||
|
glm::vec3 vel, outres;
|
||||||
|
bool g;
|
||||||
|
return AABBvsTriangles(box,
|
||||||
|
modelVertices,
|
||||||
|
modelIndices,
|
||||||
|
modelMatrix,
|
||||||
|
vel,
|
||||||
|
0.f,
|
||||||
|
g,
|
||||||
|
outres,
|
||||||
|
false) == Output::OutIntersecting;
|
||||||
|
}
|
||||||
|
|
||||||
|
Output AABBvsTrianglesWContainment(const AABB& box,
|
||||||
|
const RawModel::Vertex* modelVertices,
|
||||||
|
const std::vector<unsigned int>& modelIndices,
|
||||||
|
const glm::mat4& modelMatrix)
|
||||||
{
|
{
|
||||||
glm::vec3 vel, outres;
|
glm::vec3 vel, outres;
|
||||||
bool g;
|
bool g;
|
||||||
|
|||||||
@@ -37,6 +37,10 @@ void CollisionSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper& c
|
|||||||
bool hit;
|
bool hit;
|
||||||
float dist;
|
float dist;
|
||||||
if (boxB.Entity.HasComponent("Model")) {
|
if (boxB.Entity.HasComponent("Model")) {
|
||||||
|
if (!((bool)boxB.Entity["Model"]["Visible"])) {
|
||||||
|
// Don't collide against invisible models.
|
||||||
|
continue;
|
||||||
|
}
|
||||||
RawModel* model;
|
RawModel* model;
|
||||||
std::string res = (std::string)boxB.Entity["Model"]["Resource"];
|
std::string res = (std::string)boxB.Entity["Model"]["Resource"];
|
||||||
try {
|
try {
|
||||||
@@ -77,7 +81,11 @@ void CollisionSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper& c
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (boxB.Entity.HasComponent("Model") && Collision::AABBVsAABB(boxA, boxB)) {
|
if (boxB.Entity.HasComponent("Model") && Collision::AABBVsAABB(boxA, boxB)) {
|
||||||
//Here we know boxB is a entity with Collideable, AABB, and Model.
|
// Here we know boxB is a entity with Collideable, AABB, and Model.
|
||||||
|
if (!((bool)boxB.Entity["Model"]["Visible"])) {
|
||||||
|
// Don't collide against invisible models.
|
||||||
|
continue;
|
||||||
|
}
|
||||||
RawModel* model;
|
RawModel* model;
|
||||||
try {
|
try {
|
||||||
model = ResourceManager::Load<RawModel, true>(boxB.Entity["Model"]["Resource"]);
|
model = ResourceManager::Load<RawModel, true>(boxB.Entity["Model"]["Resource"]);
|
||||||
@@ -88,12 +96,11 @@ void CollisionSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper& c
|
|||||||
glm::mat4 modelMatrix = Transform::ModelMatrix(boxB.Entity);
|
glm::mat4 modelMatrix = Transform::ModelMatrix(boxB.Entity);
|
||||||
|
|
||||||
glm::vec3 inOutVelocity = (glm::vec3)cPhysics["Velocity"];
|
glm::vec3 inOutVelocity = (glm::vec3)cPhysics["Velocity"];
|
||||||
bool notMovingxz = glm::all(glm::lessThan(glm::abs(glm::vec2(inOutVelocity.x, inOutVelocity.z)), glm::vec2(0.01f))) && prevPosIt != m_PrevPositions.end();
|
|
||||||
bool isOnGround = (bool)cPhysics["IsOnGround"];
|
bool isOnGround = (bool)cPhysics["IsOnGround"];
|
||||||
float verticalStepHeight = (float)(double)cPhysics["VerticalStepHeight"];
|
float verticalStepHeight = (float)(double)cPhysics["VerticalStepHeight"];
|
||||||
if (Collision::AABBvsTriangles(boxA, model->Vertices(), model->m_Indices, modelMatrix, inOutVelocity, verticalStepHeight, isOnGround, resolutionVector)) {
|
if (Collision::AABBvsTriangles(boxA, model->Vertices(), model->m_Indices, modelMatrix, inOutVelocity, verticalStepHeight, isOnGround, resolutionVector)) {
|
||||||
//Move the position to previous position if it is not moving in the xz-plane, else resolve with the resolution vector.
|
//Move the position to previous position if it is not moving in the xz-plane, else resolve with the resolution vector.
|
||||||
(glm::vec3&)cTransform["Position"] += notMovingxz ? prevPosIt->second - boxA.Origin() : resolutionVector;
|
(glm::vec3&)cTransform["Position"] += resolutionVector;
|
||||||
boxA = *Collision::EntityAbsoluteAABB(entity);
|
boxA = *Collision::EntityAbsoluteAABB(entity);
|
||||||
cPhysics["Velocity"] = inOutVelocity;
|
cPhysics["Velocity"] = inOutVelocity;
|
||||||
if (isOnGround) {
|
if (isOnGround) {
|
||||||
|
|||||||
@@ -10,6 +10,16 @@ void TriggerSystem::UpdateComponent(EntityWrapper& triggerEntity, ComponentWrapp
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RawModel* triggerModel = nullptr;
|
||||||
|
glm::mat4 triggerModelMat;
|
||||||
|
if (triggerEntity.HasComponent("Model")) {
|
||||||
|
try {
|
||||||
|
triggerModel = ResourceManager::Load<RawModel, true>(triggerEntity["Model"]["Resource"]);
|
||||||
|
triggerModelMat = Transform::ModelMatrix(triggerEntity);
|
||||||
|
} catch (const std::exception&) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
m_OctreeOut.clear();
|
m_OctreeOut.clear();
|
||||||
m_Octree->ObjectsInSameRegion(*triggerBox, m_OctreeOut);
|
m_Octree->ObjectsInSameRegion(*triggerBox, m_OctreeOut);
|
||||||
|
|
||||||
@@ -22,7 +32,17 @@ void TriggerSystem::UpdateComponent(EntityWrapper& triggerEntity, ComponentWrapp
|
|||||||
if (colliderFitsInTrigger) {
|
if (colliderFitsInTrigger) {
|
||||||
completelyInsideBox = AABB::FromOriginSize((*triggerBox).Origin(), (*triggerBox).Size() - 2.0f * colliderBox.Size());
|
completelyInsideBox = AABB::FromOriginSize((*triggerBox).Origin(), (*triggerBox).Size() - 2.0f * colliderBox.Size());
|
||||||
}
|
}
|
||||||
if (colliderFitsInTrigger && Collision::AABBVsAABB(completelyInsideBox, colliderBox)) {
|
|
||||||
|
// We know the entity is inside the trigger box, but perhaps not the model yet.
|
||||||
|
Collision::Output out = triggerModel == nullptr
|
||||||
|
? Collision::Output::OutContained
|
||||||
|
: Collision::AABBvsTrianglesWContainment(
|
||||||
|
colliderBox,
|
||||||
|
triggerModel->Vertices(),
|
||||||
|
triggerModel->m_Indices,
|
||||||
|
triggerModelMat);
|
||||||
|
|
||||||
|
if (colliderFitsInTrigger && Collision::AABBVsAABB(completelyInsideBox, colliderBox) && out == Collision::Output::OutContained) {
|
||||||
// Entity is completely inside the trigger.
|
// Entity is completely inside the trigger.
|
||||||
// If it was only touching before, it is erased.
|
// If it was only touching before, it is erased.
|
||||||
m_EntitiesTouchingTrigger[triggerEntity].erase(colliderEntity);
|
m_EntitiesTouchingTrigger[triggerEntity].erase(colliderEntity);
|
||||||
@@ -32,7 +52,8 @@ void TriggerSystem::UpdateComponent(EntityWrapper& triggerEntity, ComponentWrapp
|
|||||||
completeSet.insert(colliderEntity);
|
completeSet.insert(colliderEntity);
|
||||||
publish<Events::TriggerEnter>(colliderEntity, triggerEntity);
|
publish<Events::TriggerEnter>(colliderEntity, triggerEntity);
|
||||||
}
|
}
|
||||||
} else {
|
continue;
|
||||||
|
} else if (out != Collision::Output::OutSeparated) {
|
||||||
// Entity is only touching the trigger.
|
// Entity is only touching the trigger.
|
||||||
auto& touchSet = m_EntitiesTouchingTrigger[triggerEntity];
|
auto& touchSet = m_EntitiesTouchingTrigger[triggerEntity];
|
||||||
auto& completeSet = m_EntitiesCompletelyInTrigger[triggerEntity];
|
auto& completeSet = m_EntitiesCompletelyInTrigger[triggerEntity];
|
||||||
@@ -47,17 +68,17 @@ void TriggerSystem::UpdateComponent(EntityWrapper& triggerEntity, ComponentWrapp
|
|||||||
touchSet.insert(colliderEntity);
|
touchSet.insert(colliderEntity);
|
||||||
}
|
}
|
||||||
// Else, it was touching the trigger last frame too and nothing is done.
|
// Else, it was touching the trigger last frame too and nothing is done.
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// Entity is not touching the trigger,
|
|
||||||
// Throw event if it was previously.
|
|
||||||
if (throwLeaveIfWasInTrigger(m_EntitiesTouchingTrigger[triggerEntity], colliderEntity, triggerEntity)) {
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// This only occurs if the entity was completely inside the trigger one frame,
|
|
||||||
// then completely outside the trigger, e.g. when dying and respawning.
|
|
||||||
throwLeaveIfWasInTrigger(m_EntitiesCompletelyInTrigger[triggerEntity], colliderEntity, triggerEntity);
|
|
||||||
}
|
}
|
||||||
|
// Only get here if entity is not touching the trigger,
|
||||||
|
// throw event if it was touching previously.
|
||||||
|
if (throwLeaveIfWasInTrigger(m_EntitiesTouchingTrigger[triggerEntity], colliderEntity, triggerEntity)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
// This only occurs if the entity was completely inside the trigger one frame,
|
||||||
|
// then completely outside the trigger, e.g. when dying and respawning.
|
||||||
|
throwLeaveIfWasInTrigger(m_EntitiesCompletelyInTrigger[triggerEntity], colliderEntity, triggerEntity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
#include "Editor/EditorWidgetSystem.h"
|
#include "Editor/EditorWidgetSystem.h"
|
||||||
#include "Core/EntityFile.h"
|
#include "Core/EntityFile.h"
|
||||||
|
|
||||||
EditorSystem::EditorSystem(SystemParams params, IRenderer* renderer, RenderFrame* renderFrame)
|
EditorSystem::EditorSystem(SystemParams params, IRenderer* renderer, RenderFrame* renderFrame)
|
||||||
: System(params)
|
: System(params)
|
||||||
, m_Renderer(renderer)
|
, m_Renderer(renderer)
|
||||||
, m_RenderFrame(renderFrame)
|
, m_RenderFrame(renderFrame)
|
||||||
@@ -14,7 +14,7 @@ EditorSystem::EditorSystem(SystemParams params, IRenderer* renderer, RenderFrame
|
|||||||
m_EditorWorldSystemPipeline->AddSystem<UniformScaleSystem>(0);
|
m_EditorWorldSystemPipeline->AddSystem<UniformScaleSystem>(0);
|
||||||
m_EditorWorldSystemPipeline->AddSystem<EditorWidgetSystem>(0, m_Renderer);
|
m_EditorWorldSystemPipeline->AddSystem<EditorWidgetSystem>(0, m_Renderer);
|
||||||
m_EditorWorldSystemPipeline->AddSystem<EditorRenderSystem>(1, m_Renderer, m_RenderFrame);
|
m_EditorWorldSystemPipeline->AddSystem<EditorRenderSystem>(1, m_Renderer, m_RenderFrame);
|
||||||
|
|
||||||
m_EditorCamera = importEntity(EntityWrapper(m_EditorWorld, EntityID_Invalid), "Schema/Entities/Empty.xml");
|
m_EditorCamera = importEntity(EntityWrapper(m_EditorWorld, EntityID_Invalid), "Schema/Entities/Empty.xml");
|
||||||
m_ActualCamera = m_EditorCamera;
|
m_ActualCamera = m_EditorCamera;
|
||||||
m_EditorWorld->AttachComponent(m_EditorCamera.ID, "Transform");
|
m_EditorWorld->AttachComponent(m_EditorCamera.ID, "Transform");
|
||||||
@@ -47,6 +47,7 @@ EditorSystem::EditorSystem(SystemParams params, IRenderer* renderer, RenderFrame
|
|||||||
Enable();
|
Enable();
|
||||||
} else {
|
} else {
|
||||||
Disable();
|
Disable();
|
||||||
|
m_EventBroker->Publish(Events::UnlockMouse());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,6 +72,9 @@ void EditorSystem::Update(double dt)
|
|||||||
m_EditorStats->Draw(actualDelta);
|
m_EditorStats->Draw(actualDelta);
|
||||||
|
|
||||||
if (m_CurrentSelection.Valid() && m_Widget.Valid()) {
|
if (m_CurrentSelection.Valid() && m_Widget.Valid()) {
|
||||||
|
if (isAnyParentMissingTransform(m_CurrentSelection.ID)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
(glm::vec3&)m_Widget["Transform"]["Position"] = Transform::AbsolutePosition(m_CurrentSelection);
|
(glm::vec3&)m_Widget["Transform"]["Position"] = Transform::AbsolutePosition(m_CurrentSelection);
|
||||||
if (m_WidgetSpace == EditorGUI::WidgetSpace::Local) {
|
if (m_WidgetSpace == EditorGUI::WidgetSpace::Local) {
|
||||||
(glm::vec3&)m_Widget["Transform"]["Orientation"] = Transform::AbsoluteOrientationEuler(m_CurrentSelection);
|
(glm::vec3&)m_Widget["Transform"]["Orientation"] = Transform::AbsoluteOrientationEuler(m_CurrentSelection);
|
||||||
@@ -78,7 +82,6 @@ void EditorSystem::Update(double dt)
|
|||||||
(glm::vec3&)m_Widget["Transform"]["Orientation"] = glm::vec3(0, 0, 0);
|
(glm::vec3&)m_Widget["Transform"]["Orientation"] = glm::vec3(0, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_EditorWorldSystemPipeline->Update(actualDelta);
|
m_EditorWorldSystemPipeline->Update(actualDelta);
|
||||||
|
|
||||||
ComponentWrapper& cameraTransform = m_EditorCamera["Transform"];
|
ComponentWrapper& cameraTransform = m_EditorCamera["Transform"];
|
||||||
@@ -202,6 +205,9 @@ bool EditorSystem::OnMousePress(const Events::MousePress& e)
|
|||||||
bool EditorSystem::OnWidgetDelta(const Events::WidgetDelta& e)
|
bool EditorSystem::OnWidgetDelta(const Events::WidgetDelta& e)
|
||||||
{
|
{
|
||||||
if (m_CurrentSelection.Valid()) {
|
if (m_CurrentSelection.Valid()) {
|
||||||
|
if (isAnyParentMissingTransform(m_CurrentSelection.ID)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (m_WidgetSpace == EditorGUI::WidgetSpace::Global) {
|
if (m_WidgetSpace == EditorGUI::WidgetSpace::Global) {
|
||||||
glm::quat parentOrientation;
|
glm::quat parentOrientation;
|
||||||
glm::vec3 parentScale(1.f);
|
glm::vec3 parentScale(1.f);
|
||||||
@@ -308,3 +314,15 @@ void EditorSystem::setWidgetMode(EditorGUI::WidgetMode mode)
|
|||||||
|
|
||||||
m_Widget["Transform"]["Position"] = Transform::AbsolutePosition(m_CurrentSelection.World, m_CurrentSelection.ID);
|
m_Widget["Transform"]["Position"] = Transform::AbsolutePosition(m_CurrentSelection.World, m_CurrentSelection.ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool EditorSystem::isAnyParentMissingTransform(EntityID entityID)
|
||||||
|
{
|
||||||
|
EntityWrapper entity(m_World, entityID);
|
||||||
|
while (entity.Parent().Valid()) {
|
||||||
|
if (!entity.HasComponent("Transform")) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
entity = entity.Parent();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#include "Network/Client.h"
|
#include "Network/Client.h"
|
||||||
|
#include "Network/EPlayerDisconnected.h"
|
||||||
using namespace boost::asio::ip;
|
using namespace boost::asio::ip;
|
||||||
|
|
||||||
Client::Client(World* world, EventBroker* eventBroker)
|
Client::Client(World* world, EventBroker* eventBroker)
|
||||||
@@ -50,16 +51,19 @@ void Client::Connect(std::string address, int port)
|
|||||||
void Client::Update()
|
void Client::Update()
|
||||||
{
|
{
|
||||||
m_EventBroker->Process<Client>();
|
m_EventBroker->Process<Client>();
|
||||||
//while (m_Unreliable.IsSocketAvailable()) {
|
while (m_Unreliable.IsSocketAvailable()) {
|
||||||
// // Packet will get real data in receive
|
m_Unreliable.ReceivePackets();
|
||||||
// Packet packet(MessageType::Invalid);
|
}
|
||||||
// m_Unreliable.Receive(packet);
|
// Packet will get real data in GetNextPacket()
|
||||||
// if (packet.GetMessageType() == MessageType::Connect) {
|
Packet parsedPacket(MessageType::Invalid);
|
||||||
// parseUDPConnect(packet);
|
while (m_Unreliable.GetNextPacket(parsedPacket)) {
|
||||||
// } else {
|
if (parsedPacket.GetMessageType() == MessageType::Connect) {
|
||||||
// parseMessageType(packet);
|
parseUDPConnect(parsedPacket);
|
||||||
// }
|
} else {
|
||||||
//}
|
parseMessageType(parsedPacket);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
while (m_Reliable.IsSocketAvailable()) {
|
while (m_Reliable.IsSocketAvailable()) {
|
||||||
// Packet will get real data in receive
|
// Packet will get real data in receive
|
||||||
Packet packet(MessageType::Invalid);
|
Packet packet(MessageType::Invalid);
|
||||||
@@ -106,8 +110,9 @@ void Client::Update()
|
|||||||
|
|
||||||
void Client::parseMessageType(Packet& packet)
|
void Client::parseMessageType(Packet& packet)
|
||||||
{
|
{
|
||||||
// Pop packetSize
|
// Pop packetSize, sequenceNumber and packetsInSequence.
|
||||||
packet.ReadPrimitive<int>();
|
popNetworkSegmentOfHeader(packet);
|
||||||
|
|
||||||
int messageType = packet.ReadPrimitive<int>();
|
int messageType = packet.ReadPrimitive<int>();
|
||||||
if (messageType == -1)
|
if (messageType == -1)
|
||||||
return;
|
return;
|
||||||
@@ -162,26 +167,29 @@ void Client::parseMessageType(Packet& packet)
|
|||||||
void Client::parseUDPConnect(Packet& packet)
|
void Client::parseUDPConnect(Packet& packet)
|
||||||
{
|
{
|
||||||
// Map ServerEntityID and your PlayerID
|
// Map ServerEntityID and your PlayerID
|
||||||
|
// TODO: If this is not received send a new connect message.
|
||||||
LOG_INFO("I be connected PogChamp");
|
LOG_INFO("I be connected PogChamp");
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::parseTCPConnect(Packet& packet)
|
void Client::parseTCPConnect(Packet& packet)
|
||||||
{
|
{
|
||||||
LOG_INFO("Received TCP connect from server");
|
LOG_INFO("Received TCP connect from server");
|
||||||
// Pop size of message int
|
// Pop packetSize, group, groupIndex and groupSize.
|
||||||
packet.ReadPrimitive<int>();
|
popNetworkSegmentOfHeader(packet);
|
||||||
|
|
||||||
int messageType = packet.ReadPrimitive<int>();
|
int messageType = packet.ReadPrimitive<int>();
|
||||||
// Read packet ID
|
// Read packet ID
|
||||||
m_PreviousPacketID = m_PacketID; // Set previous packet id
|
m_PreviousPacketID = m_PacketID; // Set previous packet id
|
||||||
m_PacketID = packet.ReadPrimitive<int>(); //Read new packet id
|
m_PacketID = packet.ReadPrimitive<int>(); //Read new packet id
|
||||||
// parse player id and other stuff
|
// parse player id and other stuff
|
||||||
m_PlayerID = packet.ReadPrimitive<int>();
|
m_PlayerID = packet.ReadPrimitive<int>();
|
||||||
m_PlayerID = packet.ReadPrimitive<int>();
|
|
||||||
LOG_INFO("A Player connected");
|
LOG_INFO("A Player connected");
|
||||||
|
// TODO: If this is not received send a new connect message.
|
||||||
Packet UnreliablePacket(MessageType::Connect, m_SendPacketID);
|
Packet UnreliablePacket(MessageType::Connect, m_SendPacketID);
|
||||||
// Add player id and other stuff
|
// Add player id and other stuff
|
||||||
packet.WritePrimitive(m_PlayerID);
|
packet.WritePrimitive(m_PlayerID);
|
||||||
// m_Unreliable.Send(packet);
|
m_Unreliable.Send(packet);
|
||||||
|
|
||||||
// LOG_INFO("Sent UDP Connect Server");
|
// LOG_INFO("Sent UDP Connect Server");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -208,10 +216,11 @@ void Client::parsePing()
|
|||||||
|
|
||||||
void Client::parseServerlist(Packet& packet)
|
void Client::parseServerlist(Packet& packet)
|
||||||
{
|
{
|
||||||
// Pop size, message type, and ID
|
// Pop packetSize, group, groupIndex and groupSize.
|
||||||
packet.ReadPrimitive<int>();
|
popNetworkSegmentOfHeader(packet);
|
||||||
packet.ReadPrimitive<int>();
|
packet.ReadPrimitive<int>();
|
||||||
packet.ReadPrimitive<int>();
|
packet.ReadPrimitive<int>();
|
||||||
|
|
||||||
std::string address = packet.ReadString();
|
std::string address = packet.ReadString();
|
||||||
int port = packet.ReadPrimitive<int>();
|
int port = packet.ReadPrimitive<int>();
|
||||||
std::string serverName = packet.ReadString();
|
std::string serverName = packet.ReadString();
|
||||||
@@ -224,7 +233,7 @@ void Client::parseServerlist(Packet& packet)
|
|||||||
void Client::parseKick()
|
void Client::parseKick()
|
||||||
{
|
{
|
||||||
LOG_WARNING("You have been kicked from the server.");
|
LOG_WARNING("You have been kicked from the server.");
|
||||||
m_IsConnected = false;
|
disconnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::parseSpawnEvents()
|
void Client::parseSpawnEvents()
|
||||||
@@ -463,7 +472,12 @@ void Client::disconnect()
|
|||||||
m_PacketID = 0;
|
m_PacketID = 0;
|
||||||
Packet packet(MessageType::Disconnect, m_SendPacketID);
|
Packet packet(MessageType::Disconnect, m_SendPacketID);
|
||||||
m_Reliable.Send(packet);
|
m_Reliable.Send(packet);
|
||||||
|
m_Unreliable.Disconnect();
|
||||||
m_Reliable.Disconnect();
|
m_Reliable.Disconnect();
|
||||||
|
Events::PlayerDisconnected e;
|
||||||
|
e.Entity = m_LocalPlayer.ID;
|
||||||
|
e.PlayerID = -1;
|
||||||
|
m_EventBroker->Publish(e);
|
||||||
createMainMenu();
|
createMainMenu();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -475,8 +489,8 @@ bool Client::OnInputCommand(const Events::InputCommand & e)
|
|||||||
|
|
||||||
if (e.Command == "ConnectToServer") { // Connect for now
|
if (e.Command == "ConnectToServer") { // Connect for now
|
||||||
if (e.Value > 0) {
|
if (e.Value > 0) {
|
||||||
//m_Reliable.Connect(m_PlayerName, m_Address, m_Port);
|
m_Reliable.Connect(m_PlayerName, m_Address, m_Port);
|
||||||
// m_Unreliable.Connect(m_PlayerName, m_Address, m_Port);
|
m_Unreliable.Connect(m_PlayerName, m_Address, m_Port);
|
||||||
}
|
}
|
||||||
//LOG_DEBUG("Client::OnInputCommand: Command is %s. Value is %f. PlayerID is %i.", e.Command.c_str(), e.Value, e.PlayerID);
|
//LOG_DEBUG("Client::OnInputCommand: Command is %s. Value is %f. PlayerID is %i.", e.Command.c_str(), e.Value, e.PlayerID);
|
||||||
return true;
|
return true;
|
||||||
@@ -553,6 +567,7 @@ bool Client::OnConnectRequest(const Events::ConnectRequest& e)
|
|||||||
{
|
{
|
||||||
removeWorld();
|
removeWorld();
|
||||||
if (m_Reliable.Connect(m_PlayerName, e.IP, e.Port)) {
|
if (m_Reliable.Connect(m_PlayerName, e.IP, e.Port)) {
|
||||||
|
m_Unreliable.Connect(m_PlayerName, e.IP, e.Port);
|
||||||
// The client sent a successful connect message
|
// The client sent a successful connect message
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
@@ -629,7 +644,7 @@ void Client::sendLocalPlayerTransform()
|
|||||||
packet.WritePrimitive((int)cAssaultWeapon["Ammo"]);
|
packet.WritePrimitive((int)cAssaultWeapon["Ammo"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_Reliable.Send(packet);
|
m_Unreliable.Send(packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::identifyPacketLoss()
|
void Client::identifyPacketLoss()
|
||||||
@@ -691,7 +706,6 @@ void Client::displayServerlist()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Client::removeWorld()
|
void Client::removeWorld()
|
||||||
{
|
{
|
||||||
std::vector<EntityID> childrenToBeDeleted;
|
std::vector<EntityID> childrenToBeDeleted;
|
||||||
|
|||||||
@@ -83,3 +83,12 @@ void Network::updateNetworkData()
|
|||||||
m_NetworkData.DataReceivedThisInterval = 0;
|
m_NetworkData.DataReceivedThisInterval = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Network::popNetworkSegmentOfHeader(Packet & packet)
|
||||||
|
{
|
||||||
|
// Pop packetSize, group, groupIndex and groupSize.
|
||||||
|
packet.ReadPrimitive<int>();
|
||||||
|
packet.ReadPrimitive<int>();
|
||||||
|
packet.ReadPrimitive<int>();
|
||||||
|
packet.ReadPrimitive<int>();
|
||||||
|
}
|
||||||
|
|||||||
@@ -3,16 +3,22 @@
|
|||||||
Packet::Packet(MessageType type, unsigned int& packetID)
|
Packet::Packet(MessageType type, unsigned int& packetID)
|
||||||
{
|
{
|
||||||
m_Data = new char[m_MaxPacketSize];
|
m_Data = new char[m_MaxPacketSize];
|
||||||
Init(type, packetID);
|
Init(type, packetID, 1, 1, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create message
|
// Create message
|
||||||
Packet::Packet(char* data, const size_t sizeOfPacket)
|
Packet::Packet(char* data, const size_t sizeOfPacket)
|
||||||
{
|
{
|
||||||
|
// Create message header
|
||||||
|
// allocate memory for size of packet, sequenceNumber and totalPacketesInSequence
|
||||||
|
m_ReturnDataOffset = 0;
|
||||||
|
m_Offset = 0;
|
||||||
// Resize message
|
// Resize message
|
||||||
m_MaxPacketSize = sizeOfPacket;
|
m_MaxPacketSize = sizeOfPacket;
|
||||||
// Copy data newly allocated memory
|
// Copy data newly allocated memory
|
||||||
m_Data = new char[sizeOfPacket];
|
m_Data = new char[sizeOfPacket];
|
||||||
|
unsigned int dummy = 0;
|
||||||
|
Init(MessageType::Invalid, dummy, 0, 0, 0);
|
||||||
memcpy(m_Data, data, sizeOfPacket);
|
memcpy(m_Data, data, sizeOfPacket);
|
||||||
m_Offset = sizeOfPacket;
|
m_Offset = sizeOfPacket;
|
||||||
}
|
}
|
||||||
@@ -21,7 +27,7 @@ Packet::Packet(MessageType type)
|
|||||||
{
|
{
|
||||||
m_Data = new char[m_MaxPacketSize];
|
m_Data = new char[m_MaxPacketSize];
|
||||||
unsigned int dummy = 0;
|
unsigned int dummy = 0;
|
||||||
Init(type, dummy);
|
Init(type, dummy, 1, 1, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
Packet::~Packet()
|
Packet::~Packet()
|
||||||
@@ -29,16 +35,30 @@ Packet::~Packet()
|
|||||||
delete[] m_Data;
|
delete[] m_Data;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Packet::Init(MessageType type, unsigned int & packetID)
|
void Packet::Init(MessageType type, unsigned int & packetID,
|
||||||
|
int groupIndex, int groupSize, int group)
|
||||||
{
|
{
|
||||||
m_ReturnDataOffset = 0;
|
m_ReturnDataOffset = 0;
|
||||||
m_Offset = 0;
|
m_Offset = 0;
|
||||||
// Create message header
|
// Create message header
|
||||||
// allocate memory for size of packet(only used in tcp)
|
// allocate memory for size of packet, sequenceNumber and totalPacketesInSequence
|
||||||
|
packetSizeOffset = m_Offset;
|
||||||
WritePrimitive<int>(0);
|
WritePrimitive<int>(0);
|
||||||
|
// packetGroup is the group the packet is in
|
||||||
|
groupOffset = m_Offset;
|
||||||
|
WritePrimitive<int>(group);
|
||||||
|
// What index the packet has in the packetGroup
|
||||||
|
groupIndexOffset = m_Offset;
|
||||||
|
WritePrimitive(groupIndex);
|
||||||
|
// The total amount of packets in a packetGroup
|
||||||
|
groupSizeOffset = m_Offset;
|
||||||
|
WritePrimitive(groupSize);
|
||||||
// Add message type
|
// Add message type
|
||||||
int messageType = static_cast<int>(type);
|
int messageType = static_cast<int>(type);
|
||||||
|
messageTypeOffset = m_Offset;
|
||||||
WritePrimitive<int>(messageType);
|
WritePrimitive<int>(messageType);
|
||||||
|
// Packet ID
|
||||||
|
packetIDOffset = m_Offset;
|
||||||
WritePrimitive<int>(packetID);
|
WritePrimitive<int>(packetID);
|
||||||
packetID++;
|
packetID++;
|
||||||
m_HeaderSize = m_Offset;
|
m_HeaderSize = m_Offset;
|
||||||
@@ -50,7 +70,7 @@ void Packet::WriteString(const std::string& str)
|
|||||||
size_t sizeOfString = str.size() + 1;
|
size_t sizeOfString = str.size() + 1;
|
||||||
if (m_Offset + sizeOfString > m_MaxPacketSize) {
|
if (m_Offset + sizeOfString > m_MaxPacketSize) {
|
||||||
if (m_MaxPacketSize >= 32000) {
|
if (m_MaxPacketSize >= 32000) {
|
||||||
LOG_WARNING("Package::WriteString(): New size is huge %i bytes\n", m_MaxPacketSize*2);
|
//LOG_WARNING("Package::WriteString(): New size is huge %i bytes\n", m_MaxPacketSize*2);
|
||||||
}
|
}
|
||||||
resizeData();
|
resizeData();
|
||||||
}
|
}
|
||||||
@@ -65,7 +85,7 @@ void Packet::WriteData(char * data, int sizeOfData)
|
|||||||
|
|
||||||
if (m_Offset + sizeOfData > m_MaxPacketSize) {
|
if (m_Offset + sizeOfData > m_MaxPacketSize) {
|
||||||
if (m_MaxPacketSize >= 32000) {
|
if (m_MaxPacketSize >= 32000) {
|
||||||
LOG_WARNING("Package::WriteData(): New size is huge %i bytes\n", m_MaxPacketSize*2);
|
//LOG_WARNING("Package::WriteData(): New size is huge %i bytes\n", m_MaxPacketSize*2);
|
||||||
}
|
}
|
||||||
while (m_Offset + sizeOfData > m_MaxPacketSize) {
|
while (m_Offset + sizeOfData > m_MaxPacketSize) {
|
||||||
resizeData();
|
resizeData();
|
||||||
@@ -104,8 +124,7 @@ void Packet::ReconstructFromData(char * data, size_t sizeOfData)
|
|||||||
|
|
||||||
void Packet::UpdateSize()
|
void Packet::UpdateSize()
|
||||||
{
|
{
|
||||||
int whatisoffset = m_Offset;
|
memcpy(m_Data + packetSizeOffset, &m_Offset, sizeof(int));
|
||||||
memcpy(m_Data, &m_Offset, sizeof(int));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
char * Packet::ReadData(int sizeOfData)
|
char * Packet::ReadData(int sizeOfData)
|
||||||
@@ -123,14 +142,47 @@ void Packet::ChangePacketID(unsigned int & packetID)
|
|||||||
{
|
{
|
||||||
packetID = packetID + 1;
|
packetID = packetID + 1;
|
||||||
// Overwrite old PacketID
|
// Overwrite old PacketID
|
||||||
memcpy(m_Data + 2*sizeof(int), &packetID, sizeof(int));
|
memcpy(m_Data + packetIDOffset, &packetID, sizeof(int));
|
||||||
|
}
|
||||||
|
|
||||||
|
void Packet::ChangeGroupIndex(int groupIndex)
|
||||||
|
{
|
||||||
|
memcpy(m_Data + groupIndexOffset, &groupIndex, sizeof(int));
|
||||||
|
}
|
||||||
|
|
||||||
|
void Packet::ChangeGroupSize(int groupSize)
|
||||||
|
{
|
||||||
|
memcpy(m_Data + groupSizeOffset, &groupSize, sizeof(int));
|
||||||
|
}
|
||||||
|
|
||||||
|
void Packet::ChangeGroup(int group)
|
||||||
|
{
|
||||||
|
memcpy(m_Data + groupOffset, &group, sizeof(int));
|
||||||
}
|
}
|
||||||
|
|
||||||
MessageType Packet::GetMessageType()
|
MessageType Packet::GetMessageType()
|
||||||
{
|
{
|
||||||
MessageType messagType;
|
return *reinterpret_cast<MessageType*>(m_Data + messageTypeOffset);
|
||||||
memcpy(&messagType, m_Data + sizeof(int), sizeof(int));
|
}
|
||||||
return messagType;
|
|
||||||
|
size_t Packet::Group()
|
||||||
|
{
|
||||||
|
return *reinterpret_cast<size_t*>(m_Data + groupOffset);
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t Packet::GroupIndex()
|
||||||
|
{
|
||||||
|
return *reinterpret_cast<size_t*>(m_Data + groupIndexOffset);
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t Packet::GroupSize()
|
||||||
|
{
|
||||||
|
return *reinterpret_cast<size_t*>(m_Data + groupSizeOffset);
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t Packet::PacketID()
|
||||||
|
{
|
||||||
|
return *reinterpret_cast<size_t*>(m_Data + packetIDOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Packet::resizeData()
|
void Packet::resizeData()
|
||||||
|
|||||||
@@ -49,19 +49,19 @@ void Server::Update()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//PlayerDefinition pd;
|
PlayerDefinition pd;
|
||||||
//while (m_Unreliable.IsSocketAvailable()) {
|
while (m_Unreliable.IsSocketAvailable()) {
|
||||||
// // Packet will get real data in receive
|
// Packet will get real data in receive
|
||||||
// Packet packet(MessageType::Invalid);
|
Packet packet(MessageType::Invalid);
|
||||||
// m_Unreliable.Receive(packet, pd);
|
m_Unreliable.Receive(packet, pd);
|
||||||
// m_Address = pd.Endpoint.address();
|
m_Address = pd.Endpoint.address();
|
||||||
// m_Port = pd.Endpoint.port();
|
m_Port = pd.Endpoint.port();
|
||||||
// if (packet.GetMessageType() == MessageType::Connect) {
|
if (packet.GetMessageType() == MessageType::Connect) {
|
||||||
// parseUDPConnect(packet);
|
parseUDPConnect(packet);
|
||||||
// } else {
|
} else {
|
||||||
// parseMessageType(packet);
|
parseMessageType(packet);
|
||||||
// }
|
}
|
||||||
//}
|
}
|
||||||
|
|
||||||
while (m_ServerlistRequest.IsSocketAvailable()) {
|
while (m_ServerlistRequest.IsSocketAvailable()) {
|
||||||
Packet packet(MessageType::Invalid);
|
Packet packet(MessageType::Invalid);
|
||||||
@@ -69,9 +69,11 @@ void Server::Update()
|
|||||||
localArea.Endpoint = boost::asio::ip::udp::endpoint();
|
localArea.Endpoint = boost::asio::ip::udp::endpoint();
|
||||||
m_ServerlistRequest.Receive(packet, localArea);
|
m_ServerlistRequest.Receive(packet, localArea);
|
||||||
if (packet.GetMessageType() == MessageType::ServerlistRequest) {
|
if (packet.GetMessageType() == MessageType::ServerlistRequest) {
|
||||||
packet.ReadPrimitive<int>(); // Pop size
|
// Pop header
|
||||||
packet.ReadPrimitive<int>(); // Pop MsgType
|
popNetworkSegmentOfHeader(packet);
|
||||||
packet.ReadPrimitive<int>(); // Pop packet ID
|
packet.ReadPrimitive<int>();
|
||||||
|
packet.ReadPrimitive<int>();
|
||||||
|
|
||||||
int port = packet.ReadPrimitive<int>();
|
int port = packet.ReadPrimitive<int>();
|
||||||
std::string address = localArea.Endpoint.address().to_string();
|
std::string address = localArea.Endpoint.address().to_string();
|
||||||
parseServerlistRequest(boost::asio::ip::udp::endpoint(boost::asio::ip::address().from_string(address), port));
|
parseServerlistRequest(boost::asio::ip::udp::endpoint(boost::asio::ip::address().from_string(address), port));
|
||||||
@@ -109,9 +111,9 @@ void Server::Update()
|
|||||||
|
|
||||||
void Server::parseMessageType(Packet& packet)
|
void Server::parseMessageType(Packet& packet)
|
||||||
{
|
{
|
||||||
// Pop packetSize which is used by TCP Client to
|
// Pop packetSize, sequenceNumber and packetsInSequence.
|
||||||
// create a packet of the correct size
|
// create a packet of the correct size
|
||||||
packet.ReadPrimitive<int>();
|
popNetworkSegmentOfHeader(packet);
|
||||||
|
|
||||||
int messageType = packet.ReadPrimitive<int>(); // Read what type off message was sent from server
|
int messageType = packet.ReadPrimitive<int>(); // Read what type off message was sent from server
|
||||||
// Read packet ID
|
// Read packet ID
|
||||||
@@ -162,10 +164,7 @@ void Server::reliableBroadcast(Packet& packet)
|
|||||||
|
|
||||||
void Server::unreliableBroadcast(Packet& packet)
|
void Server::unreliableBroadcast(Packet& packet)
|
||||||
{
|
{
|
||||||
for (auto& kv : m_ConnectedPlayers) {
|
m_Unreliable.SendToConnectedPlayers(packet, m_ConnectedPlayers);
|
||||||
packet.ChangePacketID(kv.second.PacketID);
|
|
||||||
// m_Unreliable.Send(packet, kv.second);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send snapshot fields
|
// Send snapshot fields
|
||||||
@@ -174,7 +173,8 @@ void Server::sendSnapshot()
|
|||||||
Packet packet(MessageType::Snapshot);
|
Packet packet(MessageType::Snapshot);
|
||||||
addInputCommandsToPacket(packet);
|
addInputCommandsToPacket(packet);
|
||||||
addPlayersToPacket(packet, EntityID_Invalid);
|
addPlayersToPacket(packet, EntityID_Invalid);
|
||||||
reliableBroadcast(packet);
|
//addChildrenToPacket(packet, EntityID_Invalid);
|
||||||
|
unreliableBroadcast(packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Server::addInputCommandsToPacket(Packet& packet)
|
void Server::addInputCommandsToPacket(Packet& packet)
|
||||||
@@ -299,8 +299,6 @@ void Server::sendPing()
|
|||||||
reliableBroadcast(packet);
|
reliableBroadcast(packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Server::checkForTimeOuts()
|
void Server::checkForTimeOuts()
|
||||||
{
|
{
|
||||||
double startPing = 1000 * m_StartPingTime
|
double startPing = 1000 * m_StartPingTime
|
||||||
@@ -317,38 +315,35 @@ void Server::checkForTimeOuts()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (size_t i = 0; i < playersToRemove.size(); i++) {
|
for (int i = playersToRemove.size() - 1; i >= 0; i--) {
|
||||||
disconnect(playersToRemove.at(i));
|
disconnect(playersToRemove.at(i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//void Server::parseUDPConnect(Packet & packet)
|
void Server::parseUDPConnect(Packet & packet)
|
||||||
//{
|
{
|
||||||
// // Pop size of message int
|
//Pop packetSize, sequenceNumber and packetsInSequence.
|
||||||
// packet.ReadPrimitive<int>();
|
popNetworkSegmentOfHeader(packet);
|
||||||
// int messageType = packet.ReadPrimitive<int>();
|
int messageType = packet.ReadPrimitive<int>();
|
||||||
// // Read packet ID
|
// Read packet ID
|
||||||
// m_PreviousPacketID = m_PacketID; // Set previous packet id
|
m_PreviousPacketID = m_PacketID; // Set previous packet id
|
||||||
// m_PacketID = packet.ReadPrimitive<int>(); //Read new packet id
|
m_PacketID = packet.ReadPrimitive<int>(); //Read new packet id
|
||||||
// // parse player id and other stuff
|
// parse player id and other stuff
|
||||||
// PlayerID playerID = packet.ReadPrimitive<int>();
|
PlayerID playerID = packet.ReadPrimitive<int>();
|
||||||
// if (!EntityWrapper(m_World, playerID).Valid()) {
|
boost::asio::ip::udp::endpoint endpoint(m_Address, m_Port);
|
||||||
//
|
m_ConnectedPlayers.at(playerID).Endpoint = endpoint;
|
||||||
// }
|
LOG_INFO("parseUDPConnect: Spectator \"%s\" connected on IP: %s", m_ConnectedPlayers.at(playerID).Name.c_str(), m_ConnectedPlayers.at(playerID).Endpoint.address().to_string().c_str());
|
||||||
// // Do something here?
|
// Send a message to the player that connected
|
||||||
// boost::asio::ip::udp::endpoint endpoint(m_Address, m_Port);
|
Packet connnectPacket(MessageType::Connect, m_ConnectedPlayers.at(playerID).PacketID);
|
||||||
// m_ConnectedPlayers.at(playerID).Endpoint = endpoint;
|
m_Unreliable.Send(connnectPacket);
|
||||||
// LOG_INFO("parseUDPConnect: Spectator \"%s\" connected on IP: %s", m_ConnectedPlayers.at(playerID).Name.c_str(), m_ConnectedPlayers.at(playerID).Endpoint.address().to_string().c_str());
|
LOG_INFO("UDP Connect sent to client");
|
||||||
// // Send a message to the player that connected
|
}
|
||||||
// Packet connnectPacket(MessageType::Connect, m_ConnectedPlayers.at(playerID).PacketID);
|
|
||||||
// m_Unreliable.Send(connnectPacket);
|
|
||||||
// LOG_INFO("UDP Connect sent to client");
|
|
||||||
//}
|
|
||||||
|
|
||||||
void Server::parseTCPConnect(Packet & packet)
|
void Server::parseTCPConnect(Packet & packet)
|
||||||
{
|
{
|
||||||
// Pop size of message int
|
// Pop packetSize, sequenceNumber and packetsInSequence.
|
||||||
packet.ReadPrimitive<int>();
|
popNetworkSegmentOfHeader(packet);
|
||||||
|
|
||||||
int messageType = packet.ReadPrimitive<int>();
|
int messageType = packet.ReadPrimitive<int>();
|
||||||
// Read packet ID
|
// Read packet ID
|
||||||
m_PreviousPacketID = m_PacketID; // Set previous packet id
|
m_PreviousPacketID = m_PacketID; // Set previous packet id
|
||||||
@@ -356,9 +351,9 @@ void Server::parseTCPConnect(Packet & packet)
|
|||||||
|
|
||||||
LOG_INFO("Parsing connections");
|
LOG_INFO("Parsing connections");
|
||||||
// Check if player is already connected
|
// Check if player is already connected
|
||||||
// Ska vara till lagd i TCPServer receive
|
|
||||||
PlayerID playerID = getPlayerIDFromEndpoint();
|
PlayerID playerID = getPlayerIDFromEndpoint();
|
||||||
if (playerID == -1) {
|
if (playerID == -1) {
|
||||||
|
LOG_INFO("Server::parseTCPConnect: Not connected");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Create a new player
|
// Create a new player
|
||||||
@@ -381,7 +376,7 @@ void Server::parseTCPConnect(Packet & packet)
|
|||||||
Packet connnectPacket(MessageType::Connect, m_ConnectedPlayers.at(playerID).PacketID);
|
Packet connnectPacket(MessageType::Connect, m_ConnectedPlayers.at(playerID).PacketID);
|
||||||
// Write playerID to packet
|
// Write playerID to packet
|
||||||
connnectPacket.WritePrimitive(playerID);
|
connnectPacket.WritePrimitive(playerID);
|
||||||
m_Reliable.Send(connnectPacket);
|
m_Reliable.Send(connnectPacket, m_ConnectedPlayers.at(playerID));
|
||||||
|
|
||||||
Packet firstSnapshot(MessageType::Snapshot);
|
Packet firstSnapshot(MessageType::Snapshot);
|
||||||
addInputCommandsToPacket(firstSnapshot);
|
addInputCommandsToPacket(firstSnapshot);
|
||||||
@@ -668,4 +663,4 @@ PlayerID Server::getPlayerIDFromEntityID(EntityID entityID)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -3,25 +3,14 @@
|
|||||||
using namespace boost::asio::ip;
|
using namespace boost::asio::ip;
|
||||||
|
|
||||||
TCPClient::TCPClient()
|
TCPClient::TCPClient()
|
||||||
{
|
{ }
|
||||||
}
|
|
||||||
|
|
||||||
TCPClient::~TCPClient()
|
TCPClient::~TCPClient()
|
||||||
{
|
{ }
|
||||||
}
|
|
||||||
|
|
||||||
bool TCPClient::Connect(std::string playerName, std::string address, int port)
|
bool TCPClient::Connect(std::string playerName, std::string address, int port)
|
||||||
{
|
{
|
||||||
if (m_Socket) {
|
if (!m_Socket) {
|
||||||
if (m_IsConnected) {
|
|
||||||
Packet packet(MessageType::Connect, m_SendPacketID);
|
|
||||||
packet.WriteString(playerName);
|
|
||||||
Send(packet);
|
|
||||||
LOG_INFO("Connect message sent again!");
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else if (!m_IsConnected) {
|
|
||||||
boost::system::error_code error = boost::asio::error::host_not_found;
|
boost::system::error_code error = boost::asio::error::host_not_found;
|
||||||
m_Endpoint = tcp::endpoint(boost::asio::ip::address::from_string(address), port);
|
m_Endpoint = tcp::endpoint(boost::asio::ip::address::from_string(address), port);
|
||||||
m_Socket = std::unique_ptr<tcp::socket>(new tcp::socket(m_IOService));
|
m_Socket = std::unique_ptr<tcp::socket>(new tcp::socket(m_IOService));
|
||||||
@@ -36,9 +25,7 @@ bool TCPClient::Connect(std::string playerName, std::string address, int port)
|
|||||||
Send(packet);
|
Send(packet);
|
||||||
LOG_INFO("Connect message sent!");
|
LOG_INFO("Connect message sent!");
|
||||||
return true;
|
return true;
|
||||||
}
|
} else { // If error
|
||||||
// If error
|
|
||||||
else {
|
|
||||||
m_Socket->close();
|
m_Socket->close();
|
||||||
m_Socket = nullptr;
|
m_Socket = nullptr;
|
||||||
return false;
|
return false;
|
||||||
@@ -47,14 +34,10 @@ bool TCPClient::Connect(std::string playerName, std::string address, int port)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void TCPClient::Disconnect()
|
void TCPClient::Disconnect()
|
||||||
{
|
{
|
||||||
if (!m_IsConnected) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
m_Socket->shutdown(boost::asio::ip::tcp::socket::shutdown_both);
|
m_Socket->shutdown(boost::asio::ip::tcp::socket::shutdown_both);
|
||||||
m_Socket->close();
|
m_Socket->close();
|
||||||
m_Socket = nullptr;
|
m_Socket = nullptr;
|
||||||
m_IsConnected = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TCPClient::Receive(Packet& packet)
|
void TCPClient::Receive(Packet& packet)
|
||||||
@@ -66,7 +49,7 @@ void TCPClient::Receive(Packet& packet)
|
|||||||
}
|
}
|
||||||
|
|
||||||
size_t TCPClient::readBuffer()
|
size_t TCPClient::readBuffer()
|
||||||
{
|
{
|
||||||
if (!m_Socket) {
|
if (!m_Socket) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -92,7 +75,7 @@ size_t TCPClient::readBuffer()
|
|||||||
while (sizeOfPacket > bytesReceived) {
|
while (sizeOfPacket > bytesReceived) {
|
||||||
// Read the rest of the message
|
// Read the rest of the message
|
||||||
bytesReceived += m_Socket->read_some(boost
|
bytesReceived += m_Socket->read_some(boost
|
||||||
::asio::buffer((void*)(m_ReadBuffer), sizeOfPacket - bytesReceived),
|
::asio::buffer((void*)(m_ReadBuffer + bytesReceived), sizeOfPacket - bytesReceived),
|
||||||
error);
|
error);
|
||||||
if (error) {
|
if (error) {
|
||||||
//LOG_ERROR("receive: %s", error.message().c_str());
|
//LOG_ERROR("receive: %s", error.message().c_str());
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ void TCPServer::Send(Packet & packet, PlayerDefinition & playerDefinition)
|
|||||||
{
|
{
|
||||||
packet.UpdateSize();
|
packet.UpdateSize();
|
||||||
try {
|
try {
|
||||||
|
// Crashed once TCPSocket was NULL
|
||||||
int bytesSent = playerDefinition.TCPSocket->send(
|
int bytesSent = playerDefinition.TCPSocket->send(
|
||||||
boost::asio::buffer(packet.Data(), packet.Size()),
|
boost::asio::buffer(packet.Data(), packet.Size()),
|
||||||
0);
|
0);
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
#include "Network/UDPClient.h"
|
#include "Network/UDPClient.h"
|
||||||
|
#include "boost/asio/basic_datagram_socket.hpp"
|
||||||
|
|
||||||
using namespace boost::asio::ip;
|
using namespace boost::asio::ip;
|
||||||
|
|
||||||
UDPClient::UDPClient()
|
UDPClient::UDPClient()
|
||||||
{
|
{ }
|
||||||
}
|
|
||||||
|
|
||||||
UDPClient::~UDPClient()
|
UDPClient::~UDPClient()
|
||||||
{
|
{ }
|
||||||
}
|
|
||||||
|
|
||||||
bool UDPClient::Connect(std::string playerName, std::string address, int port)
|
bool UDPClient::Connect(std::string playerName, std::string address, int port)
|
||||||
{
|
{
|
||||||
@@ -18,22 +17,35 @@ bool UDPClient::Connect(std::string playerName, std::string address, int port)
|
|||||||
m_ReceiverEndpoint = udp::endpoint(boost::asio::ip::address().from_string(address), port);
|
m_ReceiverEndpoint = udp::endpoint(boost::asio::ip::address().from_string(address), port);
|
||||||
m_Socket = boost::shared_ptr<boost::asio::ip::udp::socket>(new boost::asio::ip::udp::socket(m_IOService));
|
m_Socket = boost::shared_ptr<boost::asio::ip::udp::socket>(new boost::asio::ip::udp::socket(m_IOService));
|
||||||
m_Socket->open(boost::asio::ip::udp::v4());
|
m_Socket->open(boost::asio::ip::udp::v4());
|
||||||
|
boost::asio::socket_base::receive_buffer_size option(m_SizeOfSocketBuffer);
|
||||||
|
m_Socket->set_option(option);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void UDPClient::Disconnect()
|
void UDPClient::Disconnect()
|
||||||
{
|
{
|
||||||
|
m_Socket->shutdown(boost::asio::ip::tcp::socket::shutdown_both);
|
||||||
|
m_Socket->close();
|
||||||
|
m_Socket = nullptr;
|
||||||
|
|
||||||
|
m_LastReceivedSnapshotGroup = 0;
|
||||||
|
m_PacketSegmentMap.clear();
|
||||||
|
PacketID m_SendPacketID = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void UDPClient::Receive(Packet& packet)
|
void UDPClient::Receive(Packet& packet)
|
||||||
{
|
{
|
||||||
int bytesRead = readBuffer();
|
int bytesRead = readBuffer();
|
||||||
if (bytesRead > 0) {
|
if (bytesRead > 0) {
|
||||||
packet.ReconstructFromData(m_ReadBuffer, bytesRead);
|
packet.ReconstructFromData(m_ReadBuffer, bytesRead);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void UDPClient::ReceivePackets()
|
||||||
|
{
|
||||||
|
readPartOfPacket();
|
||||||
|
}
|
||||||
|
|
||||||
int UDPClient::readBuffer()
|
int UDPClient::readBuffer()
|
||||||
{
|
{
|
||||||
if (!m_Socket) {
|
if (!m_Socket) {
|
||||||
@@ -41,9 +53,9 @@ int UDPClient::readBuffer()
|
|||||||
}
|
}
|
||||||
boost::system::error_code error;
|
boost::system::error_code error;
|
||||||
// Read size of packet
|
// Read size of packet
|
||||||
m_Socket->receive(boost
|
m_Socket->receive(boost
|
||||||
::asio::buffer((void*)m_ReadBuffer, sizeof(int)),
|
::asio::buffer((void*)m_ReadBuffer, sizeof(int)),
|
||||||
boost::asio::ip::udp::socket::message_peek, error);
|
boost::asio::ip::udp::socket::message_peek, error);
|
||||||
int sizeOfPacket = 0;
|
int sizeOfPacket = 0;
|
||||||
memcpy(&sizeOfPacket, m_ReadBuffer, sizeof(int));
|
memcpy(&sizeOfPacket, m_ReadBuffer, sizeof(int));
|
||||||
if (sizeOfPacket > m_Socket->available()) {
|
if (sizeOfPacket > m_Socket->available()) {
|
||||||
@@ -72,6 +84,72 @@ int UDPClient::readBuffer()
|
|||||||
return bytesReceived;
|
return bytesReceived;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void UDPClient::readPartOfPacket()
|
||||||
|
{
|
||||||
|
if (!m_Socket) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
boost::system::error_code error;
|
||||||
|
// Peek header
|
||||||
|
m_Socket->receive(boost
|
||||||
|
::asio::buffer((void*)m_ReadBuffer, 5 * sizeof(int)),
|
||||||
|
boost::asio::ip::udp::socket::message_peek, error);
|
||||||
|
|
||||||
|
int sizeOfPacket = 0;
|
||||||
|
memcpy(&sizeOfPacket, m_ReadBuffer, sizeof(int));
|
||||||
|
if (sizeOfPacket == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
int packetGroup = *reinterpret_cast<int*>(m_ReadBuffer + sizeof(int));
|
||||||
|
int packetGroupIndex = *reinterpret_cast<int*>(m_ReadBuffer + 2 * sizeof(int));
|
||||||
|
int packetGroupSize = *reinterpret_cast<int*>(m_ReadBuffer + 3 * sizeof(int));
|
||||||
|
//LOG_INFO("Packet group: %i. Group index: %i. Group size: %i. Packet size: %i.", packetGroup, packetGroupIndex, packetGroupSize, sizeOfPacket);
|
||||||
|
if (sizeOfPacket > m_Socket->available()) {
|
||||||
|
LOG_WARNING("UDPClient::readBuffer(): We haven't got the whole packet yet.");
|
||||||
|
// return;
|
||||||
|
}
|
||||||
|
// if the buffer is to small increase the size of it
|
||||||
|
boost::shared_ptr<char> packetData(new char[sizeOfPacket]);
|
||||||
|
|
||||||
|
// Read the message
|
||||||
|
size_t bytesReceived = m_Socket->receive_from(boost
|
||||||
|
::asio::buffer((void*)(packetData.get()),
|
||||||
|
sizeOfPacket),
|
||||||
|
m_ReceiverEndpoint, 0, error);
|
||||||
|
if (error) {
|
||||||
|
LOG_ERROR("UDPClient::readPartOfPacket: %s", error.message().c_str());
|
||||||
|
}
|
||||||
|
// Might want to do this earlier when i figure out a good way to
|
||||||
|
// remove data from network buffer.
|
||||||
|
if (hasReceivedPacket(packetGroup, packetGroupIndex)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// If group exists
|
||||||
|
PacketMap::iterator it;
|
||||||
|
it = m_PacketSegmentMap.find(packetGroup);
|
||||||
|
if (it != m_PacketSegmentMap.end()) {
|
||||||
|
it->second.push_back(std::make_pair(packetGroupIndex, std::move(packetData)));
|
||||||
|
} else { // Create group and add element
|
||||||
|
m_PacketSegmentMap[packetGroup].push_back(std::make_pair(packetGroupIndex, std::move(packetData)));
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool UDPClient::hasReceivedPacket(int packetGroup, int groupIndex)
|
||||||
|
{
|
||||||
|
PacketMap::iterator it;
|
||||||
|
it = m_PacketSegmentMap.find(packetGroup);
|
||||||
|
if (it != m_PacketSegmentMap.end()) {
|
||||||
|
const std::vector<std::pair<int, boost::shared_ptr<char>>>& loopPacketGroup = it->second;
|
||||||
|
for (size_t i = 0; i < loopPacketGroup.size(); i++) {
|
||||||
|
if (loopPacketGroup.at(i).first == groupIndex) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
void UDPClient::Send(Packet& packet)
|
void UDPClient::Send(Packet& packet)
|
||||||
{
|
{
|
||||||
packet.UpdateSize();
|
packet.UpdateSize();
|
||||||
@@ -79,7 +157,7 @@ void UDPClient::Send(Packet& packet)
|
|||||||
packet.Data(),
|
packet.Data(),
|
||||||
packet.Size()),
|
packet.Size()),
|
||||||
m_ReceiverEndpoint, 0);
|
m_ReceiverEndpoint, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UDPClient::Broadcast(Packet& packet, int port)
|
void UDPClient::Broadcast(Packet& packet, int port)
|
||||||
{
|
{
|
||||||
@@ -95,8 +173,55 @@ void UDPClient::Broadcast(Packet& packet, int port)
|
|||||||
|
|
||||||
bool UDPClient::IsSocketAvailable()
|
bool UDPClient::IsSocketAvailable()
|
||||||
{
|
{
|
||||||
if (!m_Socket) {
|
if (!m_Socket) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return m_Socket->available();
|
return m_Socket->available();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool UDPClient::GetNextPacket(Packet & packet)
|
||||||
|
{
|
||||||
|
// A duplicate packet should not be present in the vector!
|
||||||
|
// Soo we will assume that this is true and only look if size
|
||||||
|
// of vector is correct.
|
||||||
|
PacketMap::iterator it = m_PacketSegmentMap.begin();
|
||||||
|
while (it != m_PacketSegmentMap.end()) {
|
||||||
|
// pair(Group index, packetData)
|
||||||
|
std::vector<std::pair<int, boost::shared_ptr<char>>>& currentVector = it->second;
|
||||||
|
Packet headerInfoPacket(currentVector.at(0).second.get(), packet.HeaderSize());
|
||||||
|
int groupSize = headerInfoPacket.GroupSize();
|
||||||
|
//LOG_INFO("UDPClient::GetNextPacket: Packet group : %i.Group index : %i.Group size : %i. lastReceivedSnapshotGroup: %i. MessageType(Ples 4): %i", headerInfoPacket.Group(), headerInfoPacket.GroupIndex(), groupSize, lastReceivedSnapshotGroup, headerInfoPacket.GetMessageType());
|
||||||
|
//LOG_INFO("UDPClient::GetNextPacket: Packet group : %i.lastReceivedSnapshotGroup: %i. MessageType(Ples 4): %i", headerInfoPacket.Group(), lastReceivedSnapshotGroup, headerInfoPacket.GetMessageType());
|
||||||
|
int mapSize = m_PacketSegmentMap.size();
|
||||||
|
if (mapSize > 5) {
|
||||||
|
it = m_PacketSegmentMap.erase(it);
|
||||||
|
LOG_INFO("The map is increasing in size, size is %i", mapSize);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (headerInfoPacket.GetMessageType() == MessageType::Snapshot && m_LastReceivedSnapshotGroup > headerInfoPacket.Group()) {
|
||||||
|
it = m_PacketSegmentMap.erase(it);
|
||||||
|
continue;
|
||||||
|
//LOG_INFO("Deleted old entry");
|
||||||
|
}
|
||||||
|
if (currentVector.size() == groupSize) {
|
||||||
|
std::sort(currentVector.begin(), currentVector.end());
|
||||||
|
// Add the first packet in vector
|
||||||
|
packet.ReconstructFromData(currentVector.at(0).second.get(), packet.HeaderSize());
|
||||||
|
// Add the rest of the packets.
|
||||||
|
int sizeOfData = 0;
|
||||||
|
for (auto& packetSegment : currentVector) {
|
||||||
|
memcpy(&sizeOfData, packetSegment.second.get(), sizeof(int));
|
||||||
|
packet.WriteData(packetSegment.second.get() + packet.HeaderSize(), sizeOfData - packet.HeaderSize());
|
||||||
|
}
|
||||||
|
if (headerInfoPacket.GetMessageType() == MessageType::Snapshot) {
|
||||||
|
m_LastReceivedSnapshotGroup = packet.Group();
|
||||||
|
}
|
||||||
|
// No need to get next it as we are returning.
|
||||||
|
m_PacketSegmentMap.erase(it);
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
++it;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|||||||
@@ -12,34 +12,110 @@ UDPServer::UDPServer(int port)
|
|||||||
|
|
||||||
UDPServer::~UDPServer()
|
UDPServer::~UDPServer()
|
||||||
{ }
|
{ }
|
||||||
|
// TODO: Fix correct groups
|
||||||
void UDPServer::Send(Packet& packet, PlayerDefinition & playerDefinition)
|
void UDPServer::Send(Packet& packet, PlayerDefinition& playerDefinition)
|
||||||
{
|
{
|
||||||
packet.UpdateSize();
|
packet.UpdateSize();
|
||||||
try {
|
try {
|
||||||
int bytesSent = m_Socket->send_to(
|
// Remove header from packet.
|
||||||
boost::asio::buffer(packet.Data(), packet.Size()),
|
packet.ReadData(packet.HeaderSize());
|
||||||
playerDefinition.Endpoint,
|
int totalBytesSent = 0;
|
||||||
0);
|
int groupIndex = 1;
|
||||||
LOG_INFO("Size of packet is %i", bytesSent);
|
int groupSize = std::ceil((float)packet.Size() / MAXPACKETSIZE);
|
||||||
|
int packetDataSent = 0;
|
||||||
|
int packetDataSize = packet.Size() - packet.HeaderSize();
|
||||||
|
|
||||||
|
while (packetDataSize > packetDataSent) {
|
||||||
|
Packet splitPacket(packet.GetMessageType(), playerDefinition.PacketID);
|
||||||
|
splitPacket.ChangeGroupIndex(groupIndex);
|
||||||
|
splitPacket.ChangeGroupSize(groupSize);
|
||||||
|
splitPacket.ChangeGroup(playerDefinition.PacketGroup);
|
||||||
|
int amountToSend = packetDataSize - packetDataSent;
|
||||||
|
if (amountToSend > MAXPACKETSIZE) {
|
||||||
|
amountToSend = MAXPACKETSIZE;
|
||||||
|
}
|
||||||
|
splitPacket.WriteData(packet.ReadData(amountToSend), amountToSend);
|
||||||
|
splitPacket.UpdateSize();
|
||||||
|
// Remove header size from bytes sent soo that we only
|
||||||
|
// count data in the packet
|
||||||
|
int bytesSent = 0;
|
||||||
|
bytesSent = m_Socket->send_to(
|
||||||
|
boost::asio::buffer(splitPacket.Data(), splitPacket.Size()),
|
||||||
|
playerDefinition.Endpoint,
|
||||||
|
0);
|
||||||
|
packetDataSent += bytesSent - splitPacket.HeaderSize();
|
||||||
|
totalBytesSent += bytesSent;
|
||||||
|
//LOG_INFO("bytesSent size %i, groupIndex: %i. Number of packets: %i", bytesSent, sequenceNumber, totalMessages);
|
||||||
|
++groupIndex;
|
||||||
|
}
|
||||||
|
playerDefinition.PacketGroup++;
|
||||||
} catch (const boost::system::system_error& e) {
|
} catch (const boost::system::system_error& e) {
|
||||||
LOG_INFO(e.what());
|
LOG_INFO(e.what());
|
||||||
// TODO: Clean up invalid endpoints out of m_ConnectedPlayers later
|
// TODO: Clean up invalid endpoints out of m_ConnectedPlayers later
|
||||||
playerDefinition.Endpoint = boost::asio::ip::udp::endpoint();
|
playerDefinition.Endpoint = boost::asio::ip::udp::endpoint();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void UDPServer::SendToConnectedPlayers(Packet& packet, std::map<PlayerID, PlayerDefinition>& playersTosendTo)
|
||||||
|
{
|
||||||
|
packet.UpdateSize();
|
||||||
|
// Remove header from packet.
|
||||||
|
packet.ReadData(packet.HeaderSize());
|
||||||
|
int totalBytesSent = 0;
|
||||||
|
int groupIndex = 1;
|
||||||
|
int groupSize = std::ceil((float)packet.Size() / MAXPACKETSIZE);
|
||||||
|
int packetDataSent = 0;
|
||||||
|
int packetDataSize = packet.Size() - packet.HeaderSize();
|
||||||
|
|
||||||
|
while (packetDataSize > packetDataSent) {
|
||||||
|
Packet splitPacket(packet.GetMessageType());
|
||||||
|
splitPacket.ChangeGroupIndex(groupIndex);
|
||||||
|
splitPacket.ChangeGroupSize(groupSize);
|
||||||
|
int amountToSend = packetDataSize - packetDataSent;
|
||||||
|
if (amountToSend > MAXPACKETSIZE) {
|
||||||
|
amountToSend = MAXPACKETSIZE;
|
||||||
|
}
|
||||||
|
splitPacket.WriteData(packet.ReadData(amountToSend), amountToSend);
|
||||||
|
splitPacket.UpdateSize();
|
||||||
|
// Remove header size from bytes sent soo that we only
|
||||||
|
// count data in the packet
|
||||||
|
int bytesSent = 0;
|
||||||
|
for (auto& kv : playersTosendTo) {
|
||||||
|
try {
|
||||||
|
splitPacket.ChangeGroup(kv.second.PacketGroup);
|
||||||
|
bytesSent = m_Socket->send_to(
|
||||||
|
boost::asio::buffer(splitPacket.Data(), splitPacket.Size()),
|
||||||
|
kv.second.Endpoint,
|
||||||
|
0);
|
||||||
|
// LOG_INFO("bytesSent: %i", bytesSent);
|
||||||
|
} catch (const boost::system::system_error& e) {
|
||||||
|
LOG_INFO("UDPServer::SendToConnectedPlayers: Disconnected client. %s", e.what());
|
||||||
|
// TODO: Clean up invalid endpoints out of m_ConnectedPlayers later
|
||||||
|
kv.second.Endpoint = boost::asio::ip::udp::endpoint();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
packetDataSent += splitPacket.Size() - splitPacket.HeaderSize();
|
||||||
|
totalBytesSent += splitPacket.Size();
|
||||||
|
|
||||||
|
//LOG_INFO("bytesSent size %i, groupIndex: %i. Number of packets: %i", bytesSent, sequenceNumber, totalMessages);
|
||||||
|
++groupIndex;
|
||||||
|
}
|
||||||
|
for (auto& kv : playersTosendTo) {
|
||||||
|
kv.second.PacketGroup++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Send back to endpoint of received packet
|
// Send back to endpoint of received packet
|
||||||
void UDPServer::Send(Packet & packet)
|
void UDPServer::Send(Packet & packet)
|
||||||
{
|
{
|
||||||
packet.UpdateSize();
|
packet.UpdateSize();
|
||||||
size_t bytesSent = m_Socket->send_to(
|
size_t bytesSent = m_Socket->send_to(
|
||||||
boost::asio::buffer(
|
boost::asio::buffer(
|
||||||
packet.Data(),
|
packet.Data(),
|
||||||
packet.Size()),
|
packet.Size()),
|
||||||
m_ReceiverEndpoint,
|
m_ReceiverEndpoint,
|
||||||
0);
|
0);
|
||||||
LOG_INFO("Size of packet is %i", bytesSent);
|
//LOG_INFO("Size of packet is %i", bytesSent);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Broadcasting respond specific logic
|
// Broadcasting respond specific logic
|
||||||
@@ -52,7 +128,7 @@ void UDPServer::Send(Packet & packet, boost::asio::ip::udp::endpoint endpoint)
|
|||||||
packet.Size()),
|
packet.Size()),
|
||||||
endpoint,
|
endpoint,
|
||||||
0);
|
0);
|
||||||
LOG_INFO("Size of packet is %i", bytesSent);
|
//LOG_INFO("Size of packet is %i", bytesSent);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Broadcasting
|
// Broadcasting
|
||||||
@@ -64,7 +140,7 @@ void UDPServer::Broadcast(Packet & packet, int port)
|
|||||||
boost::asio::buffer(
|
boost::asio::buffer(
|
||||||
packet.Data(),
|
packet.Data(),
|
||||||
packet.Size()),
|
packet.Size()),
|
||||||
boost::asio::ip::udp::endpoint(boost::asio::ip::address_v4().broadcast(),port),
|
boost::asio::ip::udp::endpoint(boost::asio::ip::address_v4().broadcast(), port),
|
||||||
0);
|
0);
|
||||||
m_Socket->set_option(boost::asio::socket_base::broadcast(false));
|
m_Socket->set_option(boost::asio::socket_base::broadcast(false));
|
||||||
}
|
}
|
||||||
@@ -91,7 +167,7 @@ int UDPServer::readBuffer()
|
|||||||
int addasdasd = m_Socket->available();
|
int addasdasd = m_Socket->available();
|
||||||
boost::system::error_code error;
|
boost::system::error_code error;
|
||||||
// Read size of packet
|
// Read size of packet
|
||||||
m_Socket->receive_from(boost
|
m_Socket->receive_from(boost
|
||||||
::asio::buffer((void*)m_ReadBuffer, sizeof(int)),
|
::asio::buffer((void*)m_ReadBuffer, sizeof(int)),
|
||||||
m_ReceiverEndpoint, boost::asio::ip::udp::socket::message_peek, error);
|
m_ReceiverEndpoint, boost::asio::ip::udp::socket::message_peek, error);
|
||||||
unsigned int sizeOfPacket = 0;
|
unsigned int sizeOfPacket = 0;
|
||||||
@@ -114,13 +190,13 @@ int UDPServer::readBuffer()
|
|||||||
::asio::buffer((void*)(m_ReadBuffer),
|
::asio::buffer((void*)(m_ReadBuffer),
|
||||||
sizeOfPacket),
|
sizeOfPacket),
|
||||||
m_ReceiverEndpoint, 0, error);
|
m_ReceiverEndpoint, 0, error);
|
||||||
if (error) {
|
if (error) {
|
||||||
//LOG_ERROR("receive: %s", error.message().c_str());
|
//LOG_ERROR("receive: %s", error.message().c_str());
|
||||||
}
|
}
|
||||||
if (sizeOfPacket > 1000000)
|
if (sizeOfPacket > 1000000)
|
||||||
LOG_WARNING("The packets received are bigger than 1MB");
|
LOG_WARNING("The packets received are bigger than 1MB");
|
||||||
|
|
||||||
return bytesReceived;
|
return bytesReceived;
|
||||||
}
|
}
|
||||||
|
|
||||||
void UDPServer::AcceptNewConnections(int& nextPlayerID, std::map<PlayerID, PlayerDefinition>& connectedPlayers)
|
void UDPServer::AcceptNewConnections(int& nextPlayerID, std::map<PlayerID, PlayerDefinition>& connectedPlayers)
|
||||||
|
|||||||
@@ -142,9 +142,15 @@ GLuint BlurHUD::Draw(GLuint texture, RenderScene& scene)
|
|||||||
glViewport(0, 0, m_Renderer->GetViewportSize().Width/m_BlurQuality, m_Renderer->GetViewportSize().Height/m_BlurQuality);
|
glViewport(0, 0, m_Renderer->GetViewportSize().Width/m_BlurQuality, m_Renderer->GetViewportSize().Height/m_BlurQuality);
|
||||||
glScissor(0, 0, m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height);
|
glScissor(0, 0, m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height);
|
||||||
|
|
||||||
|
m_GaussianProgram_vert->Bind();
|
||||||
|
glUniform1i(glGetUniformLocation(shaderHandle_vert, "Lod"), 0);
|
||||||
m_GaussianProgram_horiz->Bind();
|
m_GaussianProgram_horiz->Bind();
|
||||||
|
glUniform1i(glGetUniformLocation(shaderHandle_horiz, "Lod"), 0);
|
||||||
|
|
||||||
|
|
||||||
glActiveTexture(GL_TEXTURE0);
|
glActiveTexture(GL_TEXTURE0);
|
||||||
glBindTexture(GL_TEXTURE_2D, texture);
|
glBindTexture(GL_TEXTURE_2D, texture);
|
||||||
|
|
||||||
glBindVertexArray(m_ScreenQuad->VAO);
|
glBindVertexArray(m_ScreenQuad->VAO);
|
||||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_ScreenQuad->ElementBuffer);
|
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_ScreenQuad->ElementBuffer);
|
||||||
glDrawElementsBaseVertex(GL_TRIANGLES, m_ScreenQuad->MaterialGroups()[0].material->EndIndex - m_ScreenQuad->MaterialGroups()[0].material->StartIndex +1
|
glDrawElementsBaseVertex(GL_TRIANGLES, m_ScreenQuad->MaterialGroups()[0].material->EndIndex - m_ScreenQuad->MaterialGroups()[0].material->StartIndex +1
|
||||||
@@ -158,8 +164,6 @@ GLuint BlurHUD::Draw(GLuint texture, RenderScene& scene)
|
|||||||
glActiveTexture(GL_TEXTURE0);
|
glActiveTexture(GL_TEXTURE0);
|
||||||
glBindTexture(GL_TEXTURE_2D, m_GaussianTexture_horiz);
|
glBindTexture(GL_TEXTURE_2D, m_GaussianTexture_horiz);
|
||||||
|
|
||||||
glBindVertexArray(m_ScreenQuad->VAO);
|
|
||||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_ScreenQuad->ElementBuffer);
|
|
||||||
glDrawElementsBaseVertex(GL_TRIANGLES, m_ScreenQuad->MaterialGroups()[0].material->EndIndex - m_ScreenQuad->MaterialGroups()[0].material->StartIndex +1
|
glDrawElementsBaseVertex(GL_TRIANGLES, m_ScreenQuad->MaterialGroups()[0].material->EndIndex - m_ScreenQuad->MaterialGroups()[0].material->StartIndex +1
|
||||||
, GL_UNSIGNED_INT, 0, m_ScreenQuad->MaterialGroups()[0].material->StartIndex);
|
, GL_UNSIGNED_INT, 0, m_ScreenQuad->MaterialGroups()[0].material->StartIndex);
|
||||||
//horizontal pass
|
//horizontal pass
|
||||||
@@ -170,8 +174,6 @@ GLuint BlurHUD::Draw(GLuint texture, RenderScene& scene)
|
|||||||
glActiveTexture(GL_TEXTURE0);
|
glActiveTexture(GL_TEXTURE0);
|
||||||
glBindTexture(GL_TEXTURE_2D, m_GaussianTexture_vert);
|
glBindTexture(GL_TEXTURE_2D, m_GaussianTexture_vert);
|
||||||
|
|
||||||
glBindVertexArray(m_ScreenQuad->VAO);
|
|
||||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_ScreenQuad->ElementBuffer);
|
|
||||||
glDrawElementsBaseVertex(GL_TRIANGLES, m_ScreenQuad->MaterialGroups()[0].material->EndIndex - m_ScreenQuad->MaterialGroups()[0].material->StartIndex +1
|
glDrawElementsBaseVertex(GL_TRIANGLES, m_ScreenQuad->MaterialGroups()[0].material->EndIndex - m_ScreenQuad->MaterialGroups()[0].material->StartIndex +1
|
||||||
, GL_UNSIGNED_INT, 0, m_ScreenQuad->MaterialGroups()[0].material->StartIndex);
|
, GL_UNSIGNED_INT, 0, m_ScreenQuad->MaterialGroups()[0].material->StartIndex);
|
||||||
m_GaussianFrameBuffer_horiz.Unbind();
|
m_GaussianFrameBuffer_horiz.Unbind();
|
||||||
@@ -184,8 +186,7 @@ GLuint BlurHUD::Draw(GLuint texture, RenderScene& scene)
|
|||||||
|
|
||||||
glActiveTexture(GL_TEXTURE0);
|
glActiveTexture(GL_TEXTURE0);
|
||||||
glBindTexture(GL_TEXTURE_2D, m_GaussianTexture_horiz);
|
glBindTexture(GL_TEXTURE_2D, m_GaussianTexture_horiz);
|
||||||
glBindVertexArray(m_ScreenQuad->VAO);
|
|
||||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_ScreenQuad->ElementBuffer);
|
|
||||||
glDrawElementsBaseVertex(GL_TRIANGLES, m_ScreenQuad->MaterialGroups()[0].material->EndIndex - m_ScreenQuad->MaterialGroups()[0].material->StartIndex +1
|
glDrawElementsBaseVertex(GL_TRIANGLES, m_ScreenQuad->MaterialGroups()[0].material->EndIndex - m_ScreenQuad->MaterialGroups()[0].material->StartIndex +1
|
||||||
, GL_UNSIGNED_INT, 0, m_ScreenQuad->MaterialGroups()[0].material->StartIndex);
|
, GL_UNSIGNED_INT, 0, m_ScreenQuad->MaterialGroups()[0].material->StartIndex);
|
||||||
|
|
||||||
@@ -200,10 +201,7 @@ GLuint BlurHUD::Draw(GLuint texture, RenderScene& scene)
|
|||||||
|
|
||||||
void BlurHUD::OnWindowResize()
|
void BlurHUD::OnWindowResize()
|
||||||
{
|
{
|
||||||
CommonFunctions::GenerateTexture(&m_GaussianTexture_vert, GL_CLAMP_TO_EDGE, GL_LINEAR, glm::vec2(m_Renderer->GetViewportSize().Width/m_BlurQuality, m_Renderer->GetViewportSize().Height/m_BlurQuality), GL_RGB16F, GL_RGB, GL_FLOAT);
|
InitializeBuffers();
|
||||||
m_GaussianFrameBuffer_vert.Generate();
|
|
||||||
CommonFunctions::GenerateTexture(&m_GaussianTexture_horiz, GL_CLAMP_TO_EDGE, GL_LINEAR, glm::vec2(m_Renderer->GetViewportSize().Width/m_BlurQuality, m_Renderer->GetViewportSize().Height/m_BlurQuality), GL_RGB16F, GL_RGB, GL_FLOAT);
|
|
||||||
m_GaussianFrameBuffer_horiz.Generate();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BlurHUD::FillStencil(RenderScene& scene)
|
void BlurHUD::FillStencil(RenderScene& scene)
|
||||||
@@ -226,9 +224,7 @@ void BlurHUD::FillStencil(RenderScene& scene)
|
|||||||
m_FillDepthStencilProgram->Bind();
|
m_FillDepthStencilProgram->Bind();
|
||||||
|
|
||||||
GLuint shaderHandle = m_FillDepthStencilProgram->GetHandle();
|
GLuint shaderHandle = m_FillDepthStencilProgram->GetHandle();
|
||||||
|
glm::mat4 VP = scene.Camera->ProjectionMatrix() * scene.Camera->ViewMatrix();
|
||||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "V"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ViewMatrix()));
|
|
||||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "P"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix()));
|
|
||||||
|
|
||||||
for (auto& job : scene.Jobs.SpriteJob) {
|
for (auto& job : scene.Jobs.SpriteJob) {
|
||||||
auto spriteJob = std::dynamic_pointer_cast<SpriteJob>(job);
|
auto spriteJob = std::dynamic_pointer_cast<SpriteJob>(job);
|
||||||
@@ -238,7 +234,10 @@ void BlurHUD::FillStencil(RenderScene& scene)
|
|||||||
if (!spriteJob->BlurBackground) {
|
if (!spriteJob->BlurBackground) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "M"), 1, GL_FALSE, glm::value_ptr(spriteJob->Matrix));
|
|
||||||
|
glm::mat4 MVP = VP * spriteJob->Matrix;
|
||||||
|
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "PVM"), 1, GL_FALSE, glm::value_ptr(MVP));
|
||||||
|
|
||||||
|
|
||||||
glBindVertexArray(spriteJob->Model->VAO);
|
glBindVertexArray(spriteJob->Model->VAO);
|
||||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, spriteJob->Model->ElementBuffer);
|
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, spriteJob->Model->ElementBuffer);
|
||||||
@@ -254,7 +253,8 @@ void BlurHUD::FillStencil(RenderScene& scene)
|
|||||||
if(!spriteJob->BlurBackground) {
|
if(!spriteJob->BlurBackground) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "M"), 1, GL_FALSE, glm::value_ptr(spriteJob->Matrix));
|
glm::mat4 MVP = VP * spriteJob->Matrix;
|
||||||
|
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "PVM"), 1, GL_FALSE, glm::value_ptr(MVP));
|
||||||
|
|
||||||
glBindVertexArray(spriteJob->Model->VAO);
|
glBindVertexArray(spriteJob->Model->VAO);
|
||||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, spriteJob->Model->ElementBuffer);
|
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, spriteJob->Model->ElementBuffer);
|
||||||
|
|||||||
@@ -151,18 +151,7 @@ void DrawBloomPass::OnWindowResize()
|
|||||||
if (m_Quality == 0) {
|
if (m_Quality == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
CommonFunctions::GenerateMipMapTexture(
|
InitializeBuffers();
|
||||||
&m_GaussianTexture_vert, GL_CLAMP_TO_BORDER, glm::vec2(m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height)
|
|
||||||
, GL_RGB, GL_FLOAT, m_BloomLod);
|
|
||||||
CommonFunctions::GenerateMipMapTexture(
|
|
||||||
&m_GaussianTexture_horiz, GL_CLAMP_TO_BORDER, glm::vec2(m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height)
|
|
||||||
, GL_RGB, GL_FLOAT, m_BloomLod);
|
|
||||||
for (int i = 0; i < m_BloomLod; i++) {
|
|
||||||
m_GaussianFrameBuffer_vert[i].Generate();
|
|
||||||
m_GaussianFrameBuffer_horiz[i].Generate();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawBloomPass::GaussianLodPass(GLuint mipMap, GLuint texture)
|
void DrawBloomPass::GaussianLodPass(GLuint mipMap, GLuint texture)
|
||||||
|
|||||||
@@ -242,7 +242,7 @@ void DrawFinalPass::InitializeShaderPrograms()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawFinalPass::Draw(RenderScene& scene, BlurHUD* blurHUDPass, TextPass* textPass)
|
void DrawFinalPass::Draw(RenderScene& scene, BlurHUD* blurHUDPass)
|
||||||
{
|
{
|
||||||
GLERROR("Pre");
|
GLERROR("Pre");
|
||||||
DrawFinalPassState* stateDethp = new DrawFinalPassState(m_ShieldDepthFrameBuffer.GetHandle());
|
DrawFinalPassState* stateDethp = new DrawFinalPassState(m_ShieldDepthFrameBuffer.GetHandle());
|
||||||
@@ -282,36 +282,10 @@ void DrawFinalPass::Draw(RenderScene& scene, BlurHUD* blurHUDPass, TextPass* tex
|
|||||||
//state->StencilMask(0x00);
|
//state->StencilMask(0x00);
|
||||||
DrawModelRenderQueues(scene.Jobs.OpaqueObjects, scene);
|
DrawModelRenderQueues(scene.Jobs.OpaqueObjects, scene);
|
||||||
GLERROR("OpaqueObjects");
|
GLERROR("OpaqueObjects");
|
||||||
delete state;
|
|
||||||
|
|
||||||
DrawFinalPassState* stateSprite = new DrawFinalPassState(m_FinalPassFrameBuffer.GetHandle());
|
|
||||||
if (scene.ShouldBlur) {
|
|
||||||
//Combine nonblur and blur texture
|
|
||||||
stateSprite->Disable(GL_DEPTH_TEST);
|
|
||||||
stateSprite->Disable(GL_STENCIL_TEST);
|
|
||||||
m_CombinedTexture = blurHUDPass->CombineTextures(m_SceneTexture, m_FullBlurredTexture);
|
|
||||||
|
|
||||||
}
|
|
||||||
//Draw Transparen objects
|
|
||||||
//state->BlendFunc(GL_ONE, GL_ONE);
|
|
||||||
//state->StencilFunc(GL_EQUAL, 1, 0xFF);
|
|
||||||
//DrawModelRenderQueues(scene.Jobs.TransparentObjects, scene);
|
|
||||||
GLERROR("TransparentObjects");
|
|
||||||
//state->BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
|
||||||
stateSprite->Enable(GL_DEPTH_TEST);
|
|
||||||
//stateSprite->AlphaFunc(GL_GEQUAL, 0.05f);
|
|
||||||
//stateSprite->Enable(GL_ALPHA_TEST);
|
|
||||||
DrawSprites(scene.Jobs.SpriteJob, scene);
|
|
||||||
GLERROR("SpriteJobs");
|
|
||||||
|
|
||||||
delete stateSprite;
|
|
||||||
|
|
||||||
state = new DrawFinalPassState(m_FinalPassFrameBuffer.GetHandle());
|
|
||||||
|
|
||||||
//state->Disable(GL_STENCIL_TEST);
|
//state->Disable(GL_STENCIL_TEST);
|
||||||
//Draw Transparen Shielded objects
|
//Draw Transparen Shielded objects
|
||||||
state->BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
state->BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||||
textPass->Draw(scene, m_FinalPassFrameBuffer);
|
|
||||||
DrawModelRenderQueuesWithShieldCheck(scene.Jobs.TransparentObjects, scene); //might need changing
|
DrawModelRenderQueuesWithShieldCheck(scene.Jobs.TransparentObjects, scene); //might need changing
|
||||||
GLERROR("Shielded Transparent objects");
|
GLERROR("Shielded Transparent objects");
|
||||||
|
|
||||||
@@ -322,7 +296,27 @@ void DrawFinalPass::Draw(RenderScene& scene, BlurHUD* blurHUDPass, TextPass* tex
|
|||||||
m_FullBlurredTexture = blurHUDPass->Draw(m_SceneTexture, scene);
|
m_FullBlurredTexture = blurHUDPass->Draw(m_SceneTexture, scene);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DrawFinalPassState* stateSprite = new DrawFinalPassState(m_FinalPassFrameBuffer.GetHandle());
|
||||||
|
if(scene.ShouldBlur) {
|
||||||
|
//Combine nonblur and blur texture
|
||||||
|
stateSprite->Disable(GL_DEPTH_TEST);
|
||||||
|
stateSprite->Disable(GL_STENCIL_TEST);
|
||||||
|
m_CombinedTexture = blurHUDPass->CombineTextures(m_SceneTexture, m_FullBlurredTexture);
|
||||||
|
|
||||||
|
}
|
||||||
|
//Draw Transparen objects
|
||||||
|
//state->BlendFunc(GL_ONE, GL_ONE);
|
||||||
|
//state->StencilFunc(GL_EQUAL, 1, 0xFF);
|
||||||
|
//DrawModelRenderQueues(scene.Jobs.TransparentObjects, scene);
|
||||||
|
GLERROR("TransparentObjects");
|
||||||
|
//state->BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||||
|
stateSprite->Enable(GL_DEPTH_TEST);
|
||||||
|
//stateSprite->AlphaFunc(GL_GEQUAL, 0.05f);
|
||||||
|
//stateSprite->Enable(GL_ALPHA_TEST);
|
||||||
|
DrawSprites(scene.Jobs.SpriteJob, scene);
|
||||||
|
GLERROR("SpriteJobs");
|
||||||
|
|
||||||
|
delete stateSprite;
|
||||||
GLERROR("END");
|
GLERROR("END");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -148,14 +148,29 @@ void RawModelCustom::ReadMaterialSingle(std::size_t& offset, char* fileData, con
|
|||||||
case MaterialType::Basic:
|
case MaterialType::Basic:
|
||||||
newMaterialProperty.material = new MaterialBasic();
|
newMaterialProperty.material = new MaterialBasic();
|
||||||
ReadMaterialBasic(newMaterialProperty.material, offset, fileData, fileByteSize);
|
ReadMaterialBasic(newMaterialProperty.material, offset, fileData, fileByteSize);
|
||||||
|
if(hasSkin){
|
||||||
|
newMaterialProperty.ShaderID = ResourceManager::Load<ShaderProgram>("#ForwardPlusSkinnedProgram")->ResourceID;
|
||||||
|
} else {
|
||||||
|
newMaterialProperty.ShaderID = ResourceManager::Load<ShaderProgram>("#ForwardPlusProgram")->ResourceID;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case MaterialType::SplatMapping:
|
case MaterialType::SplatMapping:
|
||||||
newMaterialProperty.material = new MaterialSplatMapping();
|
newMaterialProperty.material = new MaterialSplatMapping();
|
||||||
ReadMaterialSplatMapping(static_cast<MaterialSplatMapping*>(newMaterialProperty.material), offset, fileData, fileByteSize);
|
ReadMaterialSplatMapping(static_cast<MaterialSplatMapping*>(newMaterialProperty.material), offset, fileData, fileByteSize);
|
||||||
|
if (hasSkin){
|
||||||
|
newMaterialProperty.ShaderID = ResourceManager::Load<ShaderProgram>("#ForwardPlusSplatMapSkinnedProgram")->ResourceID;
|
||||||
|
} else {
|
||||||
|
newMaterialProperty.ShaderID = ResourceManager::Load<ShaderProgram>("#ForwardPlusSplatMapProgram")->ResourceID;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case MaterialType::SingleTextures:
|
case MaterialType::SingleTextures:
|
||||||
newMaterialProperty.material = new MaterialSingleTextures();
|
newMaterialProperty.material = new MaterialSingleTextures();
|
||||||
ReadMaterialSingleTexture(static_cast<MaterialSingleTextures*>(newMaterialProperty.material), offset, fileData, fileByteSize);
|
ReadMaterialSingleTexture(static_cast<MaterialSingleTextures*>(newMaterialProperty.material), offset, fileData, fileByteSize);
|
||||||
|
if (hasSkin){
|
||||||
|
newMaterialProperty.ShaderID = ResourceManager::Load<ShaderProgram>("#ForwardPlusSkinnedProgram")->ResourceID;
|
||||||
|
} else {
|
||||||
|
newMaterialProperty.ShaderID = ResourceManager::Load<ShaderProgram>("#ForwardPlusProgram")->ResourceID;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw Resource::FailedLoadingException("Material contains an unknown MaterialType");
|
throw Resource::FailedLoadingException("Material contains an unknown MaterialType");
|
||||||
|
|||||||
@@ -140,6 +140,7 @@ void Renderer::updateFramebufferSize()
|
|||||||
m_LightCullingPass->OnWindowResize();
|
m_LightCullingPass->OnWindowResize();
|
||||||
m_DrawBloomPass->OnWindowResize();
|
m_DrawBloomPass->OnWindowResize();
|
||||||
m_SSAOPass->OnWindowResize();
|
m_SSAOPass->OnWindowResize();
|
||||||
|
m_BlurHUDPass->OnWindowResize();
|
||||||
|
|
||||||
e.NewResolution = m_ViewportSize;
|
e.NewResolution = m_ViewportSize;
|
||||||
m_EventBroker->Publish(e);
|
m_EventBroker->Publish(e);
|
||||||
@@ -210,15 +211,14 @@ void Renderer::Draw(RenderFrame& frame)
|
|||||||
PerformanceTimer::StartTimerAndStopPrevious("Renderer-Light Culling");
|
PerformanceTimer::StartTimerAndStopPrevious("Renderer-Light Culling");
|
||||||
m_LightCullingPass->CullLights(*scene);
|
m_LightCullingPass->CullLights(*scene);
|
||||||
GLERROR("LightCulling");
|
GLERROR("LightCulling");
|
||||||
PerformanceTimer::StartTimerAndStopPrevious("Renderer-Draw Text");
|
|
||||||
//m_TextPass->Draw(*scene, *m_DrawFinalPass->FinalPassFrameBuffer());
|
|
||||||
GLERROR("Draw Text");
|
|
||||||
PerformanceTimer::StartTimerAndStopPrevious("Renderer-Draw Geometry+Light");
|
PerformanceTimer::StartTimerAndStopPrevious("Renderer-Draw Geometry+Light");
|
||||||
m_DrawFinalPass->Draw(*scene, m_BlurHUDPass, m_TextPass);
|
m_DrawFinalPass->Draw(*scene, m_BlurHUDPass);
|
||||||
GLERROR("Draw Geometry+Light");
|
GLERROR("Draw Geometry+Light");
|
||||||
//m_DrawScenePass->Draw(*scene);
|
//m_DrawScenePass->Draw(*scene);
|
||||||
|
|
||||||
|
PerformanceTimer::StartTimerAndStopPrevious("Renderer-Draw Text");
|
||||||
|
m_TextPass->Draw(*scene, *m_DrawFinalPass->FinalPassFrameBuffer());
|
||||||
|
GLERROR("Draw Text");
|
||||||
PerformanceTimer::StopTimer("Renderer-Draw Text");
|
PerformanceTimer::StopTimer("Renderer-Draw Text");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,23 +7,23 @@ TextPass::TextPass()
|
|||||||
|
|
||||||
void TextPass::Initialize()
|
void TextPass::Initialize()
|
||||||
{
|
{
|
||||||
glGenVertexArrays(1, &VAO);
|
glGenVertexArrays(1, &VAO);
|
||||||
glGenBuffers(1, &VBO);
|
glGenBuffers(1, &VBO);
|
||||||
glBindVertexArray(VAO);
|
glBindVertexArray(VAO);
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, VBO);
|
glBindBuffer(GL_ARRAY_BUFFER, VBO);
|
||||||
glBufferData(GL_ARRAY_BUFFER, sizeof(GLfloat) * 6 * 4, NULL, GL_DYNAMIC_DRAW);
|
glBufferData(GL_ARRAY_BUFFER, sizeof(GLfloat) * 6 * 4, NULL, GL_DYNAMIC_DRAW);
|
||||||
glEnableVertexAttribArray(0);
|
glEnableVertexAttribArray(0);
|
||||||
glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 4 * sizeof(GLfloat), 0);
|
glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 4 * sizeof(GLfloat), 0);
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||||
glBindVertexArray(0);
|
glBindVertexArray(0);
|
||||||
|
|
||||||
m_TextProgram = ResourceManager::Load<ShaderProgram>("#TextProgram");
|
m_TextProgram = ResourceManager::Load<ShaderProgram>("#TextProgram");
|
||||||
m_TextProgram->AddShader(std::shared_ptr<Shader>(new VertexShader("Shaders/Text.vert.glsl")));
|
m_TextProgram->AddShader(std::shared_ptr<Shader>(new VertexShader("Shaders/Text.vert.glsl")));
|
||||||
m_TextProgram->AddShader(std::shared_ptr<Shader>(new FragmentShader("Shaders/Text.frag.glsl")));
|
m_TextProgram->AddShader(std::shared_ptr<Shader>(new FragmentShader("Shaders/Text.frag.glsl")));
|
||||||
m_TextProgram->Compile();
|
m_TextProgram->Compile();
|
||||||
m_TextProgram->BindFragDataLocation(0, "sceneColor");
|
m_TextProgram->BindFragDataLocation(0, "sceneColor");
|
||||||
m_TextProgram->BindFragDataLocation(1, "bloomColor");
|
m_TextProgram->BindFragDataLocation(1, "bloomColor");
|
||||||
m_TextProgram->Link();
|
m_TextProgram->Link();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextPass::Update()
|
void TextPass::Update()
|
||||||
@@ -33,81 +33,180 @@ void TextPass::Update()
|
|||||||
|
|
||||||
void TextPass::Draw(RenderScene& scene, FrameBuffer& frameBuffer)
|
void TextPass::Draw(RenderScene& scene, FrameBuffer& frameBuffer)
|
||||||
{
|
{
|
||||||
GLERROR("Derp1");
|
GLERROR("Derp1");
|
||||||
//TextPassState* state = new TextPassState(frameBuffer.GetHandle());
|
TextPassState* state = new TextPassState(frameBuffer.GetHandle());
|
||||||
for (auto &job : scene.Jobs.Text) {
|
for (auto &job : scene.Jobs.Text) {
|
||||||
auto textJob = std::dynamic_pointer_cast<TextJob>(job);
|
auto textJob = std::dynamic_pointer_cast<TextJob>(job);
|
||||||
if (textJob) {
|
if (textJob) {
|
||||||
|
|
||||||
renderText(textJob->Content, textJob->Resource, textJob->Alignment, textJob->Color, textJob->Matrix, scene.Camera->ProjectionMatrix(), scene.Camera->ViewMatrix());
|
renderText(textJob->Content, textJob->Resource, textJob->Alignment, textJob->Color, textJob->Matrix, scene.Camera->ProjectionMatrix(), scene.Camera->ViewMatrix());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
GLERROR("Derp2");
|
GLERROR("Derp2");
|
||||||
// delete state;
|
delete state;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string TextPass::parseColors(std::string text, std::map<int, glm::vec4>& colorChanges, glm::vec4 originalColor)
|
||||||
|
{
|
||||||
|
std::string parsedString = text;
|
||||||
|
glm::vec4 newColor = originalColor;
|
||||||
|
bool colorChange = false;
|
||||||
|
|
||||||
|
for (std::string::const_iterator c = parsedString.begin(); c != parsedString.end(); c++) {
|
||||||
|
if (*c == char(92)) { // Backlash
|
||||||
|
if ((c + 1) != parsedString.end()) {
|
||||||
|
if (*(c + 1) == char('C')) { // C for Color
|
||||||
|
if ((c + 7) != parsedString.end()) {
|
||||||
|
bool hasCorrectFormat = true;
|
||||||
|
|
||||||
|
for (std::string::const_iterator colorC = c + 2; colorC != c + 8; colorC++) {
|
||||||
|
if (*colorC < '0' || *colorC > 'F') {
|
||||||
|
hasCorrectFormat = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hasCorrectFormat == true) {
|
||||||
|
colorChange = true;
|
||||||
|
|
||||||
|
std::array<int, 3> hexToInt = {
|
||||||
|
std::stoi(std::string(c + 2, c + 4), 0, 16),
|
||||||
|
std::stoi(std::string(c + 4, c + 6), 0, 16),
|
||||||
|
std::stoi(std::string(c + 6, c + 8), 0, 16)
|
||||||
|
};
|
||||||
|
|
||||||
|
newColor = glm::vec4(
|
||||||
|
float(hexToInt[0]) / 255.f,
|
||||||
|
float(hexToInt[1]) / 255.f,
|
||||||
|
float(hexToInt[2]) / 255.f,
|
||||||
|
newColor.a);
|
||||||
|
|
||||||
|
parsedString.erase(c, (c + 8));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (*(c + 1) == char('A')) { // A for Alpha
|
||||||
|
if ((c + 3) != parsedString.end()) {
|
||||||
|
bool hasCorrectFormat = true;
|
||||||
|
|
||||||
|
for (std::string::const_iterator colorC = c + 2; colorC != c + 4; colorC++) {
|
||||||
|
if (*colorC < '0' || *colorC > 'F') {
|
||||||
|
hasCorrectFormat = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hasCorrectFormat == true) {
|
||||||
|
colorChange = true;
|
||||||
|
|
||||||
|
int hexToInt = std::stoi(std::string(c + 2, c + 4), 0, 16);
|
||||||
|
|
||||||
|
newColor = glm::vec4(
|
||||||
|
newColor.r,
|
||||||
|
newColor.g,
|
||||||
|
newColor.b,
|
||||||
|
float(hexToInt) / 255.f);
|
||||||
|
|
||||||
|
parsedString.erase(c, (c + 4));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((*(c + 1) >= '1' && *(c + 1) <= '9') || *(c + 1) == 'B' || *(c + 1) == 'E' || *(c + 1) == 'F') { // Icons
|
||||||
|
if (*(c + 1) >= '1' && *(c + 1) <= '9') {
|
||||||
|
parsedString.replace(c, (c + 2), 1, (*(c + 1) - 48));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
parsedString.replace(c, (c + 2), 1, (*(c + 1) - 55));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (colorChange) {
|
||||||
|
colorChanges[c - parsedString.begin()] = newColor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return parsedString;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextPass::renderText(std::string text, Font* font, TextJob::AlignmentEnum alignment, glm::vec4 color, glm::mat4 modelMatrix, glm::mat4 projectionMatrix, glm::mat4 viewMatrix)
|
void TextPass::renderText(std::string text, Font* font, TextJob::AlignmentEnum alignment, glm::vec4 color, glm::mat4 modelMatrix, glm::mat4 projectionMatrix, glm::mat4 viewMatrix)
|
||||||
{
|
{
|
||||||
GLfloat penX = 0;
|
GLfloat penX = 0;
|
||||||
GLfloat penY = 0;
|
GLfloat penY = 0;
|
||||||
GLfloat scale = 1.0/font->FontSize;
|
GLfloat scale = 1.0 / font->FontSize;
|
||||||
|
|
||||||
GLfloat stringWidth = 0.f;
|
GLfloat stringWidth = 0.f;
|
||||||
|
|
||||||
for (std::string::const_iterator c = text.begin(); c != text.end(); c++) {
|
std::map<int, glm::vec4> colorChanges;
|
||||||
Font::Character ch = font->m_Characters[*c];
|
std::string parsedText = parseColors(text, colorChanges, color);
|
||||||
stringWidth += (ch.Advance >> 6) * scale;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(alignment == TextJob::AlignmentEnum::Center) {
|
for (std::string::const_iterator c = parsedText.begin(); c != parsedText.end(); c++) {
|
||||||
penX = -stringWidth/2.f;
|
Font::Character ch = font->m_Characters[*c];
|
||||||
} else if (alignment == TextJob::AlignmentEnum::Right) {
|
stringWidth += (ch.Advance >> 6) * scale;
|
||||||
penX = -stringWidth;
|
}
|
||||||
} else {
|
|
||||||
penX = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
m_TextProgram->Bind();
|
if (alignment == TextJob::AlignmentEnum::Center) {
|
||||||
glUniform4fv(glGetUniformLocation(m_TextProgram->GetHandle(), "textColor"), 1, glm::value_ptr(color));
|
penX = -stringWidth / 2.f;
|
||||||
glUniformMatrix4fv(glGetUniformLocation(m_TextProgram->GetHandle(), "M"), 1, GL_FALSE, glm::value_ptr(modelMatrix));
|
}
|
||||||
glUniformMatrix4fv(glGetUniformLocation(m_TextProgram->GetHandle(), "V"), 1, GL_FALSE, glm::value_ptr(viewMatrix));
|
else if (alignment == TextJob::AlignmentEnum::Right) {
|
||||||
glUniformMatrix4fv(glGetUniformLocation(m_TextProgram->GetHandle(), "P"), 1, GL_FALSE, glm::value_ptr(projectionMatrix));
|
penX = -stringWidth;
|
||||||
glActiveTexture(GL_TEXTURE0);
|
}
|
||||||
glBindVertexArray(VAO);
|
else {
|
||||||
|
penX = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
for (std::string::const_iterator c = text.begin(); c != text.end(); c++) {
|
|
||||||
Font::Character ch = font->m_Characters[*c];
|
|
||||||
|
|
||||||
GLfloat xpos = penX + ch.Bearing.x * scale;
|
m_TextProgram->Bind();
|
||||||
GLfloat ypos = penY - (ch.Size.y - ch.Bearing.y) * scale;
|
glUniform4fv(glGetUniformLocation(m_TextProgram->GetHandle(), "textColor"), 1, glm::value_ptr(color));
|
||||||
|
glUniformMatrix4fv(glGetUniformLocation(m_TextProgram->GetHandle(), "M"), 1, GL_FALSE, glm::value_ptr(modelMatrix));
|
||||||
|
glUniformMatrix4fv(glGetUniformLocation(m_TextProgram->GetHandle(), "V"), 1, GL_FALSE, glm::value_ptr(viewMatrix));
|
||||||
|
glUniformMatrix4fv(glGetUniformLocation(m_TextProgram->GetHandle(), "P"), 1, GL_FALSE, glm::value_ptr(projectionMatrix));
|
||||||
|
glActiveTexture(GL_TEXTURE0);
|
||||||
|
glBindVertexArray(VAO);
|
||||||
|
|
||||||
GLfloat w = ch.Size.x * scale;
|
|
||||||
GLfloat h = ch.Size.y * scale;
|
|
||||||
|
|
||||||
GLfloat vertices[6][4] = {
|
for (std::string::const_iterator c = parsedText.begin(); c != parsedText.end(); c++) {
|
||||||
{ xpos, ypos + h, 0.0, 0.0 },
|
|
||||||
{ xpos, ypos, 0.0, 1.0 },
|
|
||||||
{ xpos + w, ypos, 1.0, 1.0 },
|
|
||||||
|
|
||||||
{ xpos, ypos + h, 0.0, 0.0 },
|
auto it = colorChanges.find(c - parsedText.begin());
|
||||||
{ xpos + w, ypos, 1.0, 1.0 },
|
if (it != colorChanges.end()) {
|
||||||
{ xpos + w, ypos + h, 1.0, 0.0 }
|
glUniform4fv(glGetUniformLocation(m_TextProgram->GetHandle(), "textColor"), 1, glm::value_ptr(it->second));
|
||||||
};
|
}
|
||||||
|
|
||||||
glBindTexture(GL_TEXTURE_2D, ch.TextureID);
|
Font::Character ch = font->m_Characters[*c];
|
||||||
|
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, VBO);
|
GLfloat xpos = penX + ch.Bearing.x * scale;
|
||||||
glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(vertices), vertices);
|
GLfloat ypos = penY - (ch.Size.y - ch.Bearing.y) * scale;
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
|
||||||
glDrawArrays(GL_TRIANGLES, 0, 6);
|
|
||||||
penX += (ch.Advance >> 6) * scale; // Bitshift by 6 to get value in pixels (2^6 = 64)
|
|
||||||
}
|
|
||||||
glBindVertexArray(0);
|
|
||||||
glBindTexture(GL_TEXTURE_2D, 0);
|
|
||||||
|
|
||||||
GLERROR("Text rendering Error");
|
GLfloat w = ch.Size.x * scale;
|
||||||
|
GLfloat h = ch.Size.y * scale;
|
||||||
|
|
||||||
|
GLfloat vertices[6][4] = {
|
||||||
|
{ xpos, ypos + h, 0.0, 0.0 },
|
||||||
|
{ xpos, ypos, 0.0, 1.0 },
|
||||||
|
{ xpos + w, ypos, 1.0, 1.0 },
|
||||||
|
|
||||||
|
{ xpos, ypos + h, 0.0, 0.0 },
|
||||||
|
{ xpos + w, ypos, 1.0, 1.0 },
|
||||||
|
{ xpos + w, ypos + h, 1.0, 0.0 }
|
||||||
|
};
|
||||||
|
|
||||||
|
glBindTexture(GL_TEXTURE_2D, ch.TextureID);
|
||||||
|
|
||||||
|
glBindBuffer(GL_ARRAY_BUFFER, VBO);
|
||||||
|
glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(vertices), vertices);
|
||||||
|
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||||
|
glDrawArrays(GL_TRIANGLES, 0, 6);
|
||||||
|
penX += (ch.Advance >> 6) * scale; // Bitshift by 6 to get value in pixels (2^6 = 64)
|
||||||
|
}
|
||||||
|
glBindVertexArray(0);
|
||||||
|
glBindTexture(GL_TEXTURE_2D, 0);
|
||||||
|
|
||||||
|
GLERROR("Text rendering Error");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,13 +4,10 @@
|
|||||||
TextPassState::TextPassState(GLuint frameBuffer)
|
TextPassState::TextPassState(GLuint frameBuffer)
|
||||||
{
|
{
|
||||||
BindFramebuffer(frameBuffer);
|
BindFramebuffer(frameBuffer);
|
||||||
Enable(GL_BLEND);
|
glEnable(GL_BLEND);
|
||||||
Disable(GL_CULL_FACE);
|
glDisable(GL_CULL_FACE);
|
||||||
Enable(GL_DEPTH_TEST);
|
glEnable(GL_DEPTH_TEST);
|
||||||
BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||||
Enable(GL_ALPHA_TEST);
|
|
||||||
AlphaFunc(GL_GEQUAL, 0.05f);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TextPassState::~TextPassState()
|
TextPassState::~TextPassState()
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ SoundManager::SoundManager(World* world, EventBroker* eventBroker)
|
|||||||
m_World = world;
|
m_World = world;
|
||||||
m_BGMVolumeChannel = config->Get<float>("Sound.BGMVolume", 1.f);
|
m_BGMVolumeChannel = config->Get<float>("Sound.BGMVolume", 1.f);
|
||||||
m_SFXVolumeChannel = config->Get<float>("Sound.SFXVolume", 1.f);
|
m_SFXVolumeChannel = config->Get<float>("Sound.SFXVolume", 1.f);
|
||||||
|
m_AnnouncerVolumeChannel = config->Get<float>("Sound.AnnouncerVolume", 1.f);
|
||||||
|
|
||||||
initOpenAL();
|
initOpenAL();
|
||||||
alSpeedOfSound(340.29f);
|
alSpeedOfSound(340.29f);
|
||||||
@@ -16,16 +17,23 @@ SoundManager::SoundManager(World* world, EventBroker* eventBroker)
|
|||||||
EVENT_SUBSCRIBE_MEMBER(m_EPlaySoundOnEntity, &SoundManager::OnPlaySoundOnEntity);
|
EVENT_SUBSCRIBE_MEMBER(m_EPlaySoundOnEntity, &SoundManager::OnPlaySoundOnEntity);
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_EPlaySoundOnPosition, &SoundManager::OnPlaySoundOnPosition);
|
EVENT_SUBSCRIBE_MEMBER(m_EPlaySoundOnPosition, &SoundManager::OnPlaySoundOnPosition);
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_EPlayBackgroundMusic, &SoundManager::OnPlayBackgroundMusic);
|
EVENT_SUBSCRIBE_MEMBER(m_EPlayBackgroundMusic, &SoundManager::OnPlayBackgroundMusic);
|
||||||
|
EVENT_SUBSCRIBE_MEMBER(m_EPlayAnnouncerVoice, &SoundManager::OnPlayAnnouncerVoice);
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_EStopSound, &SoundManager::OnStopSound);
|
EVENT_SUBSCRIBE_MEMBER(m_EStopSound, &SoundManager::OnStopSound);
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_EPauseSound, &SoundManager::OnPauseSound);
|
EVENT_SUBSCRIBE_MEMBER(m_EPauseSound, &SoundManager::OnPauseSound);
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_EContinueSound, &SoundManager::OnContinueSound);
|
EVENT_SUBSCRIBE_MEMBER(m_EContinueSound, &SoundManager::OnContinueSound);
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_ESetBGMGain, &SoundManager::OnSetBGMGain);
|
EVENT_SUBSCRIBE_MEMBER(m_ESetBGMGain, &SoundManager::OnSetBGMGain);
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_ESetSFXGain, &SoundManager::OnSetSFXGain);
|
EVENT_SUBSCRIBE_MEMBER(m_ESetSFXGain, &SoundManager::OnSetSFXGain);
|
||||||
|
EVENT_SUBSCRIBE_MEMBER(m_ESetAnnouncerGain, &SoundManager::OnSetAnnouncerGain);
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_EPause, &SoundManager::OnPause);
|
EVENT_SUBSCRIBE_MEMBER(m_EPause, &SoundManager::OnPause);
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_EResume, &SoundManager::OnResume);
|
EVENT_SUBSCRIBE_MEMBER(m_EResume, &SoundManager::OnResume);
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_EComponentAttached, &SoundManager::OnComponentAttached);
|
EVENT_SUBSCRIBE_MEMBER(m_EComponentAttached, &SoundManager::OnComponentAttached);
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_EPlayerSpawned, &SoundManager::OnPlayerSpawned);
|
EVENT_SUBSCRIBE_MEMBER(m_EPlayerSpawned, &SoundManager::OnPlayerSpawned);
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_EPlayQueueOnEntity, &SoundManager::OnPlayQueueOnEntity);
|
EVENT_SUBSCRIBE_MEMBER(m_EPlayQueueOnEntity, &SoundManager::OnPlayQueueOnEntity);
|
||||||
|
EVENT_SUBSCRIBE_MEMBER(m_EChangeBGM, &SoundManager::OnChangeBGM);
|
||||||
|
|
||||||
|
Events::ChangeBGM e;
|
||||||
|
e.FilePath = "Audio/bgm/MenuMusic.wav";
|
||||||
|
m_EventBroker->Publish(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
SoundManager::~SoundManager()
|
SoundManager::~SoundManager()
|
||||||
@@ -56,13 +64,11 @@ void SoundManager::stopEmitters()
|
|||||||
void SoundManager::Update(double dt)
|
void SoundManager::Update(double dt)
|
||||||
{
|
{
|
||||||
m_EventBroker->Process<SoundManager>();
|
m_EventBroker->Process<SoundManager>();
|
||||||
deleteInactiveEmitters(); // can be optimized with "EEntityDeleted"
|
deleteInactiveEmitters();
|
||||||
updateEmitters(dt);
|
updateEmitters(dt);
|
||||||
updateListener(dt);
|
updateListener(dt);
|
||||||
|
if (m_DrumLoopHasBeenStarted)
|
||||||
// Editor debug info
|
matchBGMLoop();
|
||||||
ImGui::SliderFloat("BGM", &m_BGMVolumeChannel, 0.0f, 1.0f, "%.3f", 1.0f);
|
|
||||||
ImGui::SliderFloat("SFX", &m_SFXVolumeChannel, 0.0f, 1.0f, "%.3f", 1.0f);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SoundManager::deleteInactiveEmitters()
|
void SoundManager::deleteInactiveEmitters()
|
||||||
@@ -117,7 +123,7 @@ void SoundManager::updateEmitters(double dt)
|
|||||||
// Calculate velocity
|
// Calculate velocity
|
||||||
glm::vec3 velocity = glm::vec3(nextPos - previousPos) / (float)dt;
|
glm::vec3 velocity = glm::vec3(nextPos - previousPos) / (float)dt;
|
||||||
setSourcePos(it->second->ALsource, nextPos);
|
setSourcePos(it->second->ALsource, nextPos);
|
||||||
setSourceVel(it->second->ALsource, velocity);
|
//setSourceVel(it->second->ALsource, glm::vec3(0));
|
||||||
|
|
||||||
auto emitter = m_World->GetComponent(it->first, "SoundEmitter");
|
auto emitter = m_World->GetComponent(it->first, "SoundEmitter");
|
||||||
setSoundProperties(it->second, &emitter);
|
setSoundProperties(it->second, &emitter);
|
||||||
@@ -166,9 +172,34 @@ Source* SoundManager::createSource(std::string filePath)
|
|||||||
Source* source = new Source();
|
Source* source = new Source();
|
||||||
source->ALsource = alSource;
|
source->ALsource = alSource;
|
||||||
source->SoundResource = ResourceManager::Load<Sound>(filePath);
|
source->SoundResource = ResourceManager::Load<Sound>(filePath);
|
||||||
|
source->Duration = getDurationSeconds(source);
|
||||||
return source;
|
return source;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SoundManager::matchBGMLoop()
|
||||||
|
{
|
||||||
|
if (m_CurrentBGMCombo == nullptr)
|
||||||
|
return;
|
||||||
|
auto cCapturePoints = m_World->GetComponents("CapturePoint");
|
||||||
|
for (auto it = cCapturePoints->begin(); it != cCapturePoints->end(); it++) {
|
||||||
|
float timeCaptured = (float)(double)(*it)["CaptureTimer"];
|
||||||
|
float maxTimer = (float)(double)(*it)["CapturePointMaxTimer"];
|
||||||
|
int capturePointIndex = (int)(*it)["CapturePointNumber"];
|
||||||
|
|
||||||
|
if (capturePointIndex == 0) { // Home for red team
|
||||||
|
if (timeCaptured < 0 && glm::abs(timeCaptured) < maxTimer) {
|
||||||
|
float gain = glm::abs(timeCaptured) / maxTimer;
|
||||||
|
setGain(m_CurrentBGMCombo, gain);
|
||||||
|
}
|
||||||
|
} else if (capturePointIndex == 4) { // Home for blue team
|
||||||
|
if (timeCaptured > 0 && timeCaptured < maxTimer) {
|
||||||
|
float gain = timeCaptured / maxTimer;
|
||||||
|
setGain(m_CurrentBGMCombo, gain);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void SoundManager::playSound(Source* source)
|
void SoundManager::playSound(Source* source)
|
||||||
{
|
{
|
||||||
alSourcei(source->ALsource, AL_BUFFER, source->SoundResource->Buffer());
|
alSourcei(source->ALsource, AL_BUFFER, source->SoundResource->Buffer());
|
||||||
@@ -192,10 +223,12 @@ bool SoundManager::OnPlaySoundOnEntity(const Events::PlaySoundOnEntity & e)
|
|||||||
{
|
{
|
||||||
Source* source = createSource(e.FilePath);
|
Source* source = createSource(e.FilePath);
|
||||||
source->Type = SoundType::SFX;
|
source->Type = SoundType::SFX;
|
||||||
EntityID child = m_World->CreateEntity(e.EmitterID);
|
EntityID child = m_World->CreateEntity(e.Emitter.ID);
|
||||||
m_World->AttachComponent(child, "Transform");
|
m_World->AttachComponent(child, "Transform");
|
||||||
m_World->AttachComponent(child, "SoundEmitter");
|
auto cEmitter = m_World->AttachComponent(child, "SoundEmitter");
|
||||||
|
(double&)(float)cEmitter["Gain"] = e.Gain;
|
||||||
m_Sources[child] = source;
|
m_Sources[child] = source;
|
||||||
|
setGain(source, cEmitter["Gain"]);
|
||||||
playSound(source);
|
playSound(source);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -242,7 +275,7 @@ bool SoundManager::OnPlayBackgroundMusic(const Events::PlayBackgroundMusic & e)
|
|||||||
auto listenerComponents = m_World->GetComponents("Listener");
|
auto listenerComponents = m_World->GetComponents("Listener");
|
||||||
for (auto it = listenerComponents->begin(); it != listenerComponents->end(); it++) {
|
for (auto it = listenerComponents->begin(); it != listenerComponents->end(); it++) {
|
||||||
if ((*it).EntityID != m_LocalPlayer.ID) {
|
if ((*it).EntityID != m_LocalPlayer.ID) {
|
||||||
break;
|
continue;
|
||||||
}
|
}
|
||||||
auto emitterChild = m_World->CreateEntity((*it).EntityID);
|
auto emitterChild = m_World->CreateEntity((*it).EntityID);
|
||||||
auto emitter = m_World->AttachComponent(emitterChild, "SoundEmitter");
|
auto emitter = m_World->AttachComponent(emitterChild, "SoundEmitter");
|
||||||
@@ -258,6 +291,28 @@ bool SoundManager::OnPlayBackgroundMusic(const Events::PlayBackgroundMusic & e)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool SoundManager::OnPlayAnnouncerVoice(const Events::PlayAnonuncerVoice& e)
|
||||||
|
{
|
||||||
|
auto listenerComponents = m_World->GetComponents("Listener");
|
||||||
|
for (auto it = listenerComponents->begin(); it != listenerComponents->end(); it++) {
|
||||||
|
if ((*it).EntityID != m_LocalPlayer.ID) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
auto emitterChild = m_World->CreateEntity((*it).EntityID);
|
||||||
|
auto emitter = m_World->AttachComponent(emitterChild, "SoundEmitter");
|
||||||
|
(bool&)emitter["Loop"] = false;
|
||||||
|
(std::string&)emitter["FilePath"] = e.FilePath;
|
||||||
|
m_World->AttachComponent(emitterChild, "Transform");
|
||||||
|
Source* source = createSource(e.FilePath);
|
||||||
|
source->Type = SoundType::Announcer;
|
||||||
|
setSoundProperties(source, &emitter);
|
||||||
|
m_Sources[emitterChild] = source;
|
||||||
|
playSound(source);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool SoundManager::OnSetBGMGain(const Events::SetBGMGain & e)
|
bool SoundManager::OnSetBGMGain(const Events::SetBGMGain & e)
|
||||||
{
|
{
|
||||||
m_BGMVolumeChannel = e.Gain;
|
m_BGMVolumeChannel = e.Gain;
|
||||||
@@ -270,6 +325,13 @@ bool SoundManager::OnSetSFXGain(const Events::SetSFXGain & e)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool SoundManager::OnSetAnnouncerGain(const Events::SetAnnouncerGain& e)
|
||||||
|
{
|
||||||
|
m_AnnouncerVolumeChannel = e.Gain;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool SoundManager::OnComponentAttached(const Events::ComponentAttached & e)
|
bool SoundManager::OnComponentAttached(const Events::ComponentAttached & e)
|
||||||
{
|
{
|
||||||
if (e.Component.Info.Name == "SoundEmitter") {
|
if (e.Component.Info.Name == "SoundEmitter") {
|
||||||
@@ -301,12 +363,20 @@ bool SoundManager::OnPlayerSpawned(const Events::PlayerSpawned &e)
|
|||||||
{
|
{
|
||||||
if (e.PlayerID == -1) { // Local player
|
if (e.PlayerID == -1) { // Local player
|
||||||
m_LocalPlayer = e.Player;
|
m_LocalPlayer = e.Player;
|
||||||
|
if (m_DrumLoopHasBeenStarted) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
m_CurrentBGMCombo = createSource("Audio/BGM/Layer2.wav");
|
||||||
|
m_CurrentBGMCombo->Type = SoundType::BGM;
|
||||||
|
alSourcei(m_CurrentBGMCombo->ALsource, AL_LOOPING, 1);
|
||||||
|
setGain(m_CurrentBGMCombo, 0);
|
||||||
|
playSound(m_CurrentBGMCombo);
|
||||||
|
m_DrumLoopHasBeenStarted = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool SoundManager::OnPlayQueueOnEntity(const Events::PlayQueueOnEntity &e)
|
bool SoundManager::OnPlayQueueOnEntity(const Events::PlayQueueOnEntity &e)
|
||||||
{
|
{
|
||||||
Source* source = createSource(*e.FilePaths.begin());
|
Source* source = createSource(*e.FilePaths.begin());
|
||||||
@@ -321,6 +391,18 @@ bool SoundManager::OnPlayQueueOnEntity(const Events::PlayQueueOnEntity &e)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool SoundManager::OnChangeBGM(const Events::ChangeBGM &e)
|
||||||
|
{
|
||||||
|
if (m_CurrentBGM != nullptr) {
|
||||||
|
stopSound(m_CurrentBGM);
|
||||||
|
}
|
||||||
|
m_CurrentBGM = createSource(e.FilePath);
|
||||||
|
m_CurrentBGM->Type = SoundType::BGM;
|
||||||
|
alSourcei(m_CurrentBGM->ALsource, AL_LOOPING, 1);
|
||||||
|
playSound(m_CurrentBGM);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
ALenum SoundManager::getSourceState(ALuint source)
|
ALenum SoundManager::getSourceState(ALuint source)
|
||||||
{
|
{
|
||||||
ALenum state;
|
ALenum state;
|
||||||
@@ -335,15 +417,49 @@ void SoundManager::setGain(Source * source, float gain)
|
|||||||
|
|
||||||
void SoundManager::setSoundProperties(Source* source, ComponentWrapper* soundComponent)
|
void SoundManager::setSoundProperties(Source* source, ComponentWrapper* soundComponent)
|
||||||
{
|
{
|
||||||
float gain = (source->Type == SoundType::SFX) ? m_SFXVolumeChannel : m_BGMVolumeChannel;
|
float gain;
|
||||||
|
switch (source->Type) {
|
||||||
|
case SoundType::SFX:
|
||||||
|
gain = m_SFXVolumeChannel;
|
||||||
|
break;
|
||||||
|
case SoundType::BGM:
|
||||||
|
gain = m_BGMVolumeChannel;
|
||||||
|
break;
|
||||||
|
case SoundType::Announcer:
|
||||||
|
gain = m_AnnouncerVolumeChannel;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
gain = 1.f;
|
||||||
|
break;
|
||||||
|
}
|
||||||
alSourcef(source->ALsource, AL_GAIN, (float)(double)(*soundComponent)["Gain"] * gain);
|
alSourcef(source->ALsource, AL_GAIN, (float)(double)(*soundComponent)["Gain"] * gain);
|
||||||
alSourcef(source->ALsource, AL_PITCH, (float)(double)(*soundComponent)["Pitch"]);
|
alSourcef(source->ALsource, AL_PITCH, (float)(double)(*soundComponent)["Pitch"]);
|
||||||
alSourcei(source->ALsource, AL_LOOPING, (int)(bool)(*soundComponent)["Loop"]); // YOLO
|
alSourcei(source->ALsource, AL_LOOPING, (int)(bool)(*soundComponent)["Loop"]);
|
||||||
alSourcef(source->ALsource, AL_MAX_DISTANCE, (float)(double)(*soundComponent)["MaxDistance"]);
|
alSourcef(source->ALsource, AL_MAX_DISTANCE, (float)(double)(*soundComponent)["MaxDistance"]);
|
||||||
alSourcef(source->ALsource, AL_ROLLOFF_FACTOR, (float)(double)(*soundComponent)["RollOffFactor"]);
|
alSourcef(source->ALsource, AL_ROLLOFF_FACTOR, (float)(double)(*soundComponent)["RollOffFactor"]);
|
||||||
alSourcef(source->ALsource, AL_REFERENCE_DISTANCE, (float)(double)(*soundComponent)["ReferenceDistance"]);
|
alSourcef(source->ALsource, AL_REFERENCE_DISTANCE, (float)(double)(*soundComponent)["ReferenceDistance"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float SoundManager::getDurationSeconds(Source* source)
|
||||||
|
{
|
||||||
|
ALuint buffer = source->SoundResource->Buffer();
|
||||||
|
ALint sizeBytes, channels, bits, frequenzy;
|
||||||
|
alGetBufferi(buffer, AL_SIZE, &sizeBytes);
|
||||||
|
alGetBufferi(buffer, AL_CHANNELS, &channels);
|
||||||
|
alGetBufferi(buffer, AL_BITS, &bits);
|
||||||
|
alGetBufferi(buffer, AL_FREQUENCY, &frequenzy);
|
||||||
|
float sampleLength = (float)sizeBytes * 8 / (channels * bits);
|
||||||
|
return (sampleLength / frequenzy);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
float SoundManager::getTimeOffsetSeconds(Source* source)
|
||||||
|
{
|
||||||
|
float time;
|
||||||
|
alGetSourcef(source->ALsource, AL_SEC_OFFSET, &time);
|
||||||
|
return time;
|
||||||
|
}
|
||||||
|
|
||||||
void SoundManager::initOpenAL()
|
void SoundManager::initOpenAL()
|
||||||
{
|
{
|
||||||
// Initialize OpenAL
|
// Initialize OpenAL
|
||||||
|
|||||||
+3
-1
@@ -223,7 +223,9 @@ void Game::Tick()
|
|||||||
m_EventBroker->Swap();
|
m_EventBroker->Swap();
|
||||||
|
|
||||||
PerformanceTimer::StartTimerAndStopPrevious("SoundManager");
|
PerformanceTimer::StartTimerAndStopPrevious("SoundManager");
|
||||||
m_SoundManager->Update(dt);
|
if (m_IsClient) {
|
||||||
|
m_SoundManager->Update(dt);
|
||||||
|
}
|
||||||
|
|
||||||
// Update network
|
// Update network
|
||||||
PerformanceTimer::StartTimerAndStopPrevious("Network");
|
PerformanceTimer::StartTimerAndStopPrevious("Network");
|
||||||
|
|||||||
@@ -234,9 +234,14 @@ void CapturePointSystem::UpdateComponent(EntityWrapper& capturePointEntity, Comp
|
|||||||
|
|
||||||
void CapturePointSystem::ChangeCapturePointModelsVisibility(EntityWrapper &capturePointModels, bool isOwner) {
|
void CapturePointSystem::ChangeCapturePointModelsVisibility(EntityWrapper &capturePointModels, bool isOwner) {
|
||||||
(bool&)capturePointModels["Model"]["Visible"] = isOwner;
|
(bool&)capturePointModels["Model"]["Visible"] = isOwner;
|
||||||
for (auto& capModel : capturePointModels.ChildrenWithComponent("Model"))
|
for (auto& capModel : capturePointModels.ChildrenWithComponent("Transform"))
|
||||||
{
|
{
|
||||||
(bool&)capModel["Model"]["Visible"] = isOwner;
|
if (capModel.HasComponent("Model")) {
|
||||||
|
(bool&)capModel["Model"]["Visible"] = isOwner;
|
||||||
|
}
|
||||||
|
if (capModel.HasComponent("PointLight")) {
|
||||||
|
(bool&)capModel["PointLight"]["Visible"] = isOwner;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,10 +16,54 @@ void MainMenuSystem::Update(double dt)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainMenuSystem::OpenSubMenu(const Events::InputCommand& e)
|
||||||
|
{
|
||||||
|
auto menus = m_World->GetComponents("Menu");
|
||||||
|
if (menus == nullptr) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_OpenSubMenu == EntityWrapper::Invalid) {
|
||||||
|
//No submenu is open, open one.
|
||||||
|
for (auto& menu : *menus) {
|
||||||
|
EntityWrapper menuEntity = EntityWrapper(m_World, menu.EntityID);
|
||||||
|
auto serverListSpawner = menuEntity.FirstChildByName(e.Command + "Spawner");
|
||||||
|
if (!serverListSpawner.HasComponent("Spawner")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
m_OpenSubMenu = SpawnerSystem::Spawn(serverListSpawner, serverListSpawner);
|
||||||
|
Events::SearchForServers event;
|
||||||
|
m_EventBroker->Publish(event);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if (m_OpenSubMenu.Name().compare(e.Command) != 0) {
|
||||||
|
//Menu is open, but not the right one, delete the old one and open a new one.
|
||||||
|
m_World->DeleteEntity(m_OpenSubMenu.ID);
|
||||||
|
m_OpenSubMenu = EntityWrapper::Invalid;
|
||||||
|
|
||||||
|
for (auto& menu : *menus) {
|
||||||
|
EntityWrapper menuEntity = EntityWrapper(m_World, menu.EntityID);
|
||||||
|
auto serverListSpawner = menuEntity.FirstChildByName(e.Command + "Spawner");
|
||||||
|
if (!serverListSpawner.HasComponent("Spawner")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
m_OpenSubMenu = SpawnerSystem::Spawn(serverListSpawner, serverListSpawner);
|
||||||
|
Events::SearchForServers event;
|
||||||
|
m_EventBroker->Publish(event);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
//Serverlist submenu is open, close it.
|
||||||
|
m_World->DeleteEntity(m_OpenSubMenu.ID);
|
||||||
|
m_OpenSubMenu = EntityWrapper::Invalid;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool MainMenuSystem::OnButtonClick(const Events::ButtonClicked& e)
|
bool MainMenuSystem::OnButtonClick(const Events::ButtonClicked& e)
|
||||||
{
|
{
|
||||||
if (e.EntityName == "ServerIdentityConnect") {
|
EntityWrapper entity = e.Entity;
|
||||||
EntityWrapper entity = e.Entity;
|
if (entity.Name() == "ServerIdentityConnect") {
|
||||||
EntityWrapper serverIdentityEntity = entity.FirstParentWithComponent("ServerIdentity");
|
EntityWrapper serverIdentityEntity = entity.FirstParentWithComponent("ServerIdentity");
|
||||||
if(serverIdentityEntity.Valid()) {
|
if(serverIdentityEntity.Valid()) {
|
||||||
Events::ConnectRequest event;
|
Events::ConnectRequest event;
|
||||||
@@ -28,6 +72,9 @@ bool MainMenuSystem::OnButtonClick(const Events::ButtonClicked& e)
|
|||||||
printf("\n ----Request Server Connect----\nIP: %s\nPort: %i\n ------------------------------", event.IP, event.Port);
|
printf("\n ----Request Server Connect----\nIP: %s\nPort: %i\n ------------------------------", event.IP, event.Port);
|
||||||
m_EventBroker->Publish(event);
|
m_EventBroker->Publish(event);
|
||||||
}
|
}
|
||||||
|
} else if (entity.HasComponent("ConfigBtnResolution")) {
|
||||||
|
|
||||||
|
m_Renderer->SetResolution(Rectangle((int)entity["ConfigBtnResolution"]["Width"], (int)entity["ConfigBtnResolution"]["Height"]));
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -45,49 +92,12 @@ bool MainMenuSystem::OnButtonPress(const Events::ButtonPressed& e)
|
|||||||
bool MainMenuSystem::OnInputCommand(const Events::InputCommand& e)
|
bool MainMenuSystem::OnInputCommand(const Events::InputCommand& e)
|
||||||
{
|
{
|
||||||
if(e.Command == "Play" && e.Value == 1) {
|
if(e.Command == "Play" && e.Value == 1) {
|
||||||
auto menus = m_World->GetComponents("Menu");
|
OpenSubMenu(e);
|
||||||
if (menus == nullptr) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_OpenSubMenu == EntityWrapper::Invalid) {
|
|
||||||
//No submenu is open, open one.
|
|
||||||
for (auto& menu : *menus) {
|
|
||||||
EntityWrapper menuEntity = EntityWrapper(m_World, menu.EntityID);
|
|
||||||
auto serverListSpawner = menuEntity.FirstChildByName(e.Command + "Spawner");
|
|
||||||
if (!serverListSpawner.HasComponent("Spawner")) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
m_OpenSubMenu = SpawnerSystem::Spawn(serverListSpawner, serverListSpawner);
|
|
||||||
Events::SearchForServers event;
|
|
||||||
m_EventBroker->Publish(event);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
} else if(!m_OpenSubMenu.HasComponent("ServerList")) {
|
|
||||||
//Menu is open, but not the right one, delete the old one and open a new one.
|
|
||||||
m_World->DeleteEntity(m_OpenSubMenu.ID);
|
|
||||||
m_OpenSubMenu = EntityWrapper::Invalid;
|
|
||||||
|
|
||||||
for (auto& menu : *menus) {
|
|
||||||
EntityWrapper menuEntity = EntityWrapper(m_World, menu.EntityID);
|
|
||||||
auto serverListSpawner = menuEntity.FirstChildByName(e.Command + "Spawner");
|
|
||||||
if (!serverListSpawner.HasComponent("Spawner")) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
m_OpenSubMenu = SpawnerSystem::Spawn(serverListSpawner, serverListSpawner);
|
|
||||||
Events::SearchForServers event;
|
|
||||||
m_EventBroker->Publish(event);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
//Serverlist submenu is open, close it.
|
|
||||||
m_World->DeleteEntity(m_OpenSubMenu.ID);
|
|
||||||
m_OpenSubMenu = EntityWrapper::Invalid;
|
|
||||||
}
|
|
||||||
} else if (e.Command == "RefreshServerList" && e.Value == 1){
|
} else if (e.Command == "RefreshServerList" && e.Value == 1){
|
||||||
Events::SearchForServers event;
|
Events::SearchForServers event;
|
||||||
m_EventBroker->Publish(event);
|
m_EventBroker->Publish(event);
|
||||||
|
} else if (e.Command == "Options" && e.Value == 1) {
|
||||||
|
OpenSubMenu(e);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -264,15 +264,19 @@ void PlayerMovementSystem::updateMovementControllers(double dt)
|
|||||||
size = glm::vec3(1.f, 1.f, 1.f);
|
size = glm::vec3(1.f, 1.f, 1.f);
|
||||||
} else {
|
} else {
|
||||||
size = glm::vec3(1.f, 1.6f, 1.f);
|
size = glm::vec3(1.f, 1.6f, 1.f);
|
||||||
|
if (controller->CrouchingLastFrame() && isOnGround) {
|
||||||
|
// The collision should resolve this anyway, but
|
||||||
|
// this is more reliable, since the box gets larger.
|
||||||
|
((glm::vec3&)cTransform["Position"]).y += 0.3f;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Animations
|
// TODO: Animations
|
||||||
}
|
}
|
||||||
|
playerStep(dt, player);
|
||||||
controller->Reset();
|
controller->Reset();
|
||||||
}
|
}
|
||||||
playerStep(dt);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -308,12 +312,12 @@ void PlayerMovementSystem::updateVelocity(EntityWrapper player, double dt)
|
|||||||
position += velocity * (float)dt;
|
position += velocity * (float)dt;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlayerMovementSystem::playerStep(double dt)
|
void PlayerMovementSystem::playerStep(double dt, EntityWrapper player)
|
||||||
{
|
{
|
||||||
if (!m_LocalPlayer.Valid()) {
|
// Position of the local player, used see how far a player has moved.
|
||||||
|
if(!IsClient) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Position of the local player, used see how far a player has moved.
|
|
||||||
glm::vec3 pos = (glm::vec3)m_World->GetComponent(m_LocalPlayer.ID, "Transform")["Position"];
|
glm::vec3 pos = (glm::vec3)m_World->GetComponent(m_LocalPlayer.ID, "Transform")["Position"];
|
||||||
// Used to see if a player is airborne.
|
// Used to see if a player is airborne.
|
||||||
bool grounded = (bool)m_World->GetComponent(m_LocalPlayer.ID, "Physics")["IsOnGround"];
|
bool grounded = (bool)m_World->GetComponent(m_LocalPlayer.ID, "Physics")["IsOnGround"];
|
||||||
@@ -324,8 +328,8 @@ void PlayerMovementSystem::playerStep(double dt)
|
|||||||
// Player moved a step's distance
|
// Player moved a step's distance
|
||||||
// Create footstep sound
|
// Create footstep sound
|
||||||
Events::PlaySoundOnEntity e;
|
Events::PlaySoundOnEntity e;
|
||||||
e.EmitterID = m_LocalPlayer.ID;
|
e.Emitter = m_LocalPlayer;
|
||||||
e.FilePath = m_LeftFoot ? "Audio/footstep/footstep2.wav" : "Audio/footstep/footstep3.wav";
|
e.FilePath = m_LeftFoot ? "Audio/Footstep/Footstep2.wav" : "Audio/Footstep/Footstep3.wav";
|
||||||
m_LeftFoot = !m_LeftFoot;
|
m_LeftFoot = !m_LeftFoot;
|
||||||
m_EventBroker->Publish(e);
|
m_EventBroker->Publish(e);
|
||||||
m_DistanceMoved = 0.f;
|
m_DistanceMoved = 0.f;
|
||||||
|
|||||||
@@ -6,45 +6,33 @@ SoundSystem::SoundSystem(SystemParams params)
|
|||||||
{
|
{
|
||||||
ConfigFile* config = ResourceManager::Load<ConfigFile>("Config.ini");
|
ConfigFile* config = ResourceManager::Load<ConfigFile>("Config.ini");
|
||||||
m_Announcer = ResourceManager::Load<ConfigFile>("Config.ini")->Get<std::string>("Sound.Announcer", "female");
|
m_Announcer = ResourceManager::Load<ConfigFile>("Config.ini")->Get<std::string>("Sound.Announcer", "female");
|
||||||
if (IsClient) {
|
unsigned seed = std::chrono::system_clock::now().time_since_epoch().count();
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_EPlayerSpawned, &SoundSystem::OnPlayerSpawned);
|
m_RandomGenerator = std::default_random_engine(seed);
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_InputCommand, &SoundSystem::OnInputCommand);
|
m_RandIntDistribution = std::uniform_int_distribution<int>(1, 12);
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_EDoubleJump, &SoundSystem::OnDoubleJump);
|
EVENT_SUBSCRIBE_MEMBER(m_EPlayerSpawned, &SoundSystem::OnPlayerSpawned);
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_EDashAbility, &SoundSystem::OnDashAbility);
|
EVENT_SUBSCRIBE_MEMBER(m_InputCommand, &SoundSystem::OnInputCommand);
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_EPlayerDamage, &SoundSystem::OnPlayerDamage);
|
EVENT_SUBSCRIBE_MEMBER(m_EDoubleJump, &SoundSystem::OnDoubleJump);
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_ECaptured, &SoundSystem::OnCaptured);
|
EVENT_SUBSCRIBE_MEMBER(m_EPlayerDamage, &SoundSystem::OnPlayerDamage);
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_ETriggerTouch, &SoundSystem::OnTriggerTouch);
|
EVENT_SUBSCRIBE_MEMBER(m_ECaptured, &SoundSystem::OnCaptured);
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_EPlayerDeath, &SoundSystem::OnPlayerDeath);
|
EVENT_SUBSCRIBE_MEMBER(m_EPlayerDeath, &SoundSystem::OnPlayerDeath);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SoundSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper& cComponent, double dt)
|
void SoundSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper& cComponent, double dt)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
void SoundSystem::Update(double dt)
|
void SoundSystem::Update(double dt)
|
||||||
{
|
{ }
|
||||||
if (!IsClient) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Temp for play test.
|
|
||||||
if (m_DrumsIsPlaying) {
|
|
||||||
m_DrumsIsPlaying = !drumTimer(dt);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool SoundSystem::OnPlayerSpawned(const Events::PlayerSpawned &e)
|
bool SoundSystem::OnPlayerSpawned(const Events::PlayerSpawned &e)
|
||||||
{
|
{
|
||||||
if (e.PlayerID == -1) { // Local player
|
if (e.PlayerID == -1) { // Local player
|
||||||
m_World->AttachComponent(e.Player.ID, "Listener");
|
m_World->AttachComponent(e.Player.ID, "Listener");
|
||||||
Events::PlaySoundOnEntity go;
|
Events::PlayAnonuncerVoice go;
|
||||||
go.EmitterID = LocalPlayer.ID;
|
go.FilePath = "Audio/Announcer/" + m_Announcer + "/Go.wav";
|
||||||
go.FilePath = "Audio/announcer/" + m_Announcer + "/go.wav";
|
|
||||||
m_EventBroker->Publish(go);
|
m_EventBroker->Publish(go);
|
||||||
// TEMP: starts bgm
|
|
||||||
{
|
{
|
||||||
Events::PlayBackgroundMusic ev;
|
Events::ChangeBGM ev;
|
||||||
ev.FilePath = "Audio/bgm/ambient.wav";
|
ev.FilePath = "Audio/BGM/Layer1.wav";
|
||||||
m_EventBroker->Publish(ev);
|
m_EventBroker->Publish(ev);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -54,82 +42,67 @@ bool SoundSystem::OnPlayerSpawned(const Events::PlayerSpawned &e)
|
|||||||
bool SoundSystem::OnInputCommand(const Events::InputCommand & e)
|
bool SoundSystem::OnInputCommand(const Events::InputCommand & e)
|
||||||
{
|
{
|
||||||
if (e.Command == "Jump" && e.Value > 0) {
|
if (e.Command == "Jump" && e.Value > 0) {
|
||||||
if (e.PlayerID == -1) { // local player
|
if (e.PlayerID == -1) {
|
||||||
playerJumps();
|
playerJumps(LocalPlayer);
|
||||||
return true;
|
}
|
||||||
}
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SoundSystem::playerJumps()
|
void SoundSystem::playerJumps(EntityWrapper player)
|
||||||
{
|
{
|
||||||
if (!LocalPlayer.Valid()) {
|
if (!IsClient) { // Only play for clients
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if(!player.HasComponent("Physics")) {
|
||||||
bool grounded = (bool)m_World->GetComponent(LocalPlayer.ID, "Physics")["IsOnGround"];
|
return;
|
||||||
|
}
|
||||||
|
bool grounded = (bool)player["Physics"]["IsOnGround"];
|
||||||
if (grounded) {
|
if (grounded) {
|
||||||
Events::PlaySoundOnEntity e;
|
Events::PlaySoundOnEntity e;
|
||||||
e.EmitterID = LocalPlayer.ID;
|
e.Emitter = player;
|
||||||
e.FilePath = "Audio/jump/jump1.wav";
|
e.FilePath = "Audio/Jump/Jump1.wav";
|
||||||
m_EventBroker->Publish(e);
|
m_EventBroker->Publish(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SoundSystem::drumTimer(double dt)
|
|
||||||
{
|
|
||||||
m_DrumTimer += dt;
|
|
||||||
if (m_DrumTimer > 15) {
|
|
||||||
m_DrumTimer = 0.0;
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool SoundSystem::OnCaptured(const Events::Captured & e)
|
bool SoundSystem::OnCaptured(const Events::Captured & e)
|
||||||
{
|
{
|
||||||
if (!LocalPlayer.Valid()) {
|
if (!IsClient) { // Only play for clients
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
int homeTeam = (int)m_World->GetComponent(e.CapturePointTakenID, "Team")["Team"];
|
int homeTeam = (int)m_World->GetComponent(e.CapturePointTakenID, "Team")["Team"];
|
||||||
int team = (int)m_World->GetComponent(LocalPlayer.ID, "Team")["Team"];
|
int team = (int)m_World->GetComponent(LocalPlayer.ID, "Team")["Team"];
|
||||||
Events::PlaySoundOnEntity ev;
|
Events::PlayAnonuncerVoice ev;
|
||||||
if (team == homeTeam) {
|
if (team == homeTeam) {
|
||||||
ev.FilePath = "Audio/announcer/" + m_Announcer + "/objective_achieved.wav";
|
ev.FilePath = "Audio/Announcer/" + m_Announcer + "/ObjectiveAchieved.wav";
|
||||||
} else {
|
} else {
|
||||||
ev.FilePath = "Audio/announcer/" + m_Announcer + "/objective_failed.wav"; // have not been tested
|
ev.FilePath = "Audio/Announcer/" + m_Announcer + "/ObjectiveFailed.wav";
|
||||||
}
|
}
|
||||||
ev.EmitterID = LocalPlayer.ID;
|
|
||||||
m_EventBroker->Publish(ev);
|
m_EventBroker->Publish(ev);
|
||||||
// Temp for play test.
|
|
||||||
m_DrumsIsPlaying = false;
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Testing purposes atm...
|
|
||||||
bool SoundSystem::OnPlayerDamage(const Events::PlayerDamage & e)
|
bool SoundSystem::OnPlayerDamage(const Events::PlayerDamage & e)
|
||||||
{
|
{
|
||||||
if (!IsClient) { // Only play for clients
|
if (!IsClient) { // Only play for clients
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (LocalPlayer.ID = e.Victim.ID) { // You're local player was the one who took dmg
|
if (!e.Victim.Valid() || !e.Inflictor.Valid()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
auto victimTeam = m_World->GetComponent(e.Victim.ID, "Team");
|
||||||
|
auto inflictorTeam = m_World->GetComponent(e.Inflictor.ID, "Team");
|
||||||
|
if ((int)victimTeam["Team"] == (int)inflictorTeam["Team"]) {
|
||||||
|
// Victim and inflictor are the same team, should not play "hurt" sound.
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
std::uniform_int_distribution<int> dist(1, 12);
|
|
||||||
int rand = dist(generator);
|
|
||||||
std::vector<std::string> paths;
|
std::vector<std::string> paths;
|
||||||
paths.push_back("Audio/hurt/hurt" + std::to_string(rand) + ".wav");
|
paths.push_back("Audio/Hurt/Hurt" + std::to_string(m_RandIntDistribution(m_RandomGenerator)) + ".wav");
|
||||||
|
|
||||||
// // Breathe
|
|
||||||
// int ammountOfbreaths = (static_cast<int>(e.Damage) / 10) + 2; // TEMP: Idk something stupid like this shit
|
|
||||||
// for (int i = 0; i < ammountOfbreaths; i++) {
|
|
||||||
// paths.push_back("Audio/exhausted/breath.wav");
|
|
||||||
// }
|
|
||||||
Events::PlayQueueOnEntity ev;
|
Events::PlayQueueOnEntity ev;
|
||||||
ev.Emitter = LocalPlayer;
|
ev.Emitter = e.Victim;
|
||||||
ev.FilePaths = paths;
|
ev.FilePaths = paths;
|
||||||
m_EventBroker->Publish(ev);
|
m_EventBroker->Publish(ev);
|
||||||
return false;
|
return false;
|
||||||
@@ -137,7 +110,7 @@ bool SoundSystem::OnPlayerDamage(const Events::PlayerDamage & e)
|
|||||||
|
|
||||||
bool SoundSystem::OnPlayerDeath(const Events::PlayerDeath & e)
|
bool SoundSystem::OnPlayerDeath(const Events::PlayerDeath & e)
|
||||||
{
|
{
|
||||||
if (e.Player.ID != LocalPlayer.ID) {
|
if (!e.Player.Valid()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!IsClient) {
|
if (!IsClient) {
|
||||||
@@ -146,8 +119,9 @@ bool SoundSystem::OnPlayerDeath(const Events::PlayerDeath & e)
|
|||||||
// The local player is dead. The local player might be invalid?
|
// The local player is dead. The local player might be invalid?
|
||||||
// Play the sound from the listener.
|
// Play the sound from the listener.
|
||||||
// TODO: We might want to hear other players die.
|
// TODO: We might want to hear other players die.
|
||||||
Events::PlayBackgroundMusic ev;
|
Events::PlaySoundOnEntity ev;
|
||||||
ev.FilePath = "Audio/die/die2.wav";
|
ev.Emitter = e.Player;
|
||||||
|
ev.FilePath = "Audio/Die/Die2.wav";
|
||||||
m_EventBroker->Publish(ev);
|
m_EventBroker->Publish(ev);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -155,43 +129,25 @@ bool SoundSystem::OnPlayerDeath(const Events::PlayerDeath & e)
|
|||||||
bool SoundSystem::OnPlayerHealthPickup(const Events::PlayerHealthPickup & e)
|
bool SoundSystem::OnPlayerHealthPickup(const Events::PlayerHealthPickup & e)
|
||||||
{
|
{
|
||||||
Events::PlaySoundOnEntity ev;
|
Events::PlaySoundOnEntity ev;
|
||||||
ev.EmitterID = LocalPlayer.ID;
|
ev.Emitter = LocalPlayer;
|
||||||
ev.FilePath = "Audio/pickup/pickup2.wav";
|
ev.FilePath = "Audio/Pickup/Pickup2.wav";
|
||||||
m_EventBroker->Publish(ev);
|
m_EventBroker->Publish(ev);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SoundSystem::OnTriggerTouch(const Events::TriggerTouch & e)
|
|
||||||
{
|
|
||||||
// Temp for play test.
|
|
||||||
if (m_DrumsIsPlaying) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (m_World->HasComponent(e.Trigger.ID, "CapturePoint")) {
|
|
||||||
Events::PlaySoundOnEntity ev; // should be BGM
|
|
||||||
ev.EmitterID = LocalPlayer.ID;
|
|
||||||
ev.FilePath = "Audio/bgm/drumstest.wav";
|
|
||||||
m_EventBroker->Publish(ev);
|
|
||||||
// Temp for play test.
|
|
||||||
m_DrumsIsPlaying = true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool SoundSystem::OnDoubleJump(const Events::DoubleJump & e)
|
bool SoundSystem::OnDoubleJump(const Events::DoubleJump & e)
|
||||||
{
|
{
|
||||||
Events::PlaySoundOnEntity ev;
|
if (!m_World->ValidEntity(e.entityID)) {
|
||||||
ev.EmitterID = LocalPlayer.ID;
|
return false;
|
||||||
ev.FilePath = "Audio/jump/jump2.wav";
|
}
|
||||||
m_EventBroker->Publish(ev);
|
if (!IsClient) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (e.entityID == LocalPlayer.ID) {
|
||||||
bool SoundSystem::OnDashAbility(const Events::DashAbility &e)
|
Events::PlaySoundOnEntity ev;
|
||||||
{
|
ev.Emitter = EntityWrapper(m_World, e.entityID);
|
||||||
Events::PlaySoundOnEntity ev;
|
ev.FilePath = "Audio/Jump/Jump2.wav";
|
||||||
ev.EmitterID = LocalPlayer.ID;
|
m_EventBroker->Publish(ev);
|
||||||
ev.FilePath = "Audio/jump/dash1.wav";
|
}
|
||||||
m_EventBroker->Publish(ev);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -8,6 +8,7 @@ SpectatorCameraSystem::SpectatorCameraSystem(SystemParams params)
|
|||||||
, m_PickedTeam(-1)
|
, m_PickedTeam(-1)
|
||||||
{
|
{
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_EInputCommand, &SpectatorCameraSystem::OnInputCommand);
|
EVENT_SUBSCRIBE_MEMBER(m_EInputCommand, &SpectatorCameraSystem::OnInputCommand);
|
||||||
|
EVENT_SUBSCRIBE_MEMBER(m_EDisconnect, &SpectatorCameraSystem::OnDisconnect);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpectatorCameraSystem::Update(double dt)
|
void SpectatorCameraSystem::Update(double dt)
|
||||||
@@ -87,4 +88,17 @@ bool SpectatorCameraSystem::OnInputCommand(const Events::InputCommand& e)
|
|||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool SpectatorCameraSystem::OnDisconnect(const Events::PlayerDisconnected& e)
|
||||||
|
{
|
||||||
|
// If local player gets disconnected, they should be set to
|
||||||
|
// the spectator camera next time a map loads that has one.
|
||||||
|
if (e.Entity == LocalPlayer.ID) {
|
||||||
|
m_CamSetToTeamPick = false;
|
||||||
|
// They will also be set to menu, so unlock mouse just in case they were in game with locked mouse.
|
||||||
|
Events::UnlockMouse unlock;
|
||||||
|
m_EventBroker->Publish(unlock);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ void AssaultWeaponBehaviour::OnReload(ComponentWrapper cWeapon, WeaponInfo& wi)
|
|||||||
|
|
||||||
// Sound
|
// Sound
|
||||||
Events::PlaySoundOnEntity e;
|
Events::PlaySoundOnEntity e;
|
||||||
e.EmitterID = wi.Player.ID;
|
e.Emitter = wi.Player;
|
||||||
e.FilePath = "Audio/weapon/Assault/AssaultWeaponReload.wav";
|
e.FilePath = "Audio/weapon/Assault/AssaultWeaponReload.wav";
|
||||||
m_EventBroker->Publish(e);
|
m_EventBroker->Publish(e);
|
||||||
}
|
}
|
||||||
@@ -234,7 +234,7 @@ void AssaultWeaponBehaviour::fireBullet(ComponentWrapper cWeapon, WeaponInfo& wi
|
|||||||
if (hitMarkerSpawner.Valid()) {
|
if (hitMarkerSpawner.Valid()) {
|
||||||
SpawnerSystem::Spawn(hitMarkerSpawner, hitMarkerSpawner);
|
SpawnerSystem::Spawn(hitMarkerSpawner, hitMarkerSpawner);
|
||||||
Events::PlaySoundOnEntity e;
|
Events::PlaySoundOnEntity e;
|
||||||
e.EmitterID = wi.Player.ID;
|
e.Emitter = wi.Player;
|
||||||
e.FilePath = "Audio/weapon/hitclick.wav";
|
e.FilePath = "Audio/weapon/hitclick.wav";
|
||||||
m_EventBroker->Publish(e);
|
m_EventBroker->Publish(e);
|
||||||
}
|
}
|
||||||
@@ -253,7 +253,7 @@ void AssaultWeaponBehaviour::fireBullet(ComponentWrapper cWeapon, WeaponInfo& wi
|
|||||||
|
|
||||||
// Sound
|
// Sound
|
||||||
Events::PlaySoundOnEntity e;
|
Events::PlaySoundOnEntity e;
|
||||||
e.EmitterID = wi.Player.ID;
|
e.Emitter = wi.Player;
|
||||||
e.FilePath = "Audio/weapon/Assault/AssaultWeaponFire.wav";
|
e.FilePath = "Audio/weapon/Assault/AssaultWeaponFire.wav";
|
||||||
m_EventBroker->Publish(e);
|
m_EventBroker->Publish(e);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ void DefenderWeaponBehaviour::UpdateWeapon(ComponentWrapper cWeapon, WeaponInfo&
|
|||||||
magAmmo += 1;
|
magAmmo += 1;
|
||||||
reloadTimer = reloadTime;
|
reloadTimer = reloadTime;
|
||||||
Events::PlaySoundOnEntity e;
|
Events::PlaySoundOnEntity e;
|
||||||
e.EmitterID = wi.Player.ID;
|
e.Emitter = wi.Player;
|
||||||
e.FilePath = "Audio/weapon/Zoom.wav";
|
e.FilePath = "Audio/weapon/Zoom.wav";
|
||||||
m_EventBroker->Publish(e);
|
m_EventBroker->Publish(e);
|
||||||
} else {
|
} else {
|
||||||
@@ -232,6 +232,13 @@ void DefenderWeaponBehaviour::fireShell(ComponentWrapper cWeapon, WeaponInfo& wi
|
|||||||
}
|
}
|
||||||
if (weaponModelEntity.Valid()) {
|
if (weaponModelEntity.Valid()) {
|
||||||
EntityWrapper spawner = weaponModelEntity.FirstChildByName("WeaponMuzzle");
|
EntityWrapper spawner = weaponModelEntity.FirstChildByName("WeaponMuzzle");
|
||||||
|
Events::PlaySoundOnEntity e;
|
||||||
|
e.Emitter = weaponModelEntity;
|
||||||
|
e.FilePath = "Audio/weapon/Shotgun/ShotgunFire.wav";
|
||||||
|
e.Gain = 1.f;
|
||||||
|
if (IsClient) {
|
||||||
|
m_EventBroker->Publish(e);
|
||||||
|
}
|
||||||
for (auto& angles : pelletAngles) {
|
for (auto& angles : pelletAngles) {
|
||||||
glm::vec3 direction = Transform::AbsoluteOrientation(spawner) * glm::quat(glm::vec3(angles, 0.f)) * glm::vec3(0, 0, -1);
|
glm::vec3 direction = Transform::AbsoluteOrientation(spawner) * glm::quat(glm::vec3(angles, 0.f)) * glm::vec3(0, 0, -1);
|
||||||
float distance = traceRayDistance(Transform::AbsolutePosition(spawner), direction);
|
float distance = traceRayDistance(Transform::AbsolutePosition(spawner), direction);
|
||||||
@@ -250,7 +257,7 @@ void DefenderWeaponBehaviour::fireShell(ComponentWrapper cWeapon, WeaponInfo& wi
|
|||||||
|
|
||||||
// Sound
|
// Sound
|
||||||
Events::PlaySoundOnEntity e;
|
Events::PlaySoundOnEntity e;
|
||||||
e.EmitterID = wi.Player.ID;
|
e.Emitter = wi.Player;
|
||||||
e.FilePath = "Audio/weapon/Blast.wav";
|
e.FilePath = "Audio/weapon/Blast.wav";
|
||||||
m_EventBroker->Publish(e);
|
m_EventBroker->Publish(e);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user