Compare commits

...

117 Commits

Author SHA1 Message Date
verysecrethero 2381f01d12 HealthSystem now deletes the entity after publishing the PlayerDeath event 2016-01-21 14:25:01 +01:00
Jace 70cab9ef30 Merge pull request #40 from teamfisk/Networking
Networking
2016-01-21 10:03:44 +01:00
Jace f1a54a89b3 Merge pull request #37 from teamfisk/OctTree
Oct tree
2016-01-21 09:57:46 +01:00
William Moberg 60037c2849 Merge pull request #31 from teamfisk/CapturePointTake
Capture point take
2016-01-20 17:43:20 +01:00
Jocke cd67253173 Added logic to go from spectator to player. 2016-01-20 17:41:16 +01:00
verysecrethero a596b8746b CapturePointTimers are now reset for "inactive" CapturePoints after a capture. 2016-01-20 17:32:20 +01:00
verysecrethero 35876f6425 Removed membervariable m_NextPossibleCapturePointand added it as local instead 2016-01-20 16:37:10 +01:00
verysecrethero f6ce98249e Merge remote-tracking branch 'origin/master' into CapturePointTake 2016-01-20 16:32:14 +01:00
Jocke 00588b07c5 Merge branch 'Networking' of github.com:teamfisk/TacticalZ into Networking
# Conflicts:
#	src/Engine/Network/Client.cpp
#	src/Engine/Network/Server.cpp
2016-01-20 16:30:12 +01:00
stiffly 3376f4a16e Added server has timed out logic to client. (>'')> 2016-01-20 16:27:53 +01:00
Jocke 25d2aa3464 "Supporting" spectators. Using a vector for connected units as we do not interpret as players. ““”̿ ̿ ̿ ̿ ̿’̿’̵͇̿̿з=(•̪●)=ε/̵͇̿̿/̿ ̿ ̿ ̿ ̿’““ 2016-01-20 16:27:23 +01:00
verysecrethero 29aefc5af2 Added some more visual CaptureTestState xml files 2016-01-20 16:06:35 +01:00
verysecrethero 39ae83efd4 Fixed all tests in CapturePointTest and cleaned up some comments 2016-01-20 15:40:56 +01:00
verysecrethero 8189e3c00c Logic in CapturePointSystem is working again. Need to update all Tests! 2016-01-20 14:59:18 +01:00
Jocke 4d01cdf895 Merge branch 'Networking' of github.com:teamfisk/TacticalZ into Networking
# Conflicts:
#	src/Engine/Network/Client.cpp
2016-01-20 14:33:17 +01:00
stiffly 7e7ca7edcf Listening to "DisconnectFromServer" 2016-01-20 14:32:04 +01:00
Jocke e9a576341e Started on server disconnect logic. 2016-01-20 14:31:50 +01:00
Jocke f52cddb445 Added packet loss logic for multiple clients.
Changed packet class to fit our needs.
2016-01-20 13:43:11 +01:00
stiffly 85523343b2 Merge remote-tracking branch 'origin/master' into Networking 2016-01-20 10:24:53 +01:00
William Moberg 410e349329 Added test map for capture points and some debug code. 2016-01-19 18:27:58 +01:00
verysecrethero b45de542da CapturePointSystem updated, all tests are green 2016-01-19 17:19:58 +01:00
William Moberg d1b6fb1259 Tiny logic alteration so we don't get false warnings in debug. 2016-01-19 16:59:02 +01:00
Joachim Pettersson dfa96f74e1 Merge pull request #39 from teamfisk/Forward+
Forward+
2016-01-19 16:53:07 +01:00
Tleety 5d6d0f82b9 Removed some debug code 2016-01-19 16:48:59 +01:00
Tleety a124ab2400 Some asset shit.
Fixed testworld to use the right model.
2016-01-19 16:11:56 +01:00
Tleety d2263b0c90 Assets added 2016-01-19 16:09:30 +01:00
Tleety a8ffb24040 latest commit fix 2016-01-19 16:08:09 +01:00
Tleety 893ef38237 Removed world from renderer and moved depth-calculation code to modeljob 2016-01-19 15:41:17 +01:00
verysecrethero f197993beb Changed CapturePointSystem in light of new enums in the components and a teamcomponent. Half the tests are currently working 2016-01-19 15:31:15 +01:00
William Moberg 017ad96bbe Fixed some errors in Tests. 2016-01-19 15:20:29 +01:00
stiffly ad9bb5fba4 Added an extra interpolation point. 2016-01-19 15:03:10 +01:00
William Moberg 713ebbe18c Can add any objects that inherit from AABB into the Octree. 2016-01-19 14:50:46 +01:00
Tleety 982837052a DirectionalLight now correctly getting directions 2016-01-19 14:44:17 +01:00
stiffly e0c4394f20 Merge. Also fixed interpolation for scale and rotation.
Merge remote-tracking branch 'origin/master' into Networking

# Conflicts:
#	include/Game/Game.h
#	src/Game/CMakeLists.txt
#	src/Game/Game.cpp
2016-01-19 14:04:25 +01:00
Tleety 4cafb2fc4c Merge remote-tracking branch 'origin/master' into Forward+ 2016-01-19 12:33:08 +01:00
Tleety 46e17b7e0d Working directional light 2016-01-19 12:32:34 +01:00
stiffly 3142c701e3 WIP interpolating scale and orientation 2016-01-19 11:42:30 +01:00
William Moberg 621d935d7a Octree returns correct boxes when testing along an axis by searching through the correct child subtrees. 2016-01-18 18:24:11 +01:00
William Moberg b2358a1854 Added bool in Physics to toggle gravity for entities. 2016-01-18 18:16:24 +01:00
stiffly a6425160fd Merge branch 'Networking' of github.com:teamfisk/TacticalZ into Networking
# Conflicts:
#	include/Game/InterpolationSystem.h
#	src/Game/InterpolationSystem.cpp
2016-01-18 18:13:19 +01:00
stiffly 88eb3ca2db Scraping queues for interpolation 2016-01-18 18:07:59 +01:00
Jocke 3e90ed564c Moved Struct in InterpolationSystem.h and fixed bug. 2016-01-18 18:07:39 +01:00
Tleety 4b29d48f27 WIP 2016-01-18 17:57:45 +01:00
Jocke 14b1d541dc Merge remote-tracking branch 'origin/Networking' into Networking 2016-01-18 17:34:32 +01:00
stiffly 765509b510 Added interpolationsystem to pipeline. 2016-01-18 17:34:17 +01:00
Jocke 8952c1a7e4 Merge remote-tracking branch 'origin/Networking' into Networking 2016-01-18 17:28:09 +01:00
Jocke fc305f8bf4 Merge remote-tracking branch 'origin/Networking' into Networking 2016-01-18 17:27:55 +01:00
stiffly 62c3f72355 Fixed cmake for interpolationsystem. 2016-01-18 17:27:37 +01:00
Jocke 70cbb02cb2 Merge remote-tracking branch 'origin/Networking' into Networking 2016-01-18 17:13:10 +01:00
Jocke 0c7f2c5198 WIP implemented Interpolation (server logic) 2016-01-18 17:12:42 +01:00
stiffly d7780d8248 WIP implementing interpolation 2016-01-18 17:11:37 +01:00
Tleety 601ce85c05 WIP 2016-01-18 16:50:41 +01:00
verysecrethero 4c1a49a8a4 Merge remote-tracking branch 'origin/master' into CapturePointTake
# Conflicts:
#	include/Engine/Core/ComponentWrapper.h
#	include/Game/PlayerSystem.h
#	include/Game/Systems/HealthSystem.h
#	resources/Schema/Components.xsd
#	resources/Schema/Components/Player.xml
#	resources/Schema/Types/Entity.xsd
#	src/Game/CMakeLists.txt
#	src/Game/PlayerSystem.cpp
#	src/Game/Systems/HealthSystem.cpp
#	src/Tests/OctTreeTestGameClass.cpp
#	src/Tests/OctTreeTestGameClass.h
#	src/Tests/OctTreeTestGameMain.cpp
#	src/Tests/OctTreeTestHardCodedTestWorld.h
2016-01-18 16:48:49 +01:00
Tleety 01a164847c Directional light now fully added to all lists. 2016-01-18 15:15:33 +01:00
Tleety 794635b6a1 Added DirectionalLights to renderqueue jobs 2016-01-18 14:58:19 +01:00
Tleety 0a3b6f4da1 Added DirectionalLightJob 2016-01-18 14:57:55 +01:00
verysecrethero e0410d4345 Small logicfix in CapturePointSystem. Readded CapturePointSystem in Game. Added 2 tests. Tests have been refined a lot. 2016-01-18 14:41:16 +01:00
Tleety 6f1fd19ac7 Directional lights now being filled into m_LightSources 2016-01-18 14:30:28 +01:00
Tleety 6680f6863f DirectionalLight component added. 2016-01-18 14:30:22 +01:00
Tleety 4092f6b4d4 New Lightstruct working. 2016-01-18 14:20:28 +01:00
William Moberg bf3f8aea89 Merge pull request #36 from teamfisk/PlayerMovement
Player movement
2016-01-18 13:32:42 +01:00
William Moberg 0669d91767 CollisionSystem loops over Collidable components. 2016-01-18 13:29:10 +01:00
William Moberg 942064c450 Removed class PlayerSystem and associated files. 2016-01-18 13:07:04 +01:00
Jocke 6ba6deb863 Removed some debug spam. 2016-01-18 11:35:35 +01:00
stiffly cc604f8e9a Merge remote-tracking branch 'origin/Networking' into Networking 2016-01-18 11:06:51 +01:00
stiffly e97f4a3563 Merge remote-tracking branch 'origin/Networking' into Networking
# Conflicts:
#	src/Engine/Network/Client.cpp
#	src/Engine/Network/Server.cpp
#	src/Game/Game.cpp
2016-01-18 11:06:27 +01:00
Jocke d995713d3b Added input queue to Client and Input Listener debug code in server. 2016-01-18 11:06:02 +01:00
Jace fb7e0498a8 Merge pull request #35 from teamfisk/DisableMemoryPool
Possible to disable the MemoryPool allocation in Config files.
2016-01-18 10:46:53 +01:00
Jace f281d220de Working Spawner, SpawnPoint, PlayerSpawn and Team components, along with their systems. 2016-01-17 01:00:48 +01:00
Jace 6385a98eca Added runtime type size check to ComponentWrapper to avoid corruption when types don't match 2016-01-17 00:59:26 +01:00
Jace d8a24bbfde Renamed all instances of "Property" to "Field" in ComponentWrapper to maintain consistent naming with ComponentInfo 2016-01-17 00:38:25 +01:00
Jace 9ec32464bc Added enum support to entity file format, see "Team" component for an example. Use ComponentInfo::Enum to convert enum string keys to its corresponding integer representation at runtime. 2016-01-16 23:12:24 +01:00
Jace f65ac65e30 Updated component defaults files to match component schema and made schema validation strict. 2016-01-16 17:03:57 +01:00
Jace b2213dbe9a Merge remote-tracking branch 'origin/master' into PlayerMovement
# Conflicts:
#	include/Engine/Collision/Collision.h
#	include/Engine/Collision/CollisionSystem.h
#	include/Engine/Collision/TriggerSystem.h
#	resources/Schema/Components.xsd
#	resources/Schema/Entities/CollisionTestLevel.xml
#	resources/Schema/Types/Entity.xsd
#	src/Engine/Collision/Collision.cpp
#	src/Game/Game.cpp
2016-01-15 20:28:43 +01:00
Jace bbabc84127 Fixed default values for CPlayerSpawn 2016-01-15 20:26:30 +01:00
Jace 8bd5a428b9 EntityFileParser now ignores component fields not present in component definition instead of crashing. 2016-01-15 20:25:48 +01:00
Jace db1b972cd1 Spawner, SpawnPoint and PlayerSpawn components, and base work on their systems 2016-01-15 18:32:47 +01:00
Jace 97e12ff550 Made EntityFileParser::MergeEntities return the base entity that was created, and also take an optional parent entity to create it under. 2016-01-15 18:31:32 +01:00
Jace 0469460029 Input binding format changed to allow custom values for bindings. Relevant code must clamp input values to prevent speedhaxx! 2016-01-15 16:32:04 +01:00
Jocke db62d767ac Fixed bug in Client::parseSnapshot(). 2016-01-15 12:06:20 +01:00
verysecrethero e7da11fda4 Removed OctTreeTests since its too annoying to update them each time RenderSystem gets updated 2016-01-15 11:31:21 +01:00
verysecrethero 8f257b9a58 Merge remote-tracking branch 'origin/master' into CapturePointTake
# Conflicts:
#	src/Game/Game.cpp
#	src/Tests/ResourceManagerTest.cpp
2016-01-15 11:24:20 +01:00
verysecrethero c8fe6853c0 Removed ShootEvent from CapturePoint 2016-01-15 11:17:22 +01:00
verysecrethero 76a8b43ca3 Fixed logic for CapturePointSystem 2016-01-15 11:04:00 +01:00
Jocke 0bf756dc08 Merge remote-tracking branch 'origin/master' into Networking 2016-01-15 10:22:21 +01:00
Jace 567173c565 Merge branch 'master' into PlayerMovement
# Conflicts:
#	src/Engine/Rendering/RenderSystem.cpp
#	src/Game/Game.cpp
2016-01-14 18:24:34 +01:00
Jace 5e721325a4 Merge fixes 2016-01-14 18:20:51 +01:00
Jocke 696f44a673 Added logic for mapping between ServerEntityIDs and LocalEntityIDs removed old code that wasn't used.
Added 1 map to Client and renamed m_ServerToClientMap to m_ServerIDToClientID.

// Good to know
To keep this structure please use insertIntoServerClientMaps() when adding items to them.
m_ServerIDToClientID and m_ClientIDToServerID maps between server EntityIDs and local EntityIDs.
To see if a local EntityID exist in m_ClientIDToServerID use clientServerMapsHasEntity(EntityID clientEntityID);
To see if server EntityID exist in m_ServerIDToClientID use serverClientMapsHasEntity(EntityID serverEntityID);
2016-01-14 17:11:54 +01:00
Jace 3a4f378ac5 Merge remote-tracking branch 'origin/master' into PlayerMovement
# Conflicts:
#	src/Game/Game.cpp
2016-01-14 17:07:39 +01:00
Jace 6ad1839def Initial work on PlayerMovementSystem 2016-01-14 17:03:48 +01:00
Jace 986af01091 Fixed editor component fields with the same name across components being treated as the same value 2016-01-14 17:02:13 +01:00
Jace 99406c32cf Better error handling for EntityFilePreprocessor 2016-01-14 17:01:39 +01:00
Jace d34470256b EntityWrapper to uniquely identify entities and make using them a little easier 2016-01-14 15:43:19 +01:00
Jace 28392def79 Made string passing in World a little more effective 2016-01-14 15:42:55 +01:00
Jace 71d936f8d1 Start of a movement system with collisions against AABBs 2016-01-14 14:54:12 +01:00
verysecrethero 5e9a3774ab CapturePointSystem code has been refactored and some branches "optimized" 2016-01-14 10:23:27 +01:00
Jocke db18a45368 We are now sending EPlayerDamage events.
Client now listens to EPlayerDamage events and send them to Server.
Server publishes EPlayerDamage events received from Client.
2016-01-14 10:16:11 +01:00
Jocke a060640da3 Removed unnecessary unnecessary if in Client::OnInputCommand.
Change name from Server::parseEvent to Server::parseOnInputCommand
2016-01-13 18:00:12 +01:00
verysecrethero b8a41b7c13 Updated some CapturePointLogic in CapturePointSystem: reset timer on capture, being able to take back the progress the other team did on your capturepoint. TODO: refactor! 2016-01-13 17:07:49 +01:00
verysecrethero 9533920684 Fixed a few CodeStandard mistakes. Added CapturePointSystem to CMakeLists.txt since branch is no longer based on ShootEvent-branch 2016-01-13 16:13:57 +01:00
Jocke f47f913bf5 Added logic for sending input from Client to Server.
Fixed so that snapshots set their parent correctly. Will get problems if we have more components
than unsigned int max size, but that was already a problem.
Client now maps Entitys received from server with local Entitys by mapping their EntityIDs.
2016-01-13 16:09:16 +01:00
verysecrethero ed5ac2e923 6 new tests for CapturePointSystem have been created!
TODO: refactor CapturePointSystem
2016-01-13 15:58:52 +01:00
verysecrethero 7a8604bf2b CapturePointSystem now tracks and verifies if a capturePoint can be taken over. Also the time is changed faster the more players stand on the capturepoint (number*dt). Also took care of the problem when both teams have the same contested capturepoint.
Added variable in the CapturePoint component:  CapturePointNumber. This is needed since we cant know what capturepoint is next to be taken over otherwise.
Updated the CapturePointTest according to current CapturePointSystem
TODO: try to refactor code in CapturePointSystem
2016-01-13 15:58:52 +01:00
verysecrethero 3a1056a2c3 2 new Events: ECaptured, EWin
Added new variable in CapturePoint: IsHomeCapturePointForTeam
CapturePointSystem updated so -5 = team 2 owns it, +5 = team 1 owns it. Its also looking for a winner each update
Updated Test. TODO: better Tests
2016-01-13 15:58:52 +01:00
verysecrethero 59be714fdc 1 Component added: CapturePoint
1 System added: CapturePointSystem
1 Test added: CapturePointTest
added 1 variable in PlayerComponent (TeamNumber)
added 2 variables in CapturePoint (CaptureTimer,OwnedBy)
CapturePointSystem is now handling 2 events: OnTriggerTouch,OnTriggerLeave
Added the CapturePointSystem to Game.cpp
2016-01-13 15:58:52 +01:00
verysecrethero 147b116f20 Fixed typo backslash instead of slash in various classes (the includes) 2016-01-13 15:58:52 +01:00
verysecrethero f0b425614d Simplified PlayerSystem branches a lot! Thanks William! 2016-01-13 15:58:52 +01:00
verysecrethero 4b672b11e7 EquippedItem,Ammo got changed to int instead of double. Loading entities from map the new way in Tests. ComponentWrapper:s Name is now Type 2016-01-13 15:58:52 +01:00
verysecrethero e865971fdd EShoot: changed to string weaponType to int currentlyEquippedItem
PlayerSystem.h: added HeldItem enum
PlayerSystem.cpp: simplified writing doubles, uses HeldItem enum
ShootEventTest.cpp: simplified writing doubles
2016-01-13 15:58:52 +01:00
verysecrethero 878c71b56a Changed the comparison method in PlayerSystem since its currently using doubles 2016-01-13 15:58:52 +01:00
verysecrethero ec4d5fbfa8 xml/xsd files changed type to double. fixed cooldownbug in PlayerSystem. Added 4 tests in ShootEventTest and generalized it a lot 2016-01-13 15:58:52 +01:00
verysecrethero 184af95507 New Event: EShoot. New Components: PrimaryItem,SecondaryItem. New Test: ShootEventTest. Added LeftMouseRelease->Shoot in PlayerSystem
TODO: generalize the test
2016-01-13 15:58:52 +01:00
Jace d6ef527f25 Basic collisions using Octree. Seems buggy over octree boundaries. 2016-01-13 15:34:43 +01:00
Jace 8ed4ba1219 Added missing include for Octree 2016-01-13 12:16:35 +01:00
Jace 311475cbb6 Renamed all OctTree to Octree (More OCD) 2016-01-13 12:15:36 +01:00
Jace 8164a955d6 Renamed OctTree files to Octree (OCD to the max) 2016-01-13 12:15:09 +01:00
stiffly 7ae42a5bf7 Removed some comments. Basically did nothing 2016-01-06 11:39:32 +01:00
151 changed files with 4432 additions and 1706 deletions
+1 -1
Submodule assets updated: a3c92ac876...6ffb46e155
@@ -0,0 +1,24 @@
#ifndef CollidableOctreeSystem_h__
#define CollidableOctreeSystem_h__
#include "../Core/System.h"
#include "../Core/Octree.h"
#include "Collision.h"
class CollidableOctreeSystem : public ImpureSystem, public PureSystem
{
public:
CollidableOctreeSystem(EventBroker* eventBroker, Octree<AABB>* octree)
: System(eventBroker)
, PureSystem("Collidable")
, m_Octree(octree)
{ }
virtual void Update(World* world, double dt) override;
virtual void UpdateComponent(World* world, EntityWrapper& entity, ComponentWrapper& component, double dt) override;
private:
Octree<AABB>* m_Octree;
};
#endif
+11 -3
View File
@@ -6,11 +6,14 @@
//or you will get "fatal error C1189: #error: gl.h included before glew.h" //or you will get "fatal error C1189: #error: gl.h included before glew.h"
#include <vector> #include <vector>
#include <boost/optional.hpp>
#include "../Core/Ray.h" #include "../Core/Ray.h"
#include "../Core/AABB.h" #include "../Core/AABB.h"
#include "../Rendering/RawModel.h" #include "../Rendering/RawModel.h"
#include "../Core/Transform.h"
#include "../Core/Entity.h" #include "../Core/Entity.h"
#include "../Core/EntityWrapper.h"
class World; class World;
struct ComponentWrapper; struct ComponentWrapper;
@@ -43,6 +46,12 @@ bool RayVsModel(const Ray& ray,
float& outUCoord, float& outUCoord,
float& outVCoord); float& outVCoord);
bool AABBvsTriangles(const AABB& box,
const std::vector<RawModel::Vertex>& modelVertices,
const std::vector<unsigned int>& modelIndices,
const glm::mat4& modelMatrix,
glm::vec3& outResolutionVector);
//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.
@@ -50,9 +59,8 @@ bool AABBVsAABB(const AABB& a, const AABB& b);
bool AABBVsAABB(const AABB& a, const AABB& b, glm::vec3& minimumTranslation); bool AABBVsAABB(const AABB& a, const AABB& b, glm::vec3& minimumTranslation);
bool IsSameBoxProbably(const AABB& first, const AABB& second, const float epsilon = 0.0001f); bool IsSameBoxProbably(const AABB& first, const AABB& second, const float epsilon = 0.0001f);
//Returns true if the entity has a boundingbox. Outputs the aabb in [outBox]. // Calculates an absolute AABB from an entity AABB component
bool GetEntityBox(World* world, EntityID entity, AABB& outBox, bool forceBoxFromModel = false); boost::optional<AABB> EntityAbsoluteAABB(EntityWrapper& entity);
bool GetEntityBox(World* world, ComponentWrapper& AABBComponent, AABB& outBox);
} }
+8 -3
View File
@@ -8,22 +8,27 @@
#include "../Core/System.h" #include "../Core/System.h"
#include "../Core/EventBroker.h" #include "../Core/EventBroker.h"
#include "../Core/EKeyUp.h" #include "../Core/EKeyUp.h"
#include "../Core/Octree.h"
class CollisionSystem : public PureSystem class CollisionSystem : public PureSystem
{ {
public: public:
CollisionSystem(EventBroker* eventBroker) CollisionSystem(EventBroker* eventBroker, Octree<AABB>* octree)
: PureSystem(eventBroker, "AABB") : System(eventBroker)
, PureSystem("Collidable")
, m_Octree(octree)
, zPress(false) , zPress(false)
{ {
//TODO: Debug stuff, remove later. //TODO: Debug stuff, remove later.
EVENT_SUBSCRIBE_MEMBER(m_EKeyUp, &CollisionSystem::OnKeyUp); EVENT_SUBSCRIBE_MEMBER(m_EKeyUp, &CollisionSystem::OnKeyUp);
} }
virtual void UpdateComponent(World* world, ComponentWrapper& cAABB, double dt) override; virtual void UpdateComponent(World* world, EntityWrapper& entity, ComponentWrapper& component, double dt) override;
private: private:
Octree<AABB>* m_Octree;
bool zPress; bool zPress;
EventRelay<CollisionSystem, Events::KeyUp> m_EKeyUp; EventRelay<CollisionSystem, Events::KeyUp> m_EKeyUp;
bool OnKeyUp(const Events::KeyUp &event); bool OnKeyUp(const Events::KeyUp &event);
}; };
+20 -4
View File
@@ -6,6 +6,7 @@
#include "../Core/System.h" #include "../Core/System.h"
#include "../Core/EventBroker.h" #include "../Core/EventBroker.h"
#include "../Core/Octree.h"
#include "ETrigger.h" #include "ETrigger.h"
class AABB; class AABB;
@@ -13,16 +14,31 @@ class AABB;
class TriggerSystem : public PureSystem class TriggerSystem : public PureSystem
{ {
public: public:
TriggerSystem(EventBroker* eventBroker) TriggerSystem(EventBroker* eventBroker, Octree<AABB>* octree)
: PureSystem(eventBroker, "Trigger") : System(eventBroker)
{} , PureSystem("Trigger")
, m_Octree(octree)
{
EVENT_SUBSCRIBE_MEMBER(m_ETouch, &TriggerSystem::OnTouch);
EVENT_SUBSCRIBE_MEMBER(m_EEnter, &TriggerSystem::OnEnter);
EVENT_SUBSCRIBE_MEMBER(m_ELeave, &TriggerSystem::OnLeave);
}
virtual void UpdateComponent(World* world, ComponentWrapper& collision, double dt) override; virtual void UpdateComponent(World* world, EntityWrapper& entity, ComponentWrapper& component, double dt) override;
private: private:
Octree<AABB>* m_Octree;
std::unordered_map<EntityID, std::unordered_set<EntityID>> m_EntitiesTouchingTrigger; std::unordered_map<EntityID, std::unordered_set<EntityID>> m_EntitiesTouchingTrigger;
std::unordered_map<EntityID, std::unordered_set<EntityID>> m_EntitiesCompletelyInTrigger; std::unordered_map<EntityID, std::unordered_set<EntityID>> m_EntitiesCompletelyInTrigger;
//TODO: Only exists for debug purposes, remove later.
EventRelay<TriggerSystem, Events::TriggerEnter> m_EEnter;
bool OnEnter(const Events::TriggerEnter &event);
EventRelay<TriggerSystem, Events::TriggerTouch> m_ETouch;
bool OnTouch(const Events::TriggerTouch &event);
EventRelay<TriggerSystem, Events::TriggerLeave> m_ELeave;
bool OnLeave(const Events::TriggerLeave &event);
//True if leave event was thrown. //True if leave event was thrown.
bool throwLeaveIfWasInTrigger(std::unordered_set<EntityID>& triggerSet, EntityID pId, EntityID tId); bool throwLeaveIfWasInTrigger(std::unordered_set<EntityID>& triggerSet, EntityID pId, EntityID tId);
template<typename Event> template<typename Event>
+1
View File
@@ -1,5 +1,6 @@
#include <memory> #include <memory>
#include <string> #include <string>
#include <sstream>
#include <vector> #include <vector>
#include <map> #include <map>
#include <unordered_map> #include <unordered_map>
+3 -3
View File
@@ -11,18 +11,18 @@ public:
AABB(const glm::vec3& minPos, const glm::vec3& maxPos); AABB(const glm::vec3& minPos, const glm::vec3& maxPos);
AABB(const glm::vec4& minPos, const glm::vec4& maxPos); AABB(const glm::vec4& minPos, const glm::vec4& maxPos);
//No checks are made. Size must consist of non-negative numbers. //No checks are made. Size must consist of non-negative numbers.
virtual void CreateFromCenter(const glm::vec3& center, const glm::vec3& size); static AABB FromOriginSize(const glm::vec3& origin, const glm::vec3& size);
virtual ~AABB(); virtual ~AABB();
const glm::vec3& MinCorner() const { return m_MinCorner; } const glm::vec3& MinCorner() const { return m_MinCorner; }
const glm::vec3& MaxCorner() const { return m_MaxCorner; } const glm::vec3& MaxCorner() const { return m_MaxCorner; }
const glm::vec3& Center() const { return m_Center; } const glm::vec3& Origin() const { return m_Origin; }
const glm::vec3 Size() const { return 2.0f * m_HalfSize; } const glm::vec3 Size() const { return 2.0f * m_HalfSize; }
const glm::vec3& HalfSize() const { return m_HalfSize; } const glm::vec3& HalfSize() const { return m_HalfSize; }
private: private:
glm::vec3 m_MinCorner; glm::vec3 m_MinCorner;
glm::vec3 m_MaxCorner; glm::vec3 m_MaxCorner;
glm::vec3 m_Center; glm::vec3 m_Origin;
glm::vec3 m_HalfSize; glm::vec3 m_HalfSize;
}; };
+4 -2
View File
@@ -9,7 +9,8 @@ struct ComponentInfo
{ {
std::string Annotation; std::string Annotation;
unsigned int Allocation = 0; unsigned int Allocation = 0;
unsigned int Stride = 0; std::map<std::string, std::string> FieldAnnotations;
std::map<std::string, std::map<std::string, int>> FieldEnumDefinitions;
}; };
struct Field_t struct Field_t
@@ -23,8 +24,9 @@ struct ComponentInfo
std::string Name; std::string Name;
std::unordered_map<std::string, Field_t> Fields; std::unordered_map<std::string, Field_t> Fields;
std::vector<std::string> FieldsInOrder; std::vector<std::string> FieldsInOrder;
Meta_t Meta; unsigned int Stride = 0;
std::shared_ptr<char> Defaults = nullptr; std::shared_ptr<char> Defaults = nullptr;
std::shared_ptr<Meta_t> Meta = nullptr;
}; };
template<> template<>
+2 -1
View File
@@ -43,7 +43,7 @@ public:
ComponentPool(const ::ComponentInfo& ci) ComponentPool(const ::ComponentInfo& ci)
: m_ComponentInfo(ci) : m_ComponentInfo(ci)
, m_Pool(ci.Meta.Allocation, sizeof(EntityID) + ci.Meta.Stride) , m_Pool(ci.Meta->Allocation, sizeof(EntityID) + ci.Stride)
{ } { }
ComponentPool(const ComponentPool& other) = delete; ComponentPool(const ComponentPool& other) = delete;
ComponentPool(const ComponentPool&& other) = delete; ComponentPool(const ComponentPool&& other) = delete;
@@ -61,6 +61,7 @@ public:
iterator begin() const; iterator begin() const;
iterator end() const; iterator end() const;
size_t size() const;
//Dumps information about what the pool memory looks like right now //Dumps information about what the pool memory looks like right now
//into an output stream (e.g. file/std::cout, anything that has an operator<<) //into an output stream (e.g. file/std::cout, anything that has an operator<<)
+32 -19
View File
@@ -18,22 +18,32 @@ struct ComponentWrapper
const ::EntityID EntityID; const ::EntityID EntityID;
char* Data; char* Data;
template <typename T> int Enum(const char* fieldName, const char* enumKey)
T& Property(std::string name)
{ {
unsigned int offset = Info.Fields.at(name).Offset; return Info.Meta->FieldEnumDefinitions.at(fieldName).at(enumKey);
return *reinterpret_cast<T*>(&Data[offset]);
} }
template <typename T> template <typename T>
void SetProperty(std::string name, const T value) { Property<T>(name) = value; } T& Field(std::string name)
{
const ComponentInfo::Field_t& field = Info.Fields.at(name);
if (sizeof(T) > field.Stride) {
std::stringstream message;
message << "Type size of \"" << typeid(T).name() << "\" doesn't match size of component field \"" << Info.Name << "." << name << "\"!";
throw new std::runtime_error(message.str().c_str());
}
return *reinterpret_cast<T*>(&Data[field.Offset]);
}
template <typename T>
void SetField(std::string name, const T value) { Field<T>(name) = value; }
//template <typename T> //template <typename T>
//void SetProperty(std::string name, T& value) { Property<T>(name) = value; } //void SetField(std::string name, T& value) { Field<T>(name) = value; }
// Specialization for string literals // Specialization for string literals
template <std::size_t N> template <std::size_t N>
void SetProperty(std::string name, const char(&value)[N]) { Property<std::string>(name) = std::string(value); } void SetField(std::string name, const char(&value)[N]) { Field<std::string>(name) = std::string(value); }
struct SubscriptProxy struct SubscriptProxy
{ {
friend struct ComponentWrapper; friend struct ComponentWrapper;
@@ -47,18 +57,21 @@ struct ComponentWrapper
std::string m_PropertyName; std::string m_PropertyName;
public: public:
template <typename T> // Return the integer value of an enum type key for this field
operator T&() { return m_Component->Property<T>(m_PropertyName); } int Enum(const char* enumKey) { return m_Component->Enum(m_PropertyName.c_str(), enumKey); }
template <typename T> template <typename T>
void operator=(const T val) { m_Component->SetProperty<T>(m_PropertyName, val); } operator T&() { return m_Component->Field<T>(m_PropertyName); }
template <typename T>
void operator=(const T val) { m_Component->SetField<T>(m_PropertyName, val); }
// TODO: Pass by reference and rvalue (universal reference?) // TODO: Pass by reference and rvalue (universal reference?)
//template <typename T> //template <typename T>
//void operator=(T& val) { m_Component->SetProperty<T>(m_PropertyName, val); } //void operator=(T& val) { m_Component->SetField<T>(m_PropertyName, val); }
// Specialization for string literals // Specialization for string literals
template<std::size_t N> template <std::size_t N>
void operator=(const char(&val)[N]) { m_Component->SetProperty<N>(m_PropertyName, val); } void operator=(const char(&val)[N]) { m_Component->SetField<N>(m_PropertyName, val); }
}; };
SubscriptProxy operator[](std::string propertyName) { return SubscriptProxy(this, propertyName); } SubscriptProxy operator[](std::string propertyName) { return SubscriptProxy(this, propertyName); }
}; };
@@ -71,22 +84,22 @@ public:
ComponentWrapperFactory(std::string componentTypeName, std::size_t allocation = 0) ComponentWrapperFactory(std::string componentTypeName, std::size_t allocation = 0)
{ {
m_ComponentInfo.Name = componentTypeName; m_ComponentInfo.Name = componentTypeName;
m_ComponentInfo.Meta.Allocation = allocation; m_ComponentInfo.Meta->Allocation = allocation;
} }
template <typename T> template <typename T>
void AddProperty(std::string fieldName, T defaultValue) void AddProperty(std::string fieldName, T defaultValue)
{ {
m_DefaultValues.push_back(defaultValue); m_DefaultValues.push_back(defaultValue);
m_ComponentInfo.Fields[fieldName].Name = typeid(T).name(); m_ComponentInfo.Fields[fieldName].Type = typeid(T).name();
m_ComponentInfo.Fields[fieldName].Offset = m_ComponentInfo.Meta.Stride; m_ComponentInfo.Fields[fieldName].Offset = m_ComponentInfo.Stride;
m_ComponentInfo.Fields[fieldName].Stride = sizeof(T); m_ComponentInfo.Fields[fieldName].Stride = sizeof(T);
m_ComponentInfo.Meta.Stride += sizeof(T); m_ComponentInfo.Stride += sizeof(T);
} }
ComponentInfo& Finalize() ComponentInfo& Finalize()
{ {
m_ComponentInfo.Defaults = std::shared_ptr<char>(new char[m_ComponentInfo.Meta.Stride]); m_ComponentInfo.Defaults = std::shared_ptr<char>(new char[m_ComponentInfo.Stride]);
std::size_t offset = 0; std::size_t offset = 0;
for (auto& val : m_DefaultValues) { for (auto& val : m_DefaultValues) {
memcpy(m_ComponentInfo.Defaults.get() + offset, val.Data.get(), val.Size); memcpy(m_ComponentInfo.Defaults.get() + offset, val.Data.get(), val.Size);
+20
View File
@@ -0,0 +1,20 @@
#ifndef ECaptured_h__
#define ECaptured_h__
#include "EventBroker.h"
#include "../Core/Entity.h"
#include "Engine/GLM.h"
namespace Events
{
//triggers when a capturePoint has been taken over
struct Captured : Event
{
int TeamNumberThatCapturedCapturePoint;
EntityID CapturePointID;
};
}
#endif
+20
View File
@@ -0,0 +1,20 @@
#ifndef EComponentAttached_h__
#define EComponentAttached_h__
#include "EventBroker.h"
#include "World.h"
#include "Entity.h"
#include "ComponentWrapper.h"
namespace Events
{
struct ComponentAttached : Event
{
EntityWrapper Entity;
ComponentWrapper Component;
};
}
#endif
+20
View File
@@ -0,0 +1,20 @@
#ifndef EWin_h__
#define EWin_h__
#include "EventBroker.h"
#include "../Core/Entity.h"
#include "Engine/GLM.h"
namespace Events
{
//triggers when a team has captured all capturePoints
struct Win : Event
{
//can be 0 = none, 1,2
int TeamThatWon;
};
}
#endif
+1
View File
@@ -4,4 +4,5 @@
typedef unsigned int EntityID; typedef unsigned int EntityID;
const static unsigned int EntityID_Invalid = -1; const static unsigned int EntityID_Invalid = -1;
#endif #endif
+8 -8
View File
@@ -285,7 +285,7 @@ private:
XSValue::Status status; XSValue::Status status;
XSValue* val = XSValue::getActualValue(child->getNodeValue(), XSValue::dt_integer, status); XSValue* val = XSValue::getActualValue(child->getNodeValue(), XSValue::dt_integer, status);
compInfo.Meta.Allocation += val->fData.fValue.f_int; compInfo.Meta->Allocation += val->fData.fValue.f_int;
} }
// Save documentation string // Save documentation string
@@ -293,11 +293,11 @@ private:
if (documentationTags->getLength() != 0) { if (documentationTags->getLength() != 0) {
auto child = documentationTags->item(0)->getFirstChild(); auto child = documentationTags->item(0)->getFirstChild();
if (child != nullptr) { if (child != nullptr) {
compInfo.Meta.Annotation = XSTR(child->getNodeValue()); compInfo.Meta->Annotation = XSTR(child->getNodeValue());
} }
} }
// TODO: Parse annotation string XML // TODO: Parse annotation string XML
// compInfo.Meta.Allocation = ... // compInfo.Meta->Allocation = ...
} else { } else {
std::cout << "Warning: Component is missing an annotation!" << std::endl; std::cout << "Warning: Component is missing an annotation!" << std::endl;
} }
@@ -344,7 +344,7 @@ private:
fieldOffset += getTypeStride(type); fieldOffset += getTypeStride(type);
} }
compInfo.Meta.Stride = fieldOffset; compInfo.Stride = fieldOffset;
m_ComponentInfo[compInfo.Name] = compInfo; m_ComponentInfo[compInfo.Name] = compInfo;
} }
} }
@@ -367,14 +367,14 @@ private:
std::string componentName = XSTR(component->getLocalName()); std::string componentName = XSTR(component->getLocalName());
auto& compInfo = m_ComponentInfo.at(componentName); auto& compInfo = m_ComponentInfo.at(componentName);
compInfo.Meta.Allocation += 1; compInfo.Meta->Allocation += 1;
} }
std::cout << "COMPONENT INFO" << std::endl; std::cout << "COMPONENT INFO" << std::endl;
for (auto& pair : m_ComponentInfo) { for (auto& pair : m_ComponentInfo) {
ComponentInfo& ci = pair.second; ComponentInfo& ci = pair.second;
std::cout << "Component: " << ci.Name << " (" << ci.Meta.Annotation << ")" << std::endl; std::cout << "Component: " << ci.Name << " (" << ci.Meta->Annotation << ")" << std::endl;
std::cout << " Allocation: " << ci.Meta.Allocation << std::endl; std::cout << " Allocation: " << ci.Meta->Allocation << std::endl;
std::cout << " Fields:" << std::endl; std::cout << " Fields:" << std::endl;
// Calculate component size // Calculate component size
@@ -393,7 +393,7 @@ private:
cs.ComponentName = ci.Name; cs.ComponentName = ci.Name;
cs.Stride = stride; cs.Stride = stride;
cs.Info = ci; cs.Info = ci;
cs.Data = new char[stride*ci.Meta.Allocation]; cs.Data = new char[stride*ci.Meta->Allocation];
m_ComponentStore[cs.ComponentName] = cs; m_ComponentStore[cs.ComponentName] = cs;
} }
} }
+18 -147
View File
@@ -73,88 +73,15 @@ public:
ComponentField ComponentField
}; };
EntityFileSAXHandler(const EntityFileHandler* handler, xercesc::SAX2XMLReader* reader) EntityFileSAXHandler(const EntityFileHandler* handler, xercesc::SAX2XMLReader* reader);
: m_Handler(handler)
, m_Reader(reader)
{
// 0 is imaginary world entity
m_EntityStack.push(0);
m_StateStack.push(State::Unknown);
}
void startElement(const XMLCh* const _uri, const XMLCh* const _localName, const XMLCh* const _qname, const xercesc::Attributes& attrs) override void startElement(const XMLCh* const _uri, const XMLCh* const _localName, const XMLCh* const _qname, const xercesc::Attributes& attrs) override;
{ void characters(const XMLCh* const chars, const XMLSize_t length) override;
std::string name = XS::ToString(_localName); void endElement(const XMLCh* const _uri, const XMLCh* const _localName, const XMLCh* const _qname) override;
if (m_StateStack.top() == State::Unknown || m_StateStack.top() == State::Entity) { void warning(const xercesc::SAXParseException& e);
if (name == "Entity") { void error(const xercesc::SAXParseException& e);
m_StateStack.push(State::Entity); void fatalError(const xercesc::SAXParseException& e);
onStartEntity(attrs);
return;
}
if (name == "EntityRef") {
onStartEntityRef(attrs);
return;
}
}
std::string uri = XS::ToString(_uri);
if (m_StateStack.top() == State::Entity) {
if (uri == "components") {
m_StateStack.push(State::Component);
onStartComponent(name);
return;
}
}
if (m_StateStack.top() == State::Component) {
m_StateStack.push(State::ComponentField);
onStartComponentField(name, attrs);
return;
}
}
void characters(const XMLCh* const chars, const XMLSize_t length) override
{
if (m_StateStack.top() == State::ComponentField) {
char* transcoded = xercesc::XMLString::transcode(chars);
onFieldData(transcoded);
}
}
void endElement(const XMLCh* const _uri, const XMLCh* const _localName, const XMLCh* const _qname) override
{
std::string name = XS::ToString(_localName);
if (m_StateStack.top() == State::Entity) {
if (name == "Entity") {
m_StateStack.pop();
onEndEntity();
return;
}
}
std::string uri = XS::ToString(_uri);
if (m_StateStack.top() == State::Component) {
//if (uri == "components") {
m_StateStack.pop();
onEndComponent(name);
return;
//}
}
if (m_StateStack.top() == State::ComponentField) {
m_StateStack.pop();
onEndComponentField(name);
return;
}
}
void fatalError(const xercesc::SAXParseException& e)
{
XS::ToString s(e.getMessage());
LOG_ERROR("SAXParseException: %s", ((std::string)s).c_str());
//throw e;
}
private: private:
const EntityFileHandler* m_Handler; const EntityFileHandler* m_Handler;
@@ -168,73 +95,14 @@ private:
std::string m_CurrentField; std::string m_CurrentField;
std::map<std::string, std::string> m_CurrentAttributes; std::map<std::string, std::string> m_CurrentAttributes;
void onStartEntity(const xercesc::Attributes& attrs) void onStartEntity(const xercesc::Attributes& attrs);
{ void onEndEntity();
EntityID parent = m_EntityStack.top(); void onStartEntityRef(const xercesc::Attributes& attrs);
void onStartComponent(const std::string& name);
if (m_Handler->m_OnStartEntityCallback) { void onEndComponent(const std::string& name);
std::string name; void onStartComponentField(const std::string& field, const xercesc::Attributes& attrs);
auto xName = attrs.getValue(XS::ToXMLCh("name")); void onEndComponentField(const std::string& field);
if (xName != nullptr) { void onFieldData(char* data);
name = XS::ToString(xName);
}
m_Handler->m_OnStartEntityCallback(m_NextEntityID, parent, name);
}
m_EntityStack.push(m_NextEntityID);
m_NextEntityID++;
}
void onEndEntity()
{
m_EntityStack.pop();
}
void onStartEntityRef(const xercesc::Attributes& attrs)
{
std::string path = XS::ToString(attrs.getValue(XS::ToXMLCh("file")));
xercesc::SAX2XMLReader* parser = xercesc::XMLReaderFactory::createXMLReader();
parser->setContentHandler(this);
parser->setErrorHandler(this);
parser->parse(path.c_str());
delete parser;
}
void onStartComponent(const std::string& name)
{
//LOG_DEBUG(" Component: %s", name.c_str());
m_CurrentComponent = name;
if (m_Handler->m_OnStartComponentCallback) {
m_Handler->m_OnStartComponentCallback(m_EntityStack.top(), name);
}
}
void onEndComponent(const std::string& name) { }
void onStartComponentField(const std::string& field, const xercesc::Attributes& attrs)
{
//LOG_DEBUG(" Field: %s", field.c_str());
m_CurrentField = field;
m_CurrentAttributes.clear();
for (int i = 0; i < attrs.getLength(); i++) {
auto name = attrs.getQName(i);
auto value = attrs.getValue(name);
//LOG_DEBUG(" %s = %s", (char*)XS::ToString(name), (char*)XS::ToString(value));
m_CurrentAttributes[XS::ToString(name).operator std::string()] = XS::ToString(value).operator std::string();
}
if (m_Handler->m_OnStartFieldCallback) {
m_Handler->m_OnStartFieldCallback(m_EntityStack.top(), m_CurrentComponent, field, m_CurrentAttributes);
}
}
void onEndComponentField(const std::string& field) { }
void onFieldData(char* data)
{
//LOG_DEBUG(" Data: %s", data);
if (m_Handler->m_OnStartFieldDataCallback) {
m_Handler->m_OnStartFieldDataCallback(m_EntityStack.top(), m_CurrentComponent, m_CurrentField, data);
}
xercesc::XMLString::release(&data);
}
}; };
class EntityFileXMLErrorHandler : public xercesc::ErrorHandler class EntityFileXMLErrorHandler : public xercesc::ErrorHandler
@@ -269,6 +137,7 @@ private:
class EntityFile : public Resource class EntityFile : public Resource
{ {
friend class ResourceManager; friend class ResourceManager;
friend class EntityFileSAXHandler;
private: private:
EntityFile(boost::filesystem::path path); EntityFile(boost::filesystem::path path);
~EntityFile(); ~EntityFile();
@@ -288,6 +157,8 @@ private:
xercesc::SAX2XMLReader* m_SAX2XMLReader; xercesc::SAX2XMLReader* m_SAX2XMLReader;
//std::map<std::string, ::ComponentInfo> m_ComponentInfo; //std::map<std::string, ::ComponentInfo> m_ComponentInfo;
//std::vector<std::string> m_EntityReferences; //std::vector<std::string> m_EntityReferences;
static void setReaderFeatures(xercesc::SAX2XMLReader* reader);
}; };
#endif #endif
+2 -1
View File
@@ -9,12 +9,13 @@ class EntityFileParser
public: public:
EntityFileParser(const EntityFile* entityFile); EntityFileParser(const EntityFile* entityFile);
void MergeEntities(World* world); EntityID MergeEntities(World* world, EntityID baseParent = EntityID_Invalid);
private: private:
const EntityFile* m_EntityFile; const EntityFile* m_EntityFile;
EntityFileHandler m_Handler; EntityFileHandler m_Handler;
World* m_World = nullptr; World* m_World = nullptr;
EntityID m_FirstEntity = EntityID_Invalid;
// Maps EntityIDs local to the file to real IDs in the world after they've been // Maps EntityIDs local to the file to real IDs in the world after they've been
// created in order to resolve parent-child relationships. // created in order to resolve parent-child relationships.
std::map<EntityID, EntityID> m_EntityIDMapper; std::map<EntityID, EntityID> m_EntityIDMapper;
@@ -5,6 +5,7 @@
#include <xercesc/framework/psvi/XSComplexTypeDefinition.hpp> #include <xercesc/framework/psvi/XSComplexTypeDefinition.hpp>
#include <xercesc/framework/psvi/XSParticle.hpp> #include <xercesc/framework/psvi/XSParticle.hpp>
#include <xercesc/framework/psvi/XSModelGroup.hpp> #include <xercesc/framework/psvi/XSModelGroup.hpp>
#include <xercesc/framework/psvi/XSModelGroupDefinition.hpp>
#include <xercesc/framework/psvi/XSAnnotation.hpp> #include <xercesc/framework/psvi/XSAnnotation.hpp>
#include <xercesc/framework/psvi/XSValue.hpp> #include <xercesc/framework/psvi/XSValue.hpp>
#include <xercesc/framework/MemBufFormatTarget.hpp> #include <xercesc/framework/MemBufFormatTarget.hpp>
@@ -31,6 +32,7 @@ private:
void onStartComponent(EntityID entity, std::string type); void onStartComponent(EntityID entity, std::string type);
void parseComponentInfo(); void parseComponentInfo();
void parseDefaults(); void parseDefaults();
std::string parseAnnotationXML(const XMLCh* xml);
}; };
#endif #endif
+32
View File
@@ -0,0 +1,32 @@
#ifndef EntityWrapper_h__
#define EntityWrapper_h__
#include <boost/optional.hpp>
#include "ComponentWrapper.h"
class World;
struct EntityWrapper
{
EntityWrapper()
: World(nullptr)
, ID(EntityID_Invalid)
{ }
EntityWrapper(::World* world, EntityID id)
: World(world)
, ID(id)
{ }
::World* World;
EntityID ID;
static const EntityWrapper Invalid;
bool HasComponent(const std::string& componentName);
ComponentWrapper operator[](const std::string& componentName);
bool operator==(const EntityWrapper& e);
explicit operator EntityID();
};
#endif
+2 -2
View File
@@ -43,7 +43,7 @@ template <typename ContextType, typename EventType>
class EventRelay : public BaseEventRelay class EventRelay : public BaseEventRelay
{ {
public: public:
typedef std::function<bool(const EventType&)> CallbackType; typedef std::function<bool(EventType&)> CallbackType;
EventRelay() EventRelay()
: m_Callback(nullptr) : m_Callback(nullptr)
@@ -65,7 +65,7 @@ template <typename ContextType, typename EventType>
bool EventRelay<ContextType, EventType>::Receive(const std::shared_ptr<Event> event) bool EventRelay<ContextType, EventType>::Receive(const std::shared_ptr<Event> event)
{ {
if (m_Callback != nullptr) { if (m_Callback != nullptr) {
return m_Callback(*static_cast<const EventType*>(event.get())); return m_Callback(*static_cast<EventType*>(event.get()));
} else { } else {
return false; return false;
} }
-104
View File
@@ -1,104 +0,0 @@
#ifndef OctTree_h__
#define OctTree_h__
#include "Core/AABB.h"
class Ray;
class OctTree
{
public:
struct Output
{
float CollideDistance;
};
OctTree();
~OctTree();
//For the root OctTree, [octTreeBounds] should be a box containing the entire level.
OctTree(const AABB& octTreeBounds, int subDivisions);
//We cannot copy the OctTree as of now, because of the recursive dynamic allocation.
//Define these if the OctTree suddenly needs to be copied, think of the children OctChild* ptrs.
OctTree(const OctTree& other) = delete;
OctTree(const OctTree&& other) = delete;
OctTree& operator= (const OctTree& other) = delete;
//Add a dynamic object (one that moves around) into the tree.
void AddDynamicObject(const AABB& box);
//Add a static object (that does not move) into the tree.
void AddStaticObject(const AABB& box);
//Get the boxes that are in the same area as the input [box], the boxes are put in [outBoxes].
void BoxesInSameRegion(const AABB& box, std::vector<AABB>& outBoxes);
//Empty the tree of all objects, static and dynamic.
void ClearObjects();
//Empty the tree of all dynamic objects. Static objects remain in the tree.
void ClearDynamicObjects();
//Returns true if the ray collides with something in the tree. Result is written to [data].
bool RayCollides(const Ray& ray, Output& data);
//Returns true if the box collides with something in the tree.
//On collision with a box, that box is written to [outBoxIntersected].
//Note: More efficient than calling BoxesInSameRegion from outside and testing there.
bool BoxCollides(const AABB& boxToTest, AABB& outBoxIntersected);
private:
struct OctChild; //Fwd declaration;
struct ContainedObject
{
ContainedObject()
: Box(AABB())
, Checked(false)
{}
ContainedObject(AABB box)
: Box(box)
, Checked(false)
{}
AABB Box;
bool Checked;
};
OctChild* m_Root;
std::vector<ContainedObject> m_StaticObjects;
std::vector<ContainedObject> m_DynamicObjects;
bool m_UpdatedOnce;
unsigned int m_BoxID;
glm::vec3 m_PrevPos;
glm::quat m_PrevOri;
void falsifyObjectChecks();
struct OctChild
{
~OctChild();
OctChild(const AABB& octTreeBounds,
int subDivisions,
std::vector<OctTree::ContainedObject>& staticObjects,
std::vector<OctTree::ContainedObject>& dynamicObjects);
OctChild(const OctChild& other) = delete;
OctChild(const OctChild&& other) = delete;
OctChild& operator= (const OctChild& other) = delete;
void AddDynamicObject(const AABB& box);
void AddStaticObject(const AABB& box);
void BoxesInSameRegion(const AABB& box, std::vector<AABB>& outBoxes) const;
void ClearObjects();
void ClearDynamicObjects();
bool RayCollides(const Ray& ray, Output& data) const;
bool BoxCollides(const AABB& boxToTest, AABB& outBoxIntersected) const;
OctChild* m_Children[8];
//Indices into the lists in OctTree.
std::vector<int> m_StaticObjIndices;
std::vector<int> m_DynamicObjIndices;
AABB m_Box;
//Reference to the lists in OctTree.
std::vector<OctTree::ContainedObject>& m_StaticObjectsRef;
std::vector<OctTree::ContainedObject>& m_DynamicObjectsRef;
inline bool hasChildren() const;
int childIndexContainingPoint(const glm::vec3& point) const;
std::vector<int> childIndicesContainingBox(const AABB& box) const;
};
};
#endif
+233
View File
@@ -0,0 +1,233 @@
#ifndef Octree_h__
#define Octree_h__
#include <type_traits>
#include "../Common.h"
#include "AABB.h"
//Fwd declarations.
class Ray;
namespace OctSpace
{
struct Output;
struct ContainedObject;
struct Child;
}
//T needs to be AABB, or inherit from AABB.
//T also needs to have a default constructor.
template<typename T>
class Octree
{
public:
Octree() = delete;
~Octree();
//For the root Octree, [octreeBounds] should be a box containing the entire level.
Octree(const AABB& octreeBounds, int subDivisions);
//We cannot copy the Octree as of now, because of the recursive dynamic allocation.
//Define these if the Octree suddenly needs to be copied, think of the children Child* ptrs.
Octree(const Octree& other) = delete;
Octree(const Octree&& other) = delete;
Octree& operator= (const Octree& other) = delete;
//Add a dynamic object (one that moves around) into the tree.
void AddDynamicObject(const T& object);
//Add a static object (that does not move) into the tree.
void AddStaticObject(const T& object);
//Get the objects that are in the same area as the input [box], the objects are put in [outObjects].
//The type Box must be AABB, or inherit from AABB.
template<typename Box>
void ObjectsInSameRegion(const Box& box, std::vector<T>& outObjects);
//Empty the tree of all objects, static and dynamic.
void ClearObjects();
//Empty the tree of all dynamic objects. Static objects remain in the tree.
void ClearDynamicObjects();
//Returns true if the ray collides with something in the tree. Result is written to [data].
bool RayCollides(const Ray& ray, OctSpace::Output& data);
//Returns true if the box collides with something in the tree.
//On collision with a box, that box is written to [outBoxIntersected].
//Note: More efficient than calling ObjectsInSameRegion from outside and testing there.
bool BoxCollides(const AABB& boxToTest, AABB& outBoxIntersected);
private:
OctSpace::Child* m_Root;
std::vector<OctSpace::ContainedObject> m_StaticObjects;
std::vector<OctSpace::ContainedObject> m_DynamicObjects;
void falsifyObjectChecks();
};
namespace OctSpace
{
struct Output
{
float CollideDistance;
};
struct ContainedObject
{
ContainedObject()
: Box(nullptr)
, Checked(false)
{}
template<typename BoxlikeObject>
ContainedObject(const BoxlikeObject& box)
: Box(new BoxlikeObject(box))
, Checked(false)
{}
std::unique_ptr<AABB> Box;
bool Checked;
};
struct Child
{
~Child();
Child(const AABB& octTreeBounds,
int subDivisions,
std::vector<ContainedObject>& staticObjects,
std::vector<ContainedObject>& dynamicObjects);
Child(const Child& other) = delete;
Child(const Child&& other) = delete;
Child& operator= (const Child& other) = delete;
void AddDynamicObject(const AABB& box);
void AddStaticObject(const AABB& box);
template<typename T, typename Box>
void ObjectsInSameRegion(const Box& box, std::vector<T>& outObjects) const;
void ClearObjects();
void ClearDynamicObjects();
bool RayCollides(const Ray& ray, Output& data) const;
bool BoxCollides(const AABB& boxToTest, AABB& outBoxIntersected) const;
Child* m_Children[8];
//Indices into the lists in Octree.
std::vector<int> m_StaticObjIndices;
std::vector<int> m_DynamicObjIndices;
AABB m_Box;
//Reference to the lists in Octree.
std::vector<ContainedObject>& m_StaticObjectsRef;
std::vector<ContainedObject>& m_DynamicObjectsRef;
inline bool hasChildren() const;
int childIndexContainingPoint(const glm::vec3& point) const;
std::vector<int> childIndicesContainingBox(const AABB& box) const;
};
}
template<typename T>
Octree<T>::Octree(const AABB& octTreeBounds, int subDivisions)
: m_Root(new OctSpace::Child(octTreeBounds, subDivisions, m_StaticObjects, m_DynamicObjects))
{
static_assert(std::is_base_of<AABB, T>::value, "template argument type T in Octree must be a subclass of AABB.");
}
template<typename T>
Octree<T>::~Octree()
{
delete m_Root;
}
template<typename T>
void Octree<T>::AddDynamicObject(const T& object)
{
m_Root->AddDynamicObject(object);
m_DynamicObjects.emplace_back(object);
}
template<typename T>
void Octree<T>::AddStaticObject(const T& object)
{
m_Root->AddStaticObject(object);
m_StaticObjects.emplace_back(object);
}
template<typename T>
template<typename Box>
void Octree<T>::ObjectsInSameRegion(const Box& box, std::vector<T>& outObjects)
{
static_assert(std::is_base_of<AABB, Box>::value, "template argument type Box in Octree<T>::ObjectsInSameRegion must be a subclass of AABB.");
falsifyObjectChecks();
m_Root->ObjectsInSameRegion(box, outObjects);
}
template<typename T>
void Octree<T>::ClearObjects()
{
m_StaticObjects.clear();
m_DynamicObjects.clear();
m_Root->ClearObjects();
}
template<typename T>
void Octree<T>::ClearDynamicObjects()
{
m_DynamicObjects.clear();
m_Root->ClearDynamicObjects();
}
template<typename T>
bool Octree<T>::RayCollides(const Ray& ray, OctSpace::Output& data)
{
falsifyObjectChecks();
data.CollideDistance = -1;
return m_Root->RayCollides(ray, data);
}
template<typename T>
bool Octree<T>::BoxCollides(const AABB& boxToTest, AABB& outBoxIntersected)
{
falsifyObjectChecks();
return m_Root->BoxCollides(boxToTest, outBoxIntersected);
}
template<typename T>
void Octree<T>::falsifyObjectChecks()
{
for (auto& obj : m_StaticObjects) {
obj.Checked = false;
}
for (auto& obj : m_DynamicObjects) {
obj.Checked = false;
}
}
template<typename T, typename Box>
void OctSpace::Child::ObjectsInSameRegion(const Box& box, std::vector<T>& outObjects) const
{
if (hasChildren()) {
for (auto i : childIndicesContainingBox(box)) {
m_Children[i]->ObjectsInSameRegion(box, outObjects);
}
} else {
size_t startIndex = outObjects.size();
int numDuplicates = 0;
outObjects.resize(outObjects.size() + m_StaticObjIndices.size() + m_DynamicObjIndices.size());
for (size_t i = 0; i < m_StaticObjIndices.size(); ++i) {
ContainedObject& obj = m_StaticObjectsRef[m_StaticObjIndices[i]];
if (obj.Checked) {
++numDuplicates;
} else {
obj.Checked = true;
outObjects[startIndex + i - numDuplicates] = *static_cast<T*>(obj.Box.get());
}
}
for (size_t i = 0; i < m_DynamicObjIndices.size(); ++i) {
ContainedObject& obj = m_DynamicObjectsRef[m_DynamicObjIndices[i]];
if (obj.Checked) {
++numDuplicates;
} else {
obj.Checked = true;
outObjects[startIndex + i - numDuplicates] = *static_cast<T*>(obj.Box.get());
}
}
for (size_t i = 0; i < numDuplicates; ++i) {
outObjects.pop_back();
}
}
}
#endif
+10 -9
View File
@@ -3,6 +3,7 @@
#include "EventBroker.h" #include "EventBroker.h"
#include "World.h" #include "World.h"
#include "EntityWrapper.h"
#include "ComponentWrapper.h" #include "ComponentWrapper.h"
class System class System
@@ -10,6 +11,9 @@ class System
friend class SystemPipeline; friend class SystemPipeline;
protected: protected:
System()
: m_EventBroker(nullptr)
{ }
System(EventBroker* eventBroker) System(EventBroker* eventBroker)
: m_EventBroker(eventBroker) : m_EventBroker(eventBroker)
{ } { }
@@ -18,30 +22,27 @@ protected:
EventBroker* m_EventBroker; EventBroker* m_EventBroker;
}; };
class PureSystem : public System class PureSystem : public virtual System
{ {
friend class SystemPipeline; friend class SystemPipeline;
protected: protected:
PureSystem(EventBroker* eventBroker, std::string componentType) PureSystem(std::string componentType)
: System(eventBroker) : m_ComponentType(componentType)
, m_ComponentType(componentType)
{ } { }
virtual ~PureSystem() = default; virtual ~PureSystem() = default;
const std::string m_ComponentType; const std::string m_ComponentType;
virtual void UpdateComponent(World* world, ComponentWrapper& component, double dt) = 0; virtual void UpdateComponent(World* world, EntityWrapper& entity, ComponentWrapper& component, double dt) = 0;
}; };
class ImpureSystem : public System class ImpureSystem : public virtual System
{ {
friend class SystemPipeline; friend class SystemPipeline;
protected: protected:
ImpureSystem(EventBroker* eventBroker) ImpureSystem() = default;
: System(eventBroker)
{ }
virtual ~ImpureSystem() = default; virtual ~ImpureSystem() = default;
virtual void Update(World* world, double dt) = 0; virtual void Update(World* world, double dt) = 0;
+8 -8
View File
@@ -32,8 +32,8 @@ public:
System* system = new T(m_EventBroker, args...); System* system = new T(m_EventBroker, args...);
group.Systems[typeid(T).name()] = system; group.Systems[typeid(T).name()] = system;
if (std::is_base_of<PureSystem, T>::value) { PureSystem* pureSystem = dynamic_cast<PureSystem*>(system);
PureSystem* pureSystem = static_cast<PureSystem*>(system); if (pureSystem != nullptr) {
if (!pureSystem->m_ComponentType.empty()) { if (!pureSystem->m_ComponentType.empty()) {
group.PureSystems[pureSystem->m_ComponentType].push_back(pureSystem); group.PureSystems[pureSystem->m_ComponentType].push_back(pureSystem);
} else { } else {
@@ -41,8 +41,8 @@ public:
} }
} }
if (std::is_base_of<ImpureSystem, T>::value) { ImpureSystem* impureSystem = dynamic_cast<ImpureSystem*>(system);
ImpureSystem* impureSystem = static_cast<ImpureSystem*>(system); if (impureSystem != nullptr) {
group.ImpureSystems.push_back(impureSystem); group.ImpureSystems.push_back(impureSystem);
} }
} }
@@ -56,6 +56,9 @@ public:
} }
// Update // Update
for (auto& system : group.ImpureSystems) {
system->Update(world, dt);
}
for (auto& pair : group.PureSystems) { for (auto& pair : group.PureSystems) {
const std::string& componentName = pair.first; const std::string& componentName = pair.first;
auto& systems = pair.second; auto& systems = pair.second;
@@ -65,13 +68,10 @@ public:
} }
for (auto& component : *pool) { for (auto& component : *pool) {
for (auto& system : systems) { for (auto& system : systems) {
system->UpdateComponent(world, component, dt); system->UpdateComponent(world, EntityWrapper(world, component.EntityID), component, dt);
} }
} }
} }
for (auto& system : group.ImpureSystems) {
system->Update(world, dt);
}
} }
} }
+7 -5
View File
@@ -21,19 +21,21 @@ public:
// Register a component type and allocate space for it // Register a component type and allocate space for it
void RegisterComponent(ComponentInfo& ci); void RegisterComponent(ComponentInfo& ci);
// Attach a component to an entity and fill it with default values // Attach a component to an entity and fill it with default values
ComponentWrapper AttachComponent(EntityID entity, std::string componentType); ComponentWrapper AttachComponent(EntityID entity, const std::string& componentType);
// Check if an entity has a component // Check if an entity has a component
bool HasComponent(EntityID entity, std::string componentType) const; bool HasComponent(EntityID entity, const std::string& componentType) const;
// Get a component of an entity // Get a component of an entity
ComponentWrapper GetComponent(EntityID entity, std::string componentType); ComponentWrapper GetComponent(EntityID entity, const std::string& componentType);
// Delete a component off an entity // Delete a component off an entity
void DeleteComponent(EntityID entity, std::string componentType); void DeleteComponent(EntityID entity, const std::string& componentType);
// Get all components of the specified type // Get all components of the specified type
const ComponentPool* GetComponents(std::string componentType); const ComponentPool* GetComponents(const std::string& componentType);
// Get entity parent // Get entity parent
EntityID GetParent(EntityID entity); EntityID GetParent(EntityID entity);
// Change the parent of an entity // Change the parent of an entity
void SetParent(EntityID entity, EntityID parent); void SetParent(EntityID entity, EntityID parent);
// Get children of an entity
const std::pair<std::unordered_multimap<EntityID, EntityID>::const_iterator, std::unordered_multimap<EntityID, EntityID>::const_iterator> GetChildren(EntityID entity);
// Get all component pools // Get all component pools
const std::unordered_map<std::string, ComponentPool*>& GetComponentPools() const { return m_ComponentPools; } const std::unordered_map<std::string, ComponentPool*>& GetComponentPools() const { return m_ComponentPools; }
// Get the entity children map // Get the entity children map
+1
View File
@@ -1,6 +1,7 @@
#ifndef InputProxy_h__ #ifndef InputProxy_h__
#define InputProxy_h__ #define InputProxy_h__
#include <boost/tokenizer.hpp>
#include "../Common.h" #include "../Common.h"
#include "../Core/ResourceManager.h" #include "../Core/ResourceManager.h"
#include "../Core/ConfigFile.h" #include "../Core/ConfigFile.h"
+28 -10
View File
@@ -3,9 +3,12 @@
#include <string> #include <string>
#include <ctime> #include <ctime>
#include <limits>
#include <queue>
#include <glm/common.hpp> #include <glm/common.hpp>
#include <boost/asio.hpp> #include <boost/asio.hpp>
#include <boost/shared_array.hpp>
#include "Network/Network.h" #include "Network/Network.h"
#include "Network/MessageType.h" #include "Network/MessageType.h"
@@ -15,6 +18,8 @@
#include "Core/EventBroker.h" #include "Core/EventBroker.h"
#include "Core/ConfigFile.h" #include "Core/ConfigFile.h"
#include "Input/EInputCommand.h" #include "Input/EInputCommand.h"
#include "Core/EPlayerDamage.h"
#include "Network/EInterpolate.h"
class Client : public Network class Client : public Network
{ {
@@ -32,8 +37,6 @@ private:
// Sending message to server logic // Sending message to server logic
int bytesRead = -1; int bytesRead = -1;
char readBuf[INPUTSIZE] = { 0 }; char readBuf[INPUTSIZE] = { 0 };
int snapshotInterval = 33;
std::clock_t previousSnapshotMessage = std::clock();
// Packet loss logic // Packet loss logic
unsigned int m_PacketID = 0; unsigned int m_PacketID = 0;
@@ -44,40 +47,55 @@ private:
World* m_World; World* m_World;
std::string m_PlayerName; std::string m_PlayerName;
int m_PlayerID = -1; int m_PlayerID = -1;
EntityID m_ServerEntityID = std::numeric_limits<EntityID>::max();
bool m_IsConnected = false;
// Server Client Lookup map
// Assumes that root node for client and server is EntityID 0.
// Don't Add items to these two maps with insert, use insertIntoServerClientMaps(EntityID, EntityID)!!!!
std::unordered_map<EntityID, EntityID> m_ServerIDToClientID;
std::unordered_map<EntityID, EntityID> m_ClientIDToServerID;
// Network logic // Network logic
PlayerDefinition m_PlayerDefinitions[MAXCONNECTIONS]; PlayerDefinition m_PlayerDefinitions[MAXCONNECTIONS];
SnapshotDefinitions m_NextSnapshot; SnapshotDefinitions m_NextSnapshot;
double m_DurationOfPingTime; double m_DurationOfPingTime;
std::clock_t m_StartPingTime; std::clock_t m_StartPingTime;
// Use to check if we should send disconnect message std::vector<Events::InputCommand> m_InputCommandBuffer;
// if game is turned of by closing window.
bool m_WasStarted = false;
// Private member functions // Private member functions
void readFromServer(); void readFromServer();
void sendSnapshotToServer();
int receive(char* data, size_t length); int receive(char* data, size_t length);
void send(Packet& packet); void send(Packet& packet);
void connect(); void connect();
void disconnect(); void disconnect();
void ping(); void ping();
void moveMessageHead(char*& data, size_t& length, size_t stepSize);
void parseMessageType(Packet& packet); void parseMessageType(Packet& packet);
void parseEventMessage(Packet& packet);
void updateFields(Packet& packet, const ComponentInfo& componentInfo, const EntityID& entityID, const std::string& componentType); void updateFields(Packet& packet, const ComponentInfo& componentInfo, const EntityID& entityID, const std::string& componentType);
void parseConnect(Packet& packet); void parseConnect(Packet& packet);
void parsePlayerConnected(Packet& packet);
void parsePing(); void parsePing();
void parseServerPing(); void parseServerPing();
void InterpolateFields(Packet & packet, const ComponentInfo & componentInfo, const EntityID & entityID, const std::string & componentType);
void parseSnapshot(Packet& packet); void parseSnapshot(Packet& packet);
void identifyPacketLoss(); void identifyPacketLoss();
bool isConnected(); bool hasServerTimedOut();
EntityID createPlayer(); EntityID createPlayer();
void sendInputCommands();
void becomePlayer();
// Mapping Logic
// Returns if local EntityID exist in map
bool clientServerMapsHasEntity(EntityID clientEntityID);
// Returns if server EntityID exist in map
bool serverClientMapsHasEntity(EntityID serverEntityID);
void insertIntoServerClientMaps(EntityID serverEntityID, EntityID clientEntityID);
// Events // Events
EventBroker* m_EventBroker; EventBroker* m_EventBroker;
EventRelay<Client, Events::InputCommand> m_EInputCommand; EventRelay<Client, Events::InputCommand> m_EInputCommand;
bool OnInputCommand(const Events::InputCommand &e); bool OnInputCommand(const Events::InputCommand& e);
EventRelay<Client, Events::PlayerDamage> m_EPlayeDamage;
bool OnPlayerDamage(const Events::PlayerDamage& e);
}; };
#endif #endif
+20
View File
@@ -0,0 +1,20 @@
#ifndef Events_Interpolate_h__
#define Events_Interpolate_h__
#include <boost/shared_array.hpp>
#include "Core/EventBroker.h"
#include "Core/Entity.h"
namespace Events
{
struct Interpolate : Event
{
EntityID Entity;
boost::shared_array<char> DataArray;
};
}
#endif
+4 -1
View File
@@ -11,7 +11,10 @@ enum class MessageType
ServerPing, ServerPing,
Message, Message,
Snapshot, Snapshot,
Event, OnInputCommand,
OnPlayerDamage,
PlayerConnected,
BecomePlayer
}; };
#endif #endif
+1
View File
@@ -7,6 +7,7 @@
#define MAXCONNECTIONS 8 #define MAXCONNECTIONS 8
#define INPUTSIZE 4097 #define INPUTSIZE 4097
#define TIMEOUTMS 15000
class Network class Network
{ {
+2 -1
View File
@@ -14,6 +14,7 @@ public:
Packet(MessageType type, unsigned int& packetID); Packet(MessageType type, unsigned int& packetID);
// Used to create packet from already existing data buffer. // Used to create packet from already existing data buffer.
Packet(char* data, const int sizeOfPacket); Packet(char* data, const int sizeOfPacket);
Packet(MessageType type);
~Packet(); ~Packet();
void Init(MessageType type, unsigned int& packetID); void Init(MessageType type, unsigned int& packetID);
@@ -49,7 +50,7 @@ public:
// Pops the first element as if it was a string. // Pops the first element as if it was a string.
std::string ReadString(); std::string ReadString();
char* ReadData(int SizeOfData); char* ReadData(int SizeOfData);
void ChangePacketID(unsigned int& packetID);
int Size() { return m_Offset; }; int Size() { return m_Offset; };
char* Data() { return m_Data; }; char* Data() { return m_Data; };
unsigned int DataReadSize() { return m_ReturnDataOffset; } unsigned int DataReadSize() { return m_ReturnDataOffset; }
@@ -6,6 +6,8 @@ struct PlayerDefinition {
int EntityID = -1; int EntityID = -1;
std::string Name = ""; std::string Name = "";
boost::asio::ip::udp::endpoint Endpoint; boost::asio::ip::udp::endpoint Endpoint;
unsigned int PacketID;
std::clock_t StopTime;
}; };
#endif #endif
+14 -13
View File
@@ -11,7 +11,9 @@
#include "Network/PlayerDefinition.h" #include "Network/PlayerDefinition.h"
#include "Core/World.h" #include "Core/World.h"
#include "Core/EventBroker.h" #include "Core/EventBroker.h"
#include "Network/Network.h" #include "../Network/Network.h"
#include "Input/EInputCommand.h"
#include "Core/EPlayerDamage.h"
class Server : public Network class Server : public Network
{ {
@@ -25,9 +27,10 @@ private:
boost::asio::ip::udp::endpoint m_ReceiverEndpoint; boost::asio::ip::udp::endpoint m_ReceiverEndpoint;
boost::asio::io_service m_IOService; boost::asio::io_service m_IOService;
boost::asio::ip::udp::socket m_Socket; boost::asio::ip::udp::socket m_Socket;
PlayerDefinition m_PlayerDefinitions[MAXCONNECTIONS];
// Sending messages to client logic // Sending messages to client logic
PlayerDefinition m_PlayerDefinitions[MAXCONNECTIONS];
std::vector<PlayerDefinition> m_ConnectedUsers;
char readBuffer[INPUTSIZE] = { 0 }; char readBuffer[INPUTSIZE] = { 0 };
int bytesRead = 0; int bytesRead = 0;
// time for previouse message // time for previouse message
@@ -41,40 +44,38 @@ private:
//Timers //Timers
std::clock_t m_StartPingTime; std::clock_t m_StartPingTime;
std::clock_t m_StopTimes[8];
// Game logic // Game logic
World* m_World; World* m_World;
EventBroker* m_EventBroker; EventBroker* m_EventBroker;
// vec.size() = ammount of players to create, stores playerID's
std::vector<unsigned int> m_PlayersToCreate;
// Packet loss logic // Packet loss logic
unsigned int m_PacketID; unsigned int m_PacketID = 0;
unsigned int m_PreviousPacketID; unsigned int m_PreviousPacketID = 0;
unsigned int m_SendPacketID;
// Private member functions // Private member functions
int receive(char* data, size_t length); int receive(char* data, size_t length);
void readFromClients(); void readFromClients();
void send(Packet& packet, int playerID); void send(Packet& packet, int playerID);
void send(Packet& packet); void send(Packet& packet);
void moveMessageHead(char*& data, size_t& length, size_t stepSize);
void broadcast(std::string message);
void broadcast(Packet& packet); void broadcast(Packet& packet);
void sendSnapshot(); void sendSnapshot();
void sendPing(); void sendPing();
void checkForTimeOuts(); void checkForTimeOuts();
void disconnect(int i); void disconnect(int i);
void parseMessageType(Packet& packet); void parseMessageType(Packet& packet);
void parseEvent(Packet& packet); void parseOnInputCommand(Packet& packet);
void parseOnPlayerDamage(Packet& packet);
void parseConnect(Packet& packet); void parseConnect(Packet& packet);
void parseDisconnect(); void parseDisconnect();
void parseClientPing(); void parseClientPing();
void parseServerPing(); void parseServerPing();
void parseSnapshot(Packet& packet);
void identifyPacketLoss(); void identifyPacketLoss();
EntityID createPlayer(); void createPlayer();
int GetPlayerIDFromEndpoint(boost::asio::ip::udp::endpoint endpoint);
// Debug event
EventRelay<Server, Events::InputCommand> m_EInputCommand;
bool OnInputCommand(const Events::InputCommand& e);
}; };
#endif #endif
@@ -0,0 +1,35 @@
#ifndef DirectionalLightJob_h__
#define DirectionalLightJob_h__
#include <cstdint>
#include "../Common.h"
#include "../GLM.h"
#include "../Core/ComponentWrapper.h"
#include "RenderJob.h"
#include "../Core/Transform.h"
#include "../Core/World.h"
struct DirectionalLightJob : RenderJob
{
DirectionalLightJob(ComponentWrapper transformComponent, ComponentWrapper directionalLightComponent, World* m_World)
: RenderJob()
{
Direction = glm::vec4(0,0,-1,0) * glm::inverse(Transform::AbsoluteOrientation(m_World, transformComponent.EntityID));
//Direction = glm::vec4((glm::vec3)directionalLightComponent["Direction"], 0.f);
Color = (glm::vec4)directionalLightComponent["Color"];
Intensity = (double)directionalLightComponent["Intensity"];
};
glm::vec4 Direction;
glm::vec4 Color;
float Intensity;
void CalculateHash() override
{
Hash = 0;
}
};
#endif
+9 -8
View File
@@ -46,8 +46,8 @@ private:
int m_NumberOfTiles = 0; int m_NumberOfTiles = 0;
struct Plane { struct Plane {
glm::vec3 Normal; glm::vec3 Normal = glm::vec3(0.f);
float d; float d = 0;
}; };
struct Frustum { struct Frustum {
@@ -56,20 +56,21 @@ private:
Frustum* m_Frustums; Frustum* m_Frustums;
//This should be a component //This should be a component
struct PointLight { struct LightSource {
glm::vec4 Position = glm::vec4(0.f); glm::vec4 Position = glm::vec4(0.f);
glm::vec4 Direction = glm::vec4(10.f);
glm::vec4 Color = glm::vec4(1.f); glm::vec4 Color = glm::vec4(1.f);
float Radius = 5.f; float Radius = 5.f;
float Intensity = 0.8f; float Intensity = 0.8f;
float Falloff = 0.3f; float Falloff = 0.3f;
float Padding = 1337; enum Type_t { Zero, Point, Directional, Spot } Type;
}; };
std::vector<PointLight> m_PointLights; std::vector<LightSource> m_LightSources;
struct LightGrid { struct LightGrid {
float Start; float Start = 0;
float Amount; float Amount = 0;
glm::vec2 Padding; glm::vec2 Padding = glm::vec2(1.f, 2.f);
}; };
LightGrid* m_LightGrid; LightGrid* m_LightGrid;
+4
View File
@@ -12,6 +12,7 @@
#include "../Core/ResourceManager.h" #include "../Core/ResourceManager.h"
#include "Camera.h" #include "Camera.h"
#include "../Core/World.h" #include "../Core/World.h"
#include "../Core/Transform.h"
struct ModelJob : RenderJob struct ModelJob : RenderJob
{ {
@@ -28,6 +29,9 @@ struct ModelJob : RenderJob
Matrix = matrix; Matrix = matrix;
Color = modelComponent["Color"]; Color = modelComponent["Color"];
Entity = modelComponent.EntityID; Entity = modelComponent.EntityID;
glm::vec3 abspos = Transform::AbsolutePosition(world, modelComponent.EntityID);
glm::vec3 worldpos = glm::vec3(camera->ViewMatrix() * glm::vec4(abspos, 1));
Depth = worldpos.z;
World = world; World = world;
}; };
+3
View File
@@ -12,6 +12,7 @@
#include "RenderJob.h" #include "RenderJob.h"
#include "ModelJob.h" #include "ModelJob.h"
#include "PointLightJob.h" #include "PointLightJob.h"
#include "DirectionalLightJob.h"
/* /*
@@ -53,12 +54,14 @@ struct RenderScene
::Camera* Camera; ::Camera* Camera;
std::list<std::shared_ptr<RenderJob>> ForwardJobs; std::list<std::shared_ptr<RenderJob>> ForwardJobs;
std::list<std::shared_ptr<RenderJob>> PointLightJobs; std::list<std::shared_ptr<RenderJob>> PointLightJobs;
std::list<std::shared_ptr<RenderJob>> DirectionalLightJobs;
Rectangle Viewport; Rectangle Viewport;
void Clear() void Clear()
{ {
ForwardJobs.clear(); ForwardJobs.clear();
PointLightJobs.clear(); PointLightJobs.clear();
DirectionalLightJobs.clear();
} }
}; };
+2 -1
View File
@@ -46,7 +46,8 @@ private:
void updateProjectionMatrix(ComponentWrapper& cameraComponent); void updateProjectionMatrix(ComponentWrapper& cameraComponent);
void fillModels(std::list<std::shared_ptr<RenderJob>>& jobs, World* world); void fillModels(std::list<std::shared_ptr<RenderJob>>& jobs, World* world);
void fillLight(std::list<std::shared_ptr<RenderJob>>& jobs, World* world); void fillPointLights(std::list<std::shared_ptr<RenderJob>>& jobs, World* world);
void fillDirectionalLights(std::list<std::shared_ptr<RenderJob>>& jobs, World* world);
EventRelay<RenderSystem, Events::InputCommand> m_EInputCommand; EventRelay<RenderSystem, Events::InputCommand> m_EInputCommand;
bool OnInputCommand(const Events::InputCommand& e); bool OnInputCommand(const Events::InputCommand& e);
+2 -4
View File
@@ -22,9 +22,8 @@
class Renderer : public IRenderer class Renderer : public IRenderer
{ {
public: public:
Renderer(EventBroker* eventBroker, World* world) Renderer(EventBroker* eventBroker)
: m_EventBroker(eventBroker) : m_EventBroker(eventBroker)
, m_World(world)
{ } { }
virtual void Initialize() override; virtual void Initialize() override;
@@ -36,7 +35,6 @@ public:
private: private:
//----------------------Variables----------------------// //----------------------Variables----------------------//
EventBroker* m_EventBroker; EventBroker* m_EventBroker;
World* m_World;
Texture* m_ErrorTexture; Texture* m_ErrorTexture;
Texture* m_WhiteTexture; Texture* m_WhiteTexture;
@@ -62,7 +60,7 @@ private:
void DrawScreenQuad(GLuint textureToDraw); void DrawScreenQuad(GLuint textureToDraw);
static bool DepthSort(const std::shared_ptr<RenderJob> &i, const std::shared_ptr<RenderJob> &j) { return (i->Depth < j->Depth); } static bool DepthSort(const std::shared_ptr<RenderJob> &i, const std::shared_ptr<RenderJob> &j) { return (i->Depth < j->Depth); }
void FillDepth(RenderScene& scene); void SortRenderJobsByDepth(RenderScene &scene);
void GenerateTexture(GLuint* texture, GLenum wrapping, GLenum filtering, glm::vec2 dimensions, GLint internalFormat, GLint format, GLenum type); void GenerateTexture(GLuint* texture, GLenum wrapping, GLenum filtering, glm::vec2 dimensions, GLint internalFormat, GLint format, GLenum type);
//--------------------ShaderPrograms-------------------// //--------------------ShaderPrograms-------------------//
ShaderProgram* m_BasicForwardProgram; ShaderProgram* m_BasicForwardProgram;
+18
View File
@@ -0,0 +1,18 @@
#ifndef ESpawnerSpawn_h__
#define ESpawnerSpawn_h__
#include "Core/Event.h"
#include "Core/EntityWrapper.h"
namespace Events
{
struct SpawnerSpawn : Event
{
EntityWrapper Spawner;
EntityWrapper Parent;
};
}
#endif
+4 -3
View File
@@ -14,13 +14,12 @@
#include "Core/EKeyDown.h" #include "Core/EKeyDown.h"
#include "Core/EntityFilePreprocessor.h" #include "Core/EntityFilePreprocessor.h"
#include "Core/SystemPipeline.h" #include "Core/SystemPipeline.h"
#include "RaptorCopterSystem.h"
#include "PlayerSystem.h"
#include "Editor/EditorSystem.h" #include "Editor/EditorSystem.h"
#include "Core/EntityFile.h" #include "Core/EntityFile.h"
#include "Rendering/RenderSystem.h" #include "Rendering/RenderSystem.h"
#include "Core/EntityFileParser.h" #include "Core/EntityFileParser.h"
#include "Core/Octree.h"
#include "Systems/InterpolationSystem.h"
// Network // Network
#include <boost/thread.hpp> #include <boost/thread.hpp>
#include "Network/Network.h" #include "Network/Network.h"
@@ -48,6 +47,8 @@ private:
InputProxy* m_InputProxy; InputProxy* m_InputProxy;
GUI::Frame* m_FrameStack; GUI::Frame* m_FrameStack;
World* m_World; World* m_World;
Octree<AABB>* m_OctreeCollision;
Octree<AABB>* m_OctreeFrustrumCulling;
SystemPipeline* m_SystemPipeline; SystemPipeline* m_SystemPipeline;
RenderFrame* m_RenderFrame; RenderFrame* m_RenderFrame;
// Network variables // Network variables
-33
View File
@@ -1,33 +0,0 @@
#ifndef PlayerSystem_h__
#define PlayerSystem_h__
#include <GLFW/glfw3.h>
#include <glm/common.hpp>
#include "Common.h"
#include "Core/System.h"
#include "Collision/ETrigger.h"
class PlayerSystem : public PureSystem
{
public:
PlayerSystem(EventBroker* eventBroker)
: PureSystem(eventBroker, "Player")
{
EVENT_SUBSCRIBE_MEMBER(m_ETouch, &PlayerSystem::OnTouch);
EVENT_SUBSCRIBE_MEMBER(m_EEnter, &PlayerSystem::OnEnter);
EVENT_SUBSCRIBE_MEMBER(m_ELeave, &PlayerSystem::OnLeave);
}
virtual void UpdateComponent(World* world, ComponentWrapper& player, double dt) override;
private:
float m_Speed = 5;
EventRelay<PlayerSystem, Events::TriggerEnter> m_EEnter;
bool OnEnter(const Events::TriggerEnter &event);
EventRelay<PlayerSystem, Events::TriggerTouch> m_ETouch;
bool PlayerSystem::OnTouch(const Events::TriggerTouch &event);
EventRelay<PlayerSystem, Events::TriggerLeave> m_ELeave;
bool PlayerSystem::OnLeave(const Events::TriggerLeave &event);
};
#endif
-16
View File
@@ -1,16 +0,0 @@
#include "Common.h"
#include "Core/System.h"
class RaptorCopterSystem : public PureSystem
{
public:
RaptorCopterSystem(EventBroker* eventBroker)
: PureSystem(eventBroker, "RaptorCopter")
{ }
virtual void UpdateComponent(World* world, ComponentWrapper& raptorCopter, double dt) override
{
ComponentWrapper& transform = world->GetComponent(raptorCopter.EntityID, "Transform");
(glm::vec3&)transform["Orientation"] += (float)(double)raptorCopter["Speed"] * (float)dt * (glm::vec3)raptorCopter["Axis"];
}
};
+55
View File
@@ -0,0 +1,55 @@
#ifndef CapturePointSystem_h__
#define CapturePointSystem_h__
#include <GLFW/glfw3.h>
#include <glm/common.hpp>
#include "Common.h"
#include "Core/System.h"
#include "Engine/Collision/ETrigger.h"
#include "Core/ECaptured.h"
#include "Core/EWin.h"
#include <tuple>
#include <vector>
class CapturePointSystem : public PureSystem
{
public:
//WARNING: on new map, destroy all info in the vectors, as well as reset all variables (just make new?)
CapturePointSystem(EventBroker* eventBroker);
//updatecomponent
virtual void UpdateComponent(World* world, EntityWrapper& entity, ComponentWrapper& capturePoint, double dt) override;
private:
//methods which will take care of specific events
EventRelay<CapturePointSystem, Events::TriggerTouch> m_ETriggerTouch;
bool CapturePointSystem::OnTriggerTouch(const Events::TriggerTouch& e);
EventRelay<CapturePointSystem, Events::TriggerLeave> m_ETriggerLeave;
bool CapturePointSystem::OnTriggerLeave(const Events::TriggerLeave& e);
EventRelay<CapturePointSystem, Events::Captured> m_ECaptured;
bool CapturePointSystem::OnCaptured(const Events::Captured& e);
bool m_WinnerWasFound = false;
//need to track these variables for the captureSystem to work as per design!
const int m_NotACapturePoint = 999;
int m_RedTeamNextPossibleCapturePoint = m_NotACapturePoint;
int m_BlueTeamNextPossibleCapturePoint = m_NotACapturePoint;
int m_RedTeamHomeCapturePoint = m_NotACapturePoint;
int m_BlueTeamHomeCapturePoint = m_NotACapturePoint;
int m_NumberOfCapturePoints = 0;
std::map<int, EntityID> m_CapturePointNumberToEntityIDMap;
//std::vector<ComponentWrapper>
const double m_CaptureTimeToTakeOver = 15.0;
bool m_ResetTimers = false;
//vectors which will keep track of enter/leave changes
std::vector<std::tuple<EntityID, EntityID>> m_ETriggerTouchVector;
std::vector<std::tuple<EntityID, EntityID>> m_ETriggerLeaveVector;
};
#endif
@@ -6,9 +6,9 @@
#include "Common.h" #include "Common.h"
#include "Core/System.h" #include "Core/System.h"
#include "Core\EPlayerDamage.h"; #include "Core/EPlayerDamage.h"
#include "Core\EPlayerHealthPickup.h"; #include "Core/EPlayerHealthPickup.h"
#include "Core\EPlayerDeath.h"; #include "Core/EPlayerDeath.h"
#include <tuple> #include <tuple>
#include <vector> #include <vector>
@@ -19,7 +19,7 @@ public:
HealthSystem(EventBroker* eventBroker); HealthSystem(EventBroker* eventBroker);
//updatecomponent //updatecomponent
virtual void UpdateComponent(World* world, ComponentWrapper& health, double dt) override; virtual void UpdateComponent(World* world, EntityWrapper& entity, ComponentWrapper& component, double dt) override;
private: private:
//methods which will take care of specific events //methods which will take care of specific events
@@ -0,0 +1,53 @@
#ifndef Systems_InterpolationSystem_h__
#define Systems_InterpolationSystem_h__
#include <queue>
#include <unordered_map>
#include <boost/shared_array.hpp>
#include <glm/common.hpp>
#include <glm/gtc/quaternion.hpp>
#include "Common.h"
#include "Core/System.h"
#include "Core/EventBroker.h"
#include "Network/EInterpolate.h"
#define SNAPSHOTINTERVAL 0.05f
class InterpolationSystem : public PureSystem
{
struct Transform
{
glm::vec3 Position;
glm::vec3 Scale;
glm::quat Orientation;
double interpolationTime;
};
public:
InterpolationSystem(EventBroker* eventBroker)
: System(eventBroker)
, PureSystem("Transform")
{
EVENT_SUBSCRIBE_MEMBER(m_EInterpolate, &InterpolationSystem::OnInterpolate);
}
~InterpolationSystem() { }
virtual void UpdateComponent(World* world, EntityWrapper& entity, ComponentWrapper& transform, double dt) override;
private:
std::unordered_map<EntityID, Transform> m_NextTransform;
std::unordered_map<EntityID, Transform> m_LastReceivedTransform;
//glm::vec3 vectorInterpolation(glm::vec3 prev, glm::vec3 next, double currentTime);
template <typename T>
T vectorInterpolation(T prev, T next, double currentTime)
{
T difference = next - prev;
T vector = (difference / SNAPSHOTINTERVAL) * static_cast<float>(currentTime);
return vector;
}
EventRelay<InterpolationSystem, Events::Interpolate> m_EInterpolate;
bool InterpolationSystem::OnInterpolate(const Events::Interpolate& e);
};
#endif
@@ -0,0 +1,14 @@
#include "Common.h"
#include "GLM.h"
#include "Core/System.h"
class PlayerMovementSystem : public PureSystem
{
public:
PlayerMovementSystem(EventBroker* eventBroker)
: System(eventBroker)
, PureSystem("Player")
{ }
virtual void UpdateComponent(World* world, EntityWrapper& entity, ComponentWrapper& component, double dt);
};
+18
View File
@@ -0,0 +1,18 @@
#include "Core/System.h"
#include "Input/EInputCommand.h"
#include "Systems/SpawnerSystem.h"
#include "Events/ESpawnerSpawn.h"
class PlayerSpawnSystem : public ImpureSystem
{
public:
PlayerSpawnSystem(EventBroker* eventBroker);
virtual void Update(World* world, double dt) override;
private:
EventRelay<PlayerSpawnSystem, Events::InputCommand> m_OnInputCommand;
bool OnInputCommand(const Events::InputCommand& e);
std::vector<int> m_SpawnRequests;
};
+17
View File
@@ -0,0 +1,17 @@
#include "Common.h"
#include "Core/System.h"
class RaptorCopterSystem : public PureSystem
{
public:
RaptorCopterSystem(EventBroker* eventBroker)
: System(eventBroker)
, PureSystem("RaptorCopter")
{ }
virtual void UpdateComponent(World* world, EntityWrapper& entity, ComponentWrapper& component, double dt) override
{
ComponentWrapper& transform = world->GetComponent(component.EntityID, "Transform");
(glm::vec3&)transform["Orientation"] += (float)(double)component["Speed"] * (float)dt * (glm::vec3)component["Axis"];
}
};
+25
View File
@@ -0,0 +1,25 @@
#ifndef SpawnerSystem_h__
#define SpawnerSystem_h__
#include <random>
#include "Common.h"
#include "GLM.h"
#include "Core/System.h"
#include "Events/ESpawnerSpawn.h"
#include "Core/Transform.h"
#include "Core/ResourceManager.h"
#include "Core/EntityFileParser.h"
class SpawnerSystem : public System
{
public:
SpawnerSystem(EventBroker* eventBroker);
static EntityWrapper Spawn(EntityWrapper spawner, EntityWrapper parent = EntityWrapper::Invalid);
private:
EventRelay<SpawnerSystem, Events::SpawnerSpawn> m_OnSpawnerSpawn;
bool OnSpawnerSpawn(Events::SpawnerSpawn& e);
};
#endif
+4 -4
View File
@@ -6,10 +6,10 @@ InvertPitch=false
MouseLeft=PrimaryFire MouseLeft=PrimaryFire
MouseX=Yaw MouseX=Yaw
MouseY=Pitch MouseY=Pitch
W=+Forward W=Forward,1
S=-Forward S=Forward,-1
D=+Right D=Right,1
A=-Right A=Right,-1
R=Reload R=Reload
Space=Jump Space=Jump
LeftControl=Crouch LeftControl=Crouch
+8 -1
View File
@@ -2,15 +2,22 @@
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="components" elementFormDefault="qualified"> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="components" elementFormDefault="qualified">
<xs:include schemaLocation="Components/Transform.xsd"/> <xs:include schemaLocation="Components/Transform.xsd"/>
<xs:include schemaLocation="Components/Physics.xsd"/>
<xs:include schemaLocation="Components/Model.xsd"/> <xs:include schemaLocation="Components/Model.xsd"/>
<xs:include schemaLocation="Components/Test.xsd"/>
<xs:include schemaLocation="Components/RaptorCopter.xsd"/> <xs:include schemaLocation="Components/RaptorCopter.xsd"/>
<xs:include schemaLocation="Components/Player.xsd"/> <xs:include schemaLocation="Components/Player.xsd"/>
<xs:include schemaLocation="Components/Camera.xsd"/> <xs:include schemaLocation="Components/Camera.xsd"/>
<xs:include schemaLocation="Components/AABB.xsd"/> <xs:include schemaLocation="Components/AABB.xsd"/>
<xs:include schemaLocation="Components/PointLight.xsd"/> <xs:include schemaLocation="Components/PointLight.xsd"/>
<xs:include schemaLocation="Components/DirectionalLight.xsd"/>
<xs:include schemaLocation="Components/Trigger.xsd"/> <xs:include schemaLocation="Components/Trigger.xsd"/>
<xs:include schemaLocation="Components/Health.xsd"/> <xs:include schemaLocation="Components/Health.xsd"/>
<xs:include schemaLocation="Components/CapturePoint.xsd"/>
<xs:include schemaLocation="Components/Listener.xsd"/> <xs:include schemaLocation="Components/Listener.xsd"/>
<xs:include schemaLocation="Components/SoundEmitter.xsd"/> <xs:include schemaLocation="Components/SoundEmitter.xsd"/>
<xs:include schemaLocation="Components/Collidable.xsd"/>
<xs:include schemaLocation="Components/Spawner.xsd"/>
<xs:include schemaLocation="Components/SpawnPoint.xsd"/>
<xs:include schemaLocation="Components/PlayerSpawn.xsd"/>
<xs:include schemaLocation="Components/Team.xsd"/>
</xs:schema> </xs:schema>
+5 -4
View File
@@ -1,4 +1,5 @@
<c:AABB> <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<BoxCenter X="0" Y="0" Z="0"/> <AABB xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="AABB.xsd">
<BoxSize X="1" Y="1" Z="1"/> <Origin X="0" Y="0" Z="0"/>
</c:AABB> <Size X="1" Y="1" Z="1"/>
</AABB>
+6 -2
View File
@@ -6,8 +6,12 @@
<xs:element name="AABB"> <xs:element name="AABB">
<xs:complexType> <xs:complexType>
<xs:all> <xs:all>
<xs:element name="BoxCenter" type="t:Vector" minOccurs="0"/> <xs:element name="Origin" type="t:Vector" minOccurs="0">
<xs:element name="BoxSize" type="t:Vector" minOccurs="0"/> <xs:annotation><xs:documentation>Middle point of the bounding box</xs:documentation></xs:annotation>
</xs:element>
<xs:element name="Size" type="t:Vector" minOccurs="0">
<xs:annotation><xs:documentation>Size of the bounding box</xs:documentation></xs:annotation>
</xs:element>
</xs:all> </xs:all>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
+4 -3
View File
@@ -1,6 +1,7 @@
<c:Camera> <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Camera xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Camera.xsd">
<Name>cam</Name> <Name>cam</Name>
<FOV>60.0</FOV> <FOV>45</FOV>
<NearClip>0.01</NearClip> <NearClip>0.01</NearClip>
<FarClip>5000</FarClip> <FarClip>5000</FarClip>
</c:Camera> </Camera>
+3 -1
View File
@@ -10,7 +10,9 @@
<xs:complexType> <xs:complexType>
<xs:all> <xs:all>
<xs:element name="Name" type="t:string" minOccurs="0"/> <xs:element name="Name" type="t:string" minOccurs="0"/>
<xs:element name="FOV" type="t:double" minOccurs="0"/> <xs:element name="FOV" type="t:double" minOccurs="0">
<xs:annotation><xs:documentation>Vertical Field of View in degrees</xs:documentation></xs:annotation>
</xs:element>
<xs:element name="NearClip" type="t:double" minOccurs="0"/> <xs:element name="NearClip" type="t:double" minOccurs="0"/>
<xs:element name="FarClip" type="t:double" minOccurs="0"/> <xs:element name="FarClip" type="t:double" minOccurs="0"/>
</xs:all> </xs:all>
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<CapturePoint xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="CapturePoint.xsd">
<CapturePointNumber>0</CapturePointNumber>
<CaptureTimer>0</CaptureTimer>
<HomePointForTeam><Spectator/></HomePointForTeam>
</CapturePoint>
@@ -0,0 +1,44 @@
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:t="types">
<xs:import schemaLocation="../Types.xsd" namespace="types"/>
<xs:complexType name="TeamEnum" mixed="true">
<xs:complexContent>
<xs:extension base="t:enum">
<xs:choice>
<xs:element name="Spectator" type="xs:integer" fixed="1" minOccurs="0"/>
<xs:element name="Red" type="xs:integer" fixed="2" minOccurs="0"/>
<xs:element name="Blue" type="xs:integer" fixed="3" minOccurs="0"/>
</xs:choice>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="CapturePoint">
<xs:annotation>
<xs:documentation>A Capture Point. Add a Team Component to specify who currently owns it</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:all>
<xs:element name="CaptureTimer" type="t:double" minOccurs="0">
<xs:annotation>
<xs:documentation>CaptureTimer handled by Capture Point System</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="CapturePointNumber" type="t:int" minOccurs="0">
<xs:annotation>
<xs:documentation>CapturePointNumber specify an int number for this</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="HomePointForTeam" type="TeamEnum" minOccurs="0">
<xs:annotation>
<xs:documentation>Specify if this is a HomePoint for either team</xs:documentation>
</xs:annotation>
</xs:element>
</xs:all>
</xs:complexType>
</xs:element>
</xs:schema>
@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Collidable xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Collidable.xsd">
</Collidable>
@@ -0,0 +1,8 @@
<?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="Collidable">
</xs:element>
</xs:schema>
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<DirectionalLight xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="DirectionalLight.xsd">
<Color R="1" G="1" B="1" A="1"/>
<Intensity>0.8</Intensity>
<Visible>true</Visible>
</DirectionalLight>
@@ -0,0 +1,16 @@
<?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="DirectionalLight">
<xs:annotation>
<xs:documentation>A directional light that shines bright like the future.</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:all>
<xs:element name="Color" type="t:Color" minOccurs="0"/>
<xs:element name="Intensity" type="t:double" minOccurs="0"/>
<xs:element name="Visible" type="t:bool" minOccurs="0"/>
</xs:all>
</xs:complexType>
</xs:element>
</xs:schema>
+3 -2
View File
@@ -1,4 +1,5 @@
<c:Health> <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Health xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Health.xsd">
<Health>100</Health> <Health>100</Health>
<MaxHealth>100</MaxHealth> <MaxHealth>100</MaxHealth>
</c:Health> </Health>
+2 -3
View File
@@ -1,3 +1,2 @@
<c:Listener> <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Listener xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Listener.xsd"/>
</c:Listener>
+3 -2
View File
@@ -1,5 +1,6 @@
<c:Model> <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Model xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Model.xsd">
<Resource></Resource> <Resource></Resource>
<Color R="1" G="1" B="1" A="1"/> <Color R="1" G="1" B="1" A="1"/>
<Visible>true</Visible> <Visible>true</Visible>
</c:Model> </Model>
+5
View File
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Physics xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Physics.xsd">
<Velocity X="0" Y="0" Z="0"/>
<Gravity>true</Gravity>
</Physics>
+17
View File
@@ -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="Physics">
<xs:annotation>
<xs:documentation>Physics stuff</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:all>
<xs:element name="Velocity" type="t:Vector" minOccurs="0"/>
<xs:element name="Gravity" type="t:bool" minOccurs="0"/>
</xs:all>
</xs:complexType>
</xs:element>
</xs:schema>
+3 -2
View File
@@ -1,7 +1,8 @@
<c:Player> <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Player xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Player.xsd">
<Velocity X="0" Y="0" Z="0"/> <Velocity X="0" Y="0" Z="0"/>
<Forward>false</Forward> <Forward>false</Forward>
<Left>false</Left> <Left>false</Left>
<Back>false</Back> <Back>false</Back>
<Right>false</Right> <Right>false</Right>
</c:Player> </Player>
+3
View File
@@ -4,6 +4,9 @@
<xs:import schemaLocation="../Types.xsd" namespace="types"/> <xs:import schemaLocation="../Types.xsd" namespace="types"/>
<xs:element name="Player"> <xs:element name="Player">
<xs:annotation>
<xs:documentation>The player charachter</xs:documentation>
</xs:annotation>
<xs:complexType> <xs:complexType>
<xs:all> <xs:all>
<xs:element name="Velocity" type="t:Vector" minOccurs="0"/> <xs:element name="Velocity" type="t:Vector" minOccurs="0"/>
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<PlayerSpawn xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="PlayerSpawn.xsd"/>
@@ -0,0 +1,11 @@
<?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="PlayerSpawn">
<xs:annotation>
<xs:documentation>Combined with a Spawner and a Team component, defines a spawn point for a player team.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:schema>
+3 -2
View File
@@ -1,7 +1,8 @@
<c:PointLight> <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<PointLight xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="PointLight.xsd">
<Color R="1" G="1" B="1" A="1"/> <Color R="1" G="1" B="1" A="1"/>
<Radius>1.0</Radius> <Radius>1.0</Radius>
<Intensity>0.8</Intensity> <Intensity>0.8</Intensity>
<Falloff>0.3</Falloff> <Falloff>0.3</Falloff>
<Visible>true</Visible> <Visible>true</Visible>
</c:PointLight> </PointLight>
+8 -1
View File
@@ -12,7 +12,14 @@
<xs:element name="Color" type="t:Color" minOccurs="0"/> <xs:element name="Color" type="t:Color" minOccurs="0"/>
<xs:element name="Radius" type="t:double" minOccurs="0"/> <xs:element name="Radius" type="t:double" minOccurs="0"/>
<xs:element name="Intensity" type="t:double" minOccurs="0"/> <xs:element name="Intensity" type="t:double" minOccurs="0"/>
<xs:element name="Falloff" type="t:double" minOccurs="0" minInclusive="0" maxInclusive="1"/> <xs:element name="Falloff">
<xs:simpleType>
<xs:restriction base="t:double">
<xs:minInclusive value="0"/>
<xs:maxInclusive value="1"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Visible" type="t:bool" minOccurs="0"/> <xs:element name="Visible" type="t:bool" minOccurs="0"/>
</xs:all> </xs:all>
</xs:complexType> </xs:complexType>
+3 -2
View File
@@ -1,4 +1,5 @@
<c:RaptorCopter> <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<RaptorCopter xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="RaptorCopter.xsd">
<Speed>0</Speed> <Speed>0</Speed>
<Axis X="0" Y="0" Z="0"/> <Axis X="0" Y="0" Z="0"/>
</c:RaptorCopter> </RaptorCopter>
+3 -2
View File
@@ -1,4 +1,5 @@
<c:SoundEmitter> <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<SoundEmitter xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="SoundEmitter.xsd">
<FilePath></FilePath> <FilePath></FilePath>
<Gain>1.0</Gain> <Gain>1.0</Gain>
<Pitch>1.0</Pitch> <Pitch>1.0</Pitch>
@@ -6,4 +7,4 @@
<MaxDistance>20.0</MaxDistance> <MaxDistance>20.0</MaxDistance>
<RollOffFactor>1.0</RollOffFactor> <RollOffFactor>1.0</RollOffFactor>
<ReferenceDistance>1.0</ReferenceDistance> <ReferenceDistance>1.0</ReferenceDistance>
</c:SoundEmitter> </SoundEmitter>
+18 -12
View File
@@ -7,18 +7,24 @@
<xs:complexType> <xs:complexType>
<xs:all> <xs:all>
<xs:element name="FilePath" type="t:string" minOccurs="0"/> <xs:element name="FilePath" type="t:string" minOccurs="0"/>
<xs:element name="Gain" type="t:double" minOccurs="0"/> <xs:element name="Gain" type="t:double" minOccurs="0">
<xs:annotation><xs:documentation>The "volume" of the emitter. A value betweeen 0-1</xs:documentation></xs:annotation> <xs:annotation><xs:documentation>The "volume" of the emitter. A value betweeen 0-1</xs:documentation></xs:annotation>
<xs:element name="Pitch" type="t:double" minOccurs="0"/> </xs:element>
<xs:annotation><xs:documentation>The pitch of the emitter. A value betweeen 0-1</xs:documentation></xs:annotation> <xs:element name="Pitch" type="t:double" minOccurs="0">
<xs:element name="Loop" type="t:bool" minOccurs="0"/> <xs:annotation><xs:documentation>The pitch of the emitter. A value betweeen 0-1</xs:documentation></xs:annotation>
<xs:annotation><xs:documentation>If the sound should loop or not.</xs:documentation></xs:annotation> </xs:element>
<xs:element name="MaxDistance" type="t:double" minOccurs="0"/> <xs:element name="Loop" type="t:bool" minOccurs="0">
<xs:annotation><xs:documentation>The distance where there will no longer be any attenuation.</xs:documentation></xs:annotation> <xs:annotation><xs:documentation>If the sound should loop or not.</xs:documentation></xs:annotation>
<xs:element name="RollOffFactor" type="t:double" minOccurs="0"/> </xs:element>
<xs:annotation><xs:documentation>The rolloff rate of the source.</xs:documentation></xs:annotation> <xs:element name="MaxDistance" type="t:double" minOccurs="0">
<xs:element name="ReferenceDistance" type="t:double" minOccurs="0"/> <xs:annotation><xs:documentation>The distance where there will no longer be any attenuation.</xs:documentation></xs:annotation>
<xs:annotation><xs:documentation>The distance that the source will be the loudest.</xs:documentation></xs:annotation> </xs:element>
<xs:element name="RollOffFactor" type="t:double" minOccurs="0">
<xs:annotation><xs:documentation>The rolloff rate of the source.</xs:documentation></xs:annotation>
</xs:element>
<xs:element name="ReferenceDistance" type="t:double" minOccurs="0">
<xs:annotation><xs:documentation>The distance that the source will be the loudest.</xs:documentation></xs:annotation>
</xs:element>
</xs:all> </xs:all>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<SpawnPoint xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="SpawnPoint.xsd"/>
@@ -0,0 +1,11 @@
<?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="SpawnPoint">
<xs:annotation>
<xs:documentation>Defines this entity as a spawn point for a parent Spawner</xs:documentation>
</xs:annotation>
</xs:element>
</xs:schema>
+4
View File
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Spawner xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Spawner.xsd">
<EntityFile></EntityFile>
</Spawner>
+18
View File
@@ -0,0 +1,18 @@
<?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="Spawner">
<xs:annotation>
<xs:documentation>Randomly selects a child SpawnPoint component and spawns a copy of an entity template when receiving a SpawnerSpawn event. If no SpawnPoint is found it spawns from its own position.</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:all>
<xs:element name="EntityFile" type="t:string" minOccurs="0">
<xs:annotation><xs:documentation>The entity template to spawn</xs:documentation></xs:annotation>
</xs:element>
</xs:all>
</xs:complexType>
</xs:element>
</xs:schema>
+4
View File
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Team xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Team.xsd">
<Team><Spectator/></Team>
</Team>
+28
View File
@@ -0,0 +1,28 @@
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:t="types">
<xs:import schemaLocation="../Types.xsd" namespace="types"/>
<xs:complexType name="TeamEnum" mixed="true">
<xs:complexContent>
<xs:extension base="t:enum">
<xs:choice>
<xs:element name="Spectator" type="xs:integer" fixed="1" minOccurs="0"/>
<xs:element name="Red" type="xs:integer" fixed="2" minOccurs="0"/>
<xs:element name="Blue" type="xs:integer" fixed="3" minOccurs="0"/>
</xs:choice>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="Team">
<xs:annotation>
<xs:documentation>Represents entity team affiliation</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:all>
<xs:element name="Team" type="TeamEnum" minOccurs="0"/>
</xs:all>
</xs:complexType>
</xs:element>
</xs:schema>
+3 -2
View File
@@ -1,5 +1,6 @@
<c:Transform> <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Transform xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Transform.xsd">
<Position X="0" Y="0" Z="0"/> <Position X="0" Y="0" Z="0"/>
<Orientation X="0" Y="0" Z="0"/> <Orientation X="0" Y="0" Z="0"/>
<Scale X="1" Y="1" Z="1"/> <Scale X="1" Y="1" Z="1"/>
</c:Transform> </Transform>
+1 -1
View File
@@ -17,4 +17,4 @@
</xs:all> </xs:all>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
</xs:schema> </xs:schema>
+3 -2
View File
@@ -1,2 +1,3 @@
<c:Trigger> <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
</c:Trigger> <Trigger xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Trigger.xsd">
</Trigger>
+156
View File
@@ -0,0 +1,156 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Entity xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
<Components>
<c:Transform/>
</Components>
<Children>
<Entity>
<Components>
<c:Model>
<Resource>../assets/Models/DummyScene.obj</Resource>
</c:Model>
<c:Transform/>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:Health>
<Health>60</Health>
</c:Health>
<c:AABB/>
<c:Camera/>
<c:Listener/>
<c:Player/>
<c:Team>
<Team>3</Team>
</c:Team>
<c:Transform>
<Position X="-0.151326105" Y="13.5594187" Z="12.5957394"/>
<Orientation X="-0.872664392" Y="0.157068729" Z="4.90324332e-08"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:AABB/>
<c:CapturePoint>
<HomePointForTeam>3</HomePointForTeam>
</c:CapturePoint>
<c:Model>
<Resource>../assets/Models/Core/UnitSphere.obj</Resource>
<Color A="1" B="1" G="0.200000003" R="0"/>
</c:Model>
<c:Team>
<Team>3</Team>
</c:Team>
<c:Transform>
<Position X="5.48757935" Y="2.62824345" Z="0"/>
</c:Transform>
<c:Trigger/>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:AABB/>
<c:CapturePoint>
<CapturePointNumber>1</CapturePointNumber>
</c:CapturePoint>
<c:Model>
<Resource>../assets/Models/Core/UnitSphere.obj</Resource>
<Color A="1" B="0" G="1" R="1"/>
</c:Model>
<c:Team>
<Team>3</Team>
</c:Team>
<c:Transform>
<Position X="1.91470337" Y="2.32191443" Z="0"/>
</c:Transform>
<c:Trigger/>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:AABB/>
<c:CapturePoint>
<CapturePointNumber>2</CapturePointNumber>
</c:CapturePoint>
<c:Model>
<Resource>../assets/Models/Core/UnitSphere.obj</Resource>
<Color A="1" B="1" G="1" R="0"/>
</c:Model>
<c:Team>
<Team>2</Team>
</c:Team>
<c:Transform>
<Position X="-1.31178355" Y="2.16289616" Z="0"/>
</c:Transform>
<c:Trigger/>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:AABB/>
<c:CapturePoint>
<HomePointForTeam>2</HomePointForTeam>
<CapturePointNumber>3</CapturePointNumber>
</c:CapturePoint>
<c:Model>
<Resource>../assets/Models/Core/UnitSphere.obj</Resource>
<Color A="1" B="0" G="0.200000003" R="1"/>
</c:Model>
<c:Team>
<Team>2</Team>
</c:Team>
<c:Transform>
<Position X="-4.27947044" Y="1.99913001" Z="0"/>
</c:Transform>
<c:Trigger/>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:Health/>
<c:AABB/>
<c:Model>
<Resource>../assets/Models/Core/UnitCube.obj</Resource>
<Color A="1" B="0.482352942" G="0.490196079" R="1"/>
</c:Model>
<c:Player/>
<c:Team>
<Team>2</Team>
</c:Team>
<c:Transform>
<Position X="-1.67672658" Y="2.23822045" Z="-0.0577065349"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:Health/>
<c:AABB/>
<c:Model>
<Resource>../assets/Models/Core/UnitCube.obj</Resource>
<Color A="1" B="1" G="0.196078435" R="0.196078435"/>
</c:Model>
<c:Player/>
<c:Team>
<Team>3</Team>
</c:Team>
<c:Transform>
<Position X="2.40398169" Y="2.02053547" Z="-0.0348547697"/>
</c:Transform>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
@@ -0,0 +1,158 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Entity xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
<Components>
<c:Transform/>
</Components>
<Children>
<Entity>
<Components>
<c:Model>
<Resource>../assets/Models/DummyScene.obj</Resource>
</c:Model>
<c:Transform/>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:Health>
<Health>60</Health>
</c:Health>
<c:AABB/>
<c:Camera/>
<c:Listener/>
<c:Player/>
<c:Team>
<Team>3</Team>
</c:Team>
<c:Transform>
<Position X="-2.38960934" Y="11.7122087" Z="11.4659815"/>
<Orientation X="-0.645771146" Y="-1.17512627e-05" Z="1.76718231e-07"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:AABB/>
<c:CapturePoint>
<HomePointForTeam>3</HomePointForTeam>
<CaptureTimer>6.9158446328696002</CaptureTimer>
</c:CapturePoint>
<c:Model>
<Resource>../assets/Models/Core/UnitSphere.obj</Resource>
<Color A="1" B="0" G="1" R="1"/>
</c:Model>
<c:Team>
<Team>3</Team>
</c:Team>
<c:Transform>
<Position X="5.48757935" Y="2.62824345" Z="0"/>
</c:Transform>
<c:Trigger/>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:AABB/>
<c:CapturePoint>
<CaptureTimer>-13.234195338196177</CaptureTimer>
<CapturePointNumber>1</CapturePointNumber>
</c:CapturePoint>
<c:Model>
<Resource>../assets/Models/Core/UnitSphere.obj</Resource>
<Color A="1" B="1" G="1" R="0"/>
</c:Model>
<c:Team>
<Team>2</Team>
</c:Team>
<c:Transform>
<Position X="1.38422918" Y="2.32191443" Z="0"/>
</c:Transform>
<c:Trigger/>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:AABB/>
<c:CapturePoint>
<CapturePointNumber>2</CapturePointNumber>
</c:CapturePoint>
<c:Model>
<Resource>../assets/Models/Core/UnitSphere.obj</Resource>
<Color A="1" B="0" G="0.200000003" R="1"/>
</c:Model>
<c:Team>
<Team>2</Team>
</c:Team>
<c:Transform>
<Position X="-1.79222715" Y="2.16289616" Z="0"/>
</c:Transform>
<c:Trigger/>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:AABB/>
<c:CapturePoint>
<HomePointForTeam>2</HomePointForTeam>
<CapturePointNumber>3</CapturePointNumber>
</c:CapturePoint>
<c:Model>
<Resource>../assets/Models/Core/UnitSphere.obj</Resource>
<Color A="1" B="0" G="0.200000003" R="1"/>
</c:Model>
<c:Team>
<Team>2</Team>
</c:Team>
<c:Transform>
<Position X="-4.27947044" Y="1.99913001" Z="0"/>
</c:Transform>
<c:Trigger/>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:Health/>
<c:AABB/>
<c:Model>
<Resource>../assets/Models/Core/UnitCube.obj</Resource>
<Color A="1" B="0.482352942" G="0.490196079" R="1"/>
</c:Model>
<c:Player/>
<c:Team>
<Team>2</Team>
</c:Team>
<c:Transform>
<Position X="4.99647331" Y="2.23822045" Z="1.80651212"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:Health/>
<c:AABB/>
<c:Model>
<Resource>../assets/Models/Core/UnitCube.obj</Resource>
<Color A="1" B="1" G="0.196078435" R="0.196078435"/>
</c:Model>
<c:Player/>
<c:Team>
<Team>3</Team>
</c:Team>
<c:Transform>
<Position X="2.7091608" Y="2.02053547" Z="-0.0348547697"/>
</c:Transform>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
@@ -0,0 +1,152 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Entity xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
<Components>
<c:Transform/>
</Components>
<Children>
<Entity>
<Components>
<c:Model>
<Resource>../assets/Models/DummyScene.obj</Resource>
</c:Model>
<c:Transform/>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:Health>
<Health>60</Health>
</c:Health>
<c:AABB/>
<c:Camera/>
<c:Listener/>
<c:Player/>
<c:Team>
<Team>3</Team>
</c:Team>
<c:Transform>
<Position X="-0.151326105" Y="13.5594187" Z="12.5957394"/>
<Orientation X="-0.872664511" Y="0.157068729" Z="3.01738083e-08"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:AABB/>
<c:CapturePoint>
<HomePointForTeam>3</HomePointForTeam>
</c:CapturePoint>
<c:Model>
<Resource>../assets/Models/Core/UnitSphere.obj</Resource>
<Color A="1" B="1" G="0.200000003" R="0"/>
</c:Model>
<c:Team>
<Team>3</Team>
</c:Team>
<c:Transform>
<Position X="5.48757935" Y="2.62824345" Z="0"/>
</c:Transform>
<c:Trigger/>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:AABB/>
<c:CapturePoint>
<CapturePointNumber>1</CapturePointNumber>
</c:CapturePoint>
<c:Model>
<Resource>../assets/Models/Core/UnitSphere.obj</Resource>
<Color A="1" B="1" G="1" R="0"/>
</c:Model>
<c:Team/>
<c:Transform>
<Position X="1.91470337" Y="2.32191443" Z="0"/>
</c:Transform>
<c:Trigger/>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:AABB/>
<c:CapturePoint>
<CapturePointNumber>2</CapturePointNumber>
</c:CapturePoint>
<c:Model>
<Resource>../assets/Models/Core/UnitSphere.obj</Resource>
<Color A="1" B="0" G="1" R="1"/>
</c:Model>
<c:Team/>
<c:Transform>
<Position X="-1.31178355" Y="2.16289616" Z="0"/>
</c:Transform>
<c:Trigger/>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:AABB/>
<c:CapturePoint>
<HomePointForTeam>2</HomePointForTeam>
<CapturePointNumber>3</CapturePointNumber>
</c:CapturePoint>
<c:Model>
<Resource>../assets/Models/Core/UnitSphere.obj</Resource>
<Color A="1" B="0" G="0.200000003" R="1"/>
</c:Model>
<c:Team>
<Team>2</Team>
</c:Team>
<c:Transform>
<Position X="-4.27947044" Y="1.99913001" Z="0"/>
</c:Transform>
<c:Trigger/>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:Health/>
<c:AABB/>
<c:Model>
<Resource>../assets/Models/Core/UnitCube.obj</Resource>
<Color A="1" B="0.482352942" G="0.490196079" R="1"/>
</c:Model>
<c:Player/>
<c:Team>
<Team>2</Team>
</c:Team>
<c:Transform>
<Position X="-5.74354839" Y="2.23822045" Z="-0.0577065349"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:Health/>
<c:AABB/>
<c:Model>
<Resource>../assets/Models/Core/UnitCube.obj</Resource>
<Color A="1" B="1" G="0.196078435" R="0.196078435"/>
</c:Model>
<c:Player/>
<c:Team>
<Team>3</Team>
</c:Team>
<c:Transform>
<Position X="6.96941662" Y="2.02053547" Z="-0.0348547697"/>
</c:Transform>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
@@ -0,0 +1,212 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Entity xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
<Components>
<c:Transform/>
</Components>
<Children>
<Entity>
<Components>
<c:Model>
<Resource>../assets/Models/DummyScene.obj</Resource>
</c:Model>
<c:Transform/>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:Health>
<Health>60</Health>
</c:Health>
<c:AABB/>
<c:Camera/>
<c:Listener/>
<c:Player/>
<c:Team>
<Team>3</Team>
</c:Team>
<c:Transform>
<Position X="-0.151326105" Y="13.5594187" Z="12.5957394"/>
<Orientation X="-0.942477643" Y="0.157067701" Z="-1.50870125e-08"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:AABB/>
<c:CapturePoint>
<HomePointForTeam>3</HomePointForTeam>
</c:CapturePoint>
<c:Model>
<Resource>../assets/Models/Core/UnitSphere.obj</Resource>
<Color A="1" B="1" G="0.200000003" R="0"/>
</c:Model>
<c:Team>
<Team>3</Team>
</c:Team>
<c:Transform>
<Position X="5.39647007" Y="2.36802292" Z="0.0546064377"/>
</c:Transform>
<c:Trigger/>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:AABB/>
<c:CapturePoint>
<CapturePointNumber>1</CapturePointNumber>
</c:CapturePoint>
<c:Model>
<Resource>../assets/Models/Core/UnitSphere.obj</Resource>
<Color A="1" B="0" G="1" R="1"/>
</c:Model>
<c:Team>
<Team>3</Team>
</c:Team>
<c:Transform>
<Position X="4.21088505" Y="2.32191443" Z="0"/>
</c:Transform>
<c:Trigger/>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:AABB/>
<c:CapturePoint>
<CapturePointNumber>2</CapturePointNumber>
</c:CapturePoint>
<c:Model>
<Resource>../assets/Models/Core/UnitSphere.obj</Resource>
<Color A="1" B="1" G="1" R="0"/>
</c:Model>
<c:Team>
<Team>2</Team>
</c:Team>
<c:Transform>
<Position X="2.30499458" Y="2.04659939" Z="0"/>
</c:Transform>
<c:Trigger/>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:AABB/>
<c:CapturePoint>
<CapturePointNumber>3</CapturePointNumber>
</c:CapturePoint>
<c:Model>
<Resource>../assets/Models/Core/UnitSphere.obj</Resource>
<Color A="1" B="0" G="0.200000003" R="1"/>
</c:Model>
<c:Team>
<Team>2</Team>
</c:Team>
<c:Transform>
<Position X="0.196968079" Y="1.99913001" Z="0"/>
</c:Transform>
<c:Trigger/>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:AABB/>
<c:CapturePoint>
<HomePointForTeam>2</HomePointForTeam>
<CapturePointNumber>4</CapturePointNumber>
</c:CapturePoint>
<c:Model>
<Resource>../assets/Models/Core/UnitSphere.obj</Resource>
<Color A="1" B="0" G="0.200000003" R="1"/>
</c:Model>
<c:Team>
<Team>2</Team>
</c:Team>
<c:Transform>
<Position X="-1.82539892" Y="1.96172595" Z="0"/>
</c:Transform>
<c:Trigger/>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:Health/>
<c:AABB/>
<c:Model>
<Resource>../assets/Models/Core/UnitCube.obj</Resource>
<Color A="1" B="0.482352942" G="0.490196079" R="1"/>
</c:Model>
<c:Player/>
<c:Team>
<Team>2</Team>
</c:Team>
<c:Transform>
<Position X="1.15194035" Y="2.23822045" Z="-0.0577065349"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:Health/>
<c:AABB/>
<c:Model>
<Resource>../assets/Models/Core/UnitCube.obj</Resource>
<Color A="1" B="0.482352942" G="0.490196079" R="1"/>
</c:Model>
<c:Player/>
<c:Team>
<Team>2</Team>
</c:Team>
<c:Transform>
<Position X="-0.266237378" Y="2.23822045" Z="0.344228983"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:Health/>
<c:AABB/>
<c:Model>
<Resource>../assets/Models/Core/UnitCube.obj</Resource>
<Color A="1" B="1" G="0.196078435" R="0.196078435"/>
</c:Model>
<c:Player/>
<c:Team>
<Team>3</Team>
</c:Team>
<c:Transform>
<Position X="6.96941662" Y="2.02053547" Z="1.9484092"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:Health/>
<c:AABB/>
<c:Model>
<Resource>../assets/Models/Core/UnitCube.obj</Resource>
<Color A="1" B="1" G="0.196078435" R="0.196078435"/>
</c:Model>
<c:Player/>
<c:Team>
<Team>3</Team>
</c:Team>
<c:Transform>
<Position X="3.63076782" Y="2.5672617" Z="-0.0348547697"/>
</c:Transform>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
@@ -0,0 +1,205 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Entity xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
<Components>
<c:Transform/>
</Components>
<Children>
<Entity>
<Components>
<c:Model>
<Resource>../assets/Models/DummyScene.obj</Resource>
</c:Model>
<c:Transform/>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:Health>
<Health>60</Health>
</c:Health>
<c:AABB/>
<c:Camera/>
<c:Listener/>
<c:Player/>
<c:Team>
<Team>3</Team>
</c:Team>
<c:Transform>
<Position X="-0.151326105" Y="13.5594187" Z="12.5957394"/>
<Orientation X="-0.62831825" Y="0.0872534811" Z="-7.47903606e-09"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:AABB/>
<c:CapturePoint>
<HomePointForTeam>3</HomePointForTeam>
</c:CapturePoint>
<c:Model>
<Resource>../assets/Models/Core/UnitSphere.obj</Resource>
<Color A="1" B="1" G="0.200000003" R="0"/>
</c:Model>
<c:Team>
<Team>3</Team>
</c:Team>
<c:Transform>
<Position X="5.39647007" Y="2.36802292" Z="0.0546064377"/>
</c:Transform>
<c:Trigger/>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:AABB/>
<c:CapturePoint>
<CapturePointNumber>1</CapturePointNumber>
</c:CapturePoint>
<c:Model>
<Resource>../assets/Models/Core/UnitSphere.obj</Resource>
<Color A="1" B="1" G="1" R="0"/>
</c:Model>
<c:Team/>
<c:Transform>
<Position X="3.68890452" Y="2.32191443" Z="0"/>
</c:Transform>
<c:Trigger/>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:AABB/>
<c:CapturePoint>
<CapturePointNumber>2</CapturePointNumber>
</c:CapturePoint>
<c:Model>
<Resource>../assets/Models/Core/UnitSphere.obj</Resource>
</c:Model>
<c:Team/>
<c:Transform>
<Position X="1.98802853" Y="2.16289616" Z="0"/>
</c:Transform>
<c:Trigger/>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:AABB/>
<c:CapturePoint>
<CapturePointNumber>3</CapturePointNumber>
</c:CapturePoint>
<c:Model>
<Resource>../assets/Models/Core/UnitSphere.obj</Resource>
<Color A="1" B="0" G="1" R="1"/>
</c:Model>
<c:Team/>
<c:Transform>
<Position X="0.196968079" Y="1.99913001" Z="0"/>
</c:Transform>
<c:Trigger/>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:AABB/>
<c:CapturePoint>
<HomePointForTeam>2</HomePointForTeam>
<CapturePointNumber>4</CapturePointNumber>
</c:CapturePoint>
<c:Model>
<Resource>../assets/Models/Core/UnitSphere.obj</Resource>
<Color A="1" B="0" G="0.200000003" R="1"/>
</c:Model>
<c:Team>
<Team>2</Team>
</c:Team>
<c:Transform>
<Position X="-1.82539892" Y="1.96172595" Z="0"/>
</c:Transform>
<c:Trigger/>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:Health/>
<c:AABB/>
<c:Model>
<Resource>../assets/Models/Core/UnitCube.obj</Resource>
<Color A="1" B="0.482352942" G="0.490196079" R="1"/>
</c:Model>
<c:Player/>
<c:Team>
<Team>2</Team>
</c:Team>
<c:Transform>
<Position X="-7.44269609" Y="2.23822045" Z="-0.0577065349"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:Health/>
<c:AABB/>
<c:Model>
<Resource>../assets/Models/Core/UnitCube.obj</Resource>
<Color A="1" B="0.482352942" G="0.490196079" R="1"/>
</c:Model>
<c:Player/>
<c:Team>
<Team>2</Team>
</c:Team>
<c:Transform>
<Position X="-5.74354839" Y="2.23822045" Z="1.40012479"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:Health/>
<c:AABB/>
<c:Model>
<Resource>../assets/Models/Core/UnitCube.obj</Resource>
<Color A="1" B="1" G="0.196078435" R="0.196078435"/>
</c:Model>
<c:Player/>
<c:Team>
<Team>3</Team>
</c:Team>
<c:Transform>
<Position X="6.96941662" Y="2.02053547" Z="1.9484092"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:Health/>
<c:AABB/>
<c:Model>
<Resource>../assets/Models/Core/UnitCube.obj</Resource>
<Color A="1" B="1" G="0.196078435" R="0.196078435"/>
</c:Model>
<c:Player/>
<c:Team>
<Team>3</Team>
</c:Team>
<c:Transform>
<Position X="7.70311165" Y="2.02053547" Z="-0.0348547697"/>
</c:Transform>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Entity xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
<Components>
<c:Transform/>
</Components>
<Children>
<Entity>
<Components>
<c:AABB/>
<c:Collidable>
<Static>false</Static>
</c:Collidable>
<c:Transform>
<Position X="1.5" Y="0" Z="-7"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:Collidable>
<Static>false</Static>
</c:Collidable>
<c:Model>
<Resource>Models/Core/UnitCube.obj</Resource>
<Color A="1" B="0" G="1" R="0"/>
</c:Model>
<c:Transform>
<Position X="2" Y="0" Z="-7"/>
</c:Transform>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
+52 -2
View File
@@ -13,6 +13,7 @@
</c:Model> </c:Model>
<c:Transform> <c:Transform>
<Scale X="100" Y="1" Z="100"/> <Scale X="100" Y="1" Z="100"/>
<Orientation X="0" Y="2.59200001" Z="0"/>
</c:Transform> </c:Transform>
</Components> </Components>
<Children/> <Children/>
@@ -45,9 +46,58 @@
<Entity> <Entity>
<Components> <Components>
<c:Camera/> <c:Camera/>
<c:Listener/>
<c:Transform> <c:Transform>
<Position X="5.85247707" Y="3.8454349" Z="-1.14486957"/> <Position X="1.36896265" Y="4.4259491" Z="10.6640663"/>
<Orientation X="2.51327395" Y="1.23916209" Z="-3.1415925"/> <Orientation X="-0.0349078141" Y="0.157154545" Z="-2.60252193e-07"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:DirectionalLight/>
<c:Model>
<Resource>Models/DirectionalLightWidget.obj</Resource>
</c:Model>
<c:Transform>
<Position X="2.1529963" Y="6.59221172" Z="0.169116676"/>
<Orientation X="4.32000017" Y="4.6340003" Z="0"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:Model>
<Resource>Models/Assault.obj</Resource>
</c:Model>
<c:Transform>
<Position X="-2.00568962" Y="0.527161121" Z="0"/>
</c:Transform>
</Components>
<Children>
<Entity>
<Components>
<c:Model>
<Resource>Models/SecondaryWeapon.fbx</Resource>
</c:Model>
<c:Transform>
<Position X="-0.546139359" Y="0.853016734" Z="0.177482292"/>
<Orientation X="1.47266471" Y="0.524984181" Z="1.243698"/>
</c:Transform>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
<Entity>
<Components>
<c:Model>
<Resource>Models/Core/UnitSphere.obj</Resource>
</c:Model>
<c:Transform>
<Position X="0" Y="3.70000029" Z="0"/>
</c:Transform> </c:Transform>
</Components> </Components>
<Children/> <Children/>
+6 -2
View File
@@ -1,6 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?> <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Entity xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd" xmlns:c="components"> <Entity xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
<Components> <Components>
<c:Transform/> <c:Transform/>
</Components> </Components>
</Entity>
<Children/>
</Entity>
@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Entity xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
<Components>
<c:Transform/>
</Components>
<Children>
<Entity>
<Components>
<c:Camera/>
<c:Transform/>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:AABB/>
<c:Collidable/>
<c:Model>
<Resource>Models/Core/UnitCube.obj</Resource>
<Color A="1" B="0.513725519" G="0" R="1"/>
</c:Model>
<c:Transform>
<Position X="0" Y="2" Z="0"/>
<Scale X="5" Y="1" Z="5"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity name="Player">
<Components>
<c:AABB>
<Origin X="0" Y="0.773000062" Z="0"/>
<Size X="1" Y="1.60000002" Z="1"/>
</c:AABB>
<c:Collidable/>
<c:Physics/>
<c:Model>
<Resource>Models/Assault.obj</Resource>
<Color A="1" B="1" G="0" R="0"/>
</c:Model>
<c:Player/>
<c:Transform>
<Position X="0" Y="2.52699995" Z="0.0542778969"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:AABB/>
<c:Collidable/>
<c:Physics>
<Velocity X="0" Y="-0.0934068039" Z="0"/>
</c:Physics>
<c:Model>
<Resource>Models/Core/UnitCube.obj</Resource>
<Color A="1" B="0" G="1" R="1"/>
</c:Model>
<c:Player/>
<c:Transform>
<Position X="0" Y="4.15580511" Z="0"/>
<Scale X="0.704558551" Y="0.115156889" Z="1"/>
</c:Transform>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
+56
View File
@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Entity xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
<Components>
<c:Transform/>
</Components>
<Children>
<Entity>
<Components>
<c:AABB/>
<c:Collidable/>
<c:Model>
<Resource>Models/Core/UnitCube.obj</Resource>
<Color A="1" B="1" G="0" R="0"/>
</c:Model>
<c:Transform>
<Position X="-2" Y="0" Z="-7"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:AABB/>
<c:Collidable>
<Static>false</Static>
</c:Collidable>
<c:Model>
<Resource>Models/Core/UnitCube.obj</Resource>
<Color A="1" B="0" G="0" R="1"/>
</c:Model>
<c:Transform>
<Position X="1.5" Y="0" Z="-7"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:Collidable>
<Static>false</Static>
</c:Collidable>
<c:Model>
<Resource>Models/Core/UnitCube.obj</Resource>
<Color A="1" B="0" G="1" R="0"/>
</c:Model>
<c:Transform>
<Position X="2" Y="0" Z="-7"/>
</c:Transform>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
+18
View File
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Entity name="Player" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
<Components>
<c:AABB/>
<c:Physics/>
<c:Collidable/>
<c:Model>
<Resource>Models/Core/UnitSphere.obj</Resource>
<Color A="1" B="1" G="0" R="0"/>
</c:Model>
<c:Player/>
<c:Transform/>
</Components>
<Children/>
</Entity>
+64
View File
@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Entity xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
<Components>
<c:Transform/>
</Components>
<Children>
<Entity>
<Components>
<c:PlayerSpawn/>
<c:Spawner>
<EntityFile>Schema/Entities/Player.xml</EntityFile>
</c:Spawner>
<c:Team>
<Team>2</Team>
</c:Team>
<c:Transform>
<Position X="11.2723322" Y="1.28011799" Z="3.66820574"/>
</c:Transform>
</Components>
<Children>
<Entity>
<Components>
<c:SpawnPoint/>
<c:Model>
<Resource>Models/Core/UnitSphere.obj</Resource>
</c:Model>
<c:Transform>
<Position X="0" Y="0" Z="1.26689196"/>
<Scale X="0.300000012" Y="0.300000012" Z="0.300000012"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:SpawnPoint/>
<c:Model>
<Resource>Models/Core/UnitSphere.obj</Resource>
</c:Model>
<c:Transform>
<Position X="0" Y="0" Z="-1.14786315"/>
<Scale X="0.300000012" Y="0.300000012" Z="0.300000012"/>
</c:Transform>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
<Entity>
<Components>
<c:Camera/>
<c:Listener/>
<c:Transform>
<Position X="-0.123331964" Y="7.64918661" Z="6.59480286"/>
<Orientation X="-0.500915647" Y="-1.35800648" Z="-7.76194497e-07"/>
</c:Transform>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
+13
View File
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Entity xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
<Components>
<c:Team>
<Team>3</Team>
</c:Team>
<c:Transform/>
</Components>
<Children/>
</Entity>
+3
View File
@@ -4,6 +4,9 @@
<xs:include schemaLocation="Types/Quaternion.xsd"/> <xs:include schemaLocation="Types/Quaternion.xsd"/>
<xs:include schemaLocation="Types/Vector.xsd"/> <xs:include schemaLocation="Types/Vector.xsd"/>
<xs:include schemaLocation="Types/Color.xsd"/> <xs:include schemaLocation="Types/Color.xsd"/>
<xs:complexType name="enum" mixed="true">
<xs:choice></xs:choice>
</xs:complexType>
<xs:simpleType name="bool"> <xs:simpleType name="bool">
<xs:restriction base="xs:boolean"></xs:restriction> <xs:restriction base="xs:boolean"></xs:restriction>
</xs:simpleType> </xs:simpleType>
+13 -3
View File
@@ -11,14 +11,24 @@
<xs:complexType> <xs:complexType>
<xs:all> <xs:all>
<xs:element ref="c:Transform" minOccurs="0"/> <xs:element ref="c:Transform" minOccurs="0"/>
<xs:element ref="c:Physics" minOccurs="0"/>
<xs:element ref="c:Model" minOccurs="0"/> <xs:element ref="c:Model" minOccurs="0"/>
<xs:element ref="c:Test" minOccurs="0"/>
<xs:element ref="c:RaptorCopter" minOccurs="0"/> <xs:element ref="c:RaptorCopter" minOccurs="0"/>
<xs:element ref="c:Player" minOccurs="0"/> <xs:element ref="c:Player" minOccurs="0"/>
<xs:element ref="c:Camera" minOccurs="0"/>
<xs:element ref="c:AABB" minOccurs="0"/>
<xs:element ref="c:Trigger" minOccurs="0"/>
<xs:element ref="c:Health" minOccurs="0"/> <xs:element ref="c:Health" minOccurs="0"/>
<xs:element ref="c:CapturePoint" minOccurs="0"/>
<xs:element ref="c:PointLight" minOccurs="0"/> <xs:element ref="c:PointLight" minOccurs="0"/>
<xs:element ref="c:Listener" minOccurs="0"/> <xs:element ref="c:Listener" minOccurs="0"/>
<xs:element ref="c:SoundEmitter" minOccurs="0"/> <xs:element ref="c:SoundEmitter" minOccurs="0"/>
<xs:element ref="c:Collidable" minOccurs="0"/>
<xs:element ref="c:Spawner" minOccurs="0"/>
<xs:element ref="c:SpawnPoint" minOccurs="0"/>
<xs:element ref="c:PlayerSpawn" minOccurs="0"/>
<xs:element ref="c:Team" minOccurs="0"/>
<xs:element ref="c:DirectionalLight" minOccurs="0"/>
</xs:all> </xs:all>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
@@ -30,7 +40,7 @@
<xs:element name="EntityRef" minOccurs="0" maxOccurs="unbounded"> <xs:element name="EntityRef" minOccurs="0" maxOccurs="unbounded">
<xs:complexType> <xs:complexType>
<xs:all> <xs:all>
<xs:attribute name="file" type="xs:string" minOccurs="0"/> <xs:attribute name="file" type="xs:string" minOccurs="0"/>
</xs:all> </xs:all>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
@@ -39,7 +49,7 @@
</xs:element> </xs:element>
</xs:all> </xs:all>
<xs:attribute ref="xml:base"/> <xs:attribute ref="xml:base"/>
<xs:attribute name="name" type="xs:string" minOccurs="0" default=""/> <xs:attribute name="name" type="xs:string" minOccurs="0" default=""/>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
</xs:schema> </xs:schema>

Some files were not shown because too many files have changed in this diff Show More