Compare commits
64 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cf43817658 | |||
| 4769970715 | |||
| 3c8159220c | |||
| 2cbeef4c69 | |||
| 192de80782 | |||
| 51a588657e | |||
| 73716c28e2 | |||
| a3b7bd7df5 | |||
| 11025b5466 | |||
| eba36b8492 | |||
| 55854f5c0d | |||
| 12a181c1ff | |||
| b131f56f5e | |||
| 24aac6a00d | |||
| 45a92b362f | |||
| 2085d9ec9e | |||
| 6a3f585fb9 | |||
| 7b4826cb44 | |||
| 28d412f5c7 | |||
| 0e5f6da9a9 | |||
| 42b52a6766 | |||
| 9c2e459e0c | |||
| 8299b99e2f | |||
| c708f1582c | |||
| 782c1a388a | |||
| a188a3f7fa | |||
| ed7d00c1d8 | |||
| 9090be8acf | |||
| a3d4eb65d5 | |||
| 9b2a4be707 | |||
| 5474a18753 | |||
| 53cae25eb2 | |||
| 0a43f8104e | |||
| ca8b7cbee8 | |||
| be3cfef65f | |||
| 65f5bc673f | |||
| a22bc00d46 | |||
| 5bfcffc142 | |||
| 7054822be2 | |||
| ee92200300 | |||
| d3b1053f21 | |||
| 0c97ce7a4a | |||
| 13f020ddf5 | |||
| 8bcafc1151 | |||
| 65da634c71 | |||
| 97cbc55223 | |||
| c519ba2536 | |||
| 4b7613a659 | |||
| 7408da401b | |||
| a63ecb8133 | |||
| 788407b709 | |||
| 0e70dc6fa3 | |||
| 44302bb0f3 | |||
| 181017313d | |||
| 6615fe9438 | |||
| 113448dbf0 | |||
| 5c9616d4af | |||
| a954cbbf50 | |||
| dec2234019 | |||
| 0334ec3fa7 | |||
| 5fcd26cd3e | |||
| 8bed5194d8 | |||
| d12246833e | |||
| 6aeb281249 |
@@ -14,6 +14,9 @@ endif()
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
|
||||
elseif(MSVC)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
|
||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
||||
endif()
|
||||
|
||||
#set(BUILD_SHARED_LIBS FALSE)
|
||||
@@ -34,6 +37,12 @@ foreach(OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES})
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY})
|
||||
endforeach(OUTPUTCONFIG CMAKE_CONFIGURATION_TYPES)
|
||||
|
||||
# DEBUG definition
|
||||
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS
|
||||
$<$<CONFIG:Debug>:DEBUG>
|
||||
$<$<CONFIG:RelWithDebInfo>:DEBUG>
|
||||
)
|
||||
|
||||
include(cotire)
|
||||
add_subdirectory(src/Engine)
|
||||
add_subdirectory(src/Game)
|
||||
|
||||
+1
-1
Submodule assets updated: e4dc9529f2...c4898d8281
@@ -4,13 +4,14 @@
|
||||
#include "../Core/System.h"
|
||||
#include "../Core/Octree.h"
|
||||
#include "Collision.h"
|
||||
#include "EntityAABB.h"
|
||||
|
||||
class CollidableOctreeSystem : public ImpureSystem, public PureSystem
|
||||
{
|
||||
public:
|
||||
CollidableOctreeSystem(World* world, EventBroker* eventBroker, Octree<AABB>* octree)
|
||||
CollidableOctreeSystem(World* world, EventBroker* eventBroker, Octree<EntityAABB>* octree, const std::string& componentType)
|
||||
: System(world, eventBroker)
|
||||
, PureSystem("Collidable")
|
||||
, PureSystem(componentType)
|
||||
, m_Octree(octree)
|
||||
{ }
|
||||
|
||||
@@ -18,7 +19,7 @@ public:
|
||||
virtual void UpdateComponent(EntityWrapper& entity, ComponentWrapper& component, double dt) override;
|
||||
|
||||
private:
|
||||
Octree<AABB>* m_Octree;
|
||||
Octree<EntityAABB>* m_Octree;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "../Core/Transform.h"
|
||||
#include "../Core/Entity.h"
|
||||
#include "../Core/EntityWrapper.h"
|
||||
#include "EntityAABB.h"
|
||||
|
||||
class World;
|
||||
struct ComponentWrapper;
|
||||
@@ -58,10 +59,9 @@ bool AABBVsAABB(const AABB& a, const AABB& b);
|
||||
//Return true if the boxes are intersecting.
|
||||
//Also outputs the minimum translation that box [a] would need in order to resolve collision.
|
||||
bool AABBVsAABB(const AABB& a, const AABB& b, glm::vec3& minimumTranslation);
|
||||
bool IsSameBoxProbably(const AABB& first, const AABB& second, const float epsilon = 0.0001f);
|
||||
|
||||
// Calculates an absolute AABB from an entity AABB component
|
||||
boost::optional<AABB> EntityAbsoluteAABB(EntityWrapper& entity);
|
||||
boost::optional<EntityAABB> EntityAbsoluteAABB(EntityWrapper& entity);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -7,30 +7,23 @@
|
||||
#include "../Common.h"
|
||||
#include "../Core/System.h"
|
||||
#include "../Core/EventBroker.h"
|
||||
#include "../Core/EKeyUp.h"
|
||||
#include "../Core/Octree.h"
|
||||
#include "EntityAABB.h"
|
||||
|
||||
class CollisionSystem : public PureSystem
|
||||
{
|
||||
public:
|
||||
CollisionSystem(World* world, EventBroker* eventBroker, Octree<AABB>* octree)
|
||||
CollisionSystem(World* world, EventBroker* eventBroker, Octree<EntityAABB>* octree)
|
||||
: System(world, eventBroker)
|
||||
, PureSystem("Collidable")
|
||||
, m_Octree(octree)
|
||||
, zPress(false)
|
||||
{
|
||||
//TODO: Debug stuff, remove later.
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EKeyUp, &CollisionSystem::OnKeyUp);
|
||||
}
|
||||
{ }
|
||||
|
||||
virtual void UpdateComponent(EntityWrapper& entity, ComponentWrapper& component, double dt) override;
|
||||
|
||||
private:
|
||||
Octree<AABB>* m_Octree;
|
||||
bool zPress;
|
||||
|
||||
EventRelay<CollisionSystem, Events::KeyUp> m_EKeyUp;
|
||||
bool OnKeyUp(const Events::KeyUp &event);
|
||||
Octree<EntityAABB>* m_Octree;
|
||||
std::vector<EntityAABB> m_OctreeResult;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -2,7 +2,7 @@
|
||||
#define Events_TriggerEnter_h__
|
||||
|
||||
#include "../Core/EventBroker.h"
|
||||
#include "../Core/Entity.h"
|
||||
#include "../Core/EntityWrapper.h"
|
||||
|
||||
namespace Events
|
||||
{
|
||||
@@ -11,27 +11,27 @@ namespace Events
|
||||
struct TriggerTouch : Event
|
||||
{
|
||||
/** The id of the entity that touches the trigger. */
|
||||
EntityID Entity;
|
||||
EntityWrapper Entity;
|
||||
/** The id of the trigger entity. */
|
||||
EntityID Trigger;
|
||||
EntityWrapper Trigger;
|
||||
};
|
||||
|
||||
/** Thrown once, when an entity has completely left a trigger. */
|
||||
struct TriggerLeave : Event
|
||||
{
|
||||
/** The id of the entity that left the trigger. */
|
||||
EntityID Entity;
|
||||
EntityWrapper Entity;
|
||||
/** The id of the trigger entity. */
|
||||
EntityID Trigger;
|
||||
EntityWrapper Trigger;
|
||||
};
|
||||
|
||||
/** Thrown once, when an entity is completely contained inside a trigger. */
|
||||
struct TriggerEnter : Event
|
||||
{
|
||||
/** The id of the entity that entered the trigger. */
|
||||
EntityID Entity;
|
||||
EntityWrapper Entity;
|
||||
/** The id of the trigger entity. */
|
||||
EntityID Trigger;
|
||||
EntityWrapper Trigger;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
#ifndef EntityAABB_h__
|
||||
#define EntityAABB_h__
|
||||
|
||||
#include "../Core/AABB.h"
|
||||
#include "../Core/EntityWrapper.h"
|
||||
|
||||
struct EntityAABB : AABB
|
||||
{
|
||||
EntityAABB() = default;
|
||||
|
||||
EntityAABB(const glm::vec3& minPos, const glm::vec3& maxPos)
|
||||
: AABB(minPos, maxPos)
|
||||
{ }
|
||||
|
||||
EntityAABB(const AABB& aabb)
|
||||
: AABB(aabb)
|
||||
{ }
|
||||
|
||||
EntityWrapper Entity;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -8,13 +8,14 @@
|
||||
#include "../Core/EventBroker.h"
|
||||
#include "../Core/Octree.h"
|
||||
#include "ETrigger.h"
|
||||
#include "EntityAABB.h"
|
||||
|
||||
class AABB;
|
||||
|
||||
class TriggerSystem : public PureSystem
|
||||
{
|
||||
public:
|
||||
TriggerSystem(World* world, EventBroker* eventBroker, Octree<AABB>* octree)
|
||||
TriggerSystem(World* world, EventBroker* eventBroker, Octree<EntityAABB>* octree)
|
||||
: System(world, eventBroker)
|
||||
, PureSystem("Trigger")
|
||||
, m_Octree(octree)
|
||||
@@ -27,9 +28,10 @@ public:
|
||||
virtual void UpdateComponent(EntityWrapper& entity, ComponentWrapper& component, double dt) override;
|
||||
|
||||
private:
|
||||
Octree<AABB>* m_Octree;
|
||||
std::unordered_map<EntityID, std::unordered_set<EntityID>> m_EntitiesTouchingTrigger;
|
||||
std::unordered_map<EntityID, std::unordered_set<EntityID>> m_EntitiesCompletelyInTrigger;
|
||||
Octree<EntityAABB>* m_Octree;
|
||||
std::vector<EntityAABB> m_OctreeOut;
|
||||
std::unordered_map<EntityWrapper, std::unordered_set<EntityWrapper>> m_EntitiesTouchingTrigger;
|
||||
std::unordered_map<EntityWrapper, std::unordered_set<EntityWrapper>> m_EntitiesCompletelyInTrigger;
|
||||
|
||||
//TODO: Only exists for debug purposes, remove later.
|
||||
EventRelay<TriggerSystem, Events::TriggerEnter> m_EEnter;
|
||||
@@ -40,13 +42,13 @@ private:
|
||||
bool OnLeave(const Events::TriggerLeave &event);
|
||||
|
||||
//True if leave event was thrown.
|
||||
bool throwLeaveIfWasInTrigger(std::unordered_set<EntityID>& triggerSet, EntityID pId, EntityID tId);
|
||||
bool throwLeaveIfWasInTrigger(std::unordered_set<EntityWrapper>& triggerSet, EntityWrapper colliderENtity, EntityWrapper triggerEntity);
|
||||
template<typename Event>
|
||||
void publish(EntityID pId, EntityID tId)
|
||||
void publish(EntityWrapper collider, EntityWrapper trigger)
|
||||
{
|
||||
Event e;
|
||||
e.Trigger = tId;
|
||||
e.Entity = pId;
|
||||
e.Trigger = trigger;
|
||||
e.Entity = collider;
|
||||
m_EventBroker->Publish(e);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -9,7 +9,6 @@ public:
|
||||
AABB() = default;
|
||||
//No checks are made. Values in minPos must be less than values in maxPos, i.e. min.x < max.x, etc.
|
||||
AABB(const glm::vec3& minPos, const glm::vec3& maxPos);
|
||||
AABB(const glm::vec4& minPos, const glm::vec4& maxPos);
|
||||
//No checks are made. Size must consist of non-negative numbers.
|
||||
static AABB FromOriginSize(const glm::vec3& origin, const glm::vec3& size);
|
||||
virtual ~AABB();
|
||||
|
||||
@@ -81,7 +81,7 @@ class ComponentWrapperFactory
|
||||
{
|
||||
public:
|
||||
ComponentWrapperFactory() = default;
|
||||
ComponentWrapperFactory(std::string componentTypeName, std::size_t allocation = 0)
|
||||
ComponentWrapperFactory(std::string componentTypeName, unsigned int allocation = 0)
|
||||
{
|
||||
m_ComponentInfo.Name = componentTypeName;
|
||||
m_ComponentInfo.Meta->Allocation = allocation;
|
||||
|
||||
@@ -143,7 +143,7 @@ private:
|
||||
~EntityFile();
|
||||
|
||||
public:
|
||||
static std::size_t GetTypeStride(std::string typeName);
|
||||
static unsigned int GetTypeStride(std::string typeName);
|
||||
static void WriteAttributeData(char* outData, const ComponentInfo::Field_t& field, const std::map<std::string, std::string>& attributes);
|
||||
static void WriteValueData(char* outData, const ComponentInfo::Field_t& field, const char* valueData);
|
||||
|
||||
|
||||
@@ -35,7 +35,6 @@ struct EntityWrapper
|
||||
bool operator==(const EntityWrapper& e) const;
|
||||
bool operator!=(const EntityWrapper& e) const;
|
||||
explicit operator EntityID() const;
|
||||
operator bool();
|
||||
|
||||
private:
|
||||
EntityWrapper firstChildByNameRecursive(const std::string& name, EntityID parent);
|
||||
|
||||
@@ -42,7 +42,7 @@ enum class FileWatcher::FileEventFlags
|
||||
};
|
||||
|
||||
inline FileWatcher::FileEventFlags operator|(FileWatcher::FileEventFlags a, FileWatcher::FileEventFlags b) { return static_cast<FileWatcher::FileEventFlags>(static_cast<int>(a) | static_cast<int>(b)); }
|
||||
inline bool operator&(FileWatcher::FileEventFlags a, FileWatcher::FileEventFlags b) { return static_cast<int>(a)& static_cast<int>(b); }
|
||||
inline bool operator&(FileWatcher::FileEventFlags a, FileWatcher::FileEventFlags b) { return (static_cast<int>(a) & static_cast<int>(b)) != 0; }
|
||||
|
||||
class FileWatcher::Worker
|
||||
{
|
||||
@@ -54,7 +54,7 @@ public:
|
||||
private:
|
||||
struct FileInfo
|
||||
{
|
||||
int Size;
|
||||
std::size_t Size;
|
||||
std::time_t Timestamp;
|
||||
};
|
||||
|
||||
|
||||
@@ -29,41 +29,9 @@ enum _LOG_LEVEL
|
||||
|
||||
extern _LOG_LEVEL LOG_LEVEL;
|
||||
|
||||
const static char* _LOG_LEVEL_PREFIX[] =
|
||||
{
|
||||
"EE: ",
|
||||
"",
|
||||
"WW: ",
|
||||
"DD: "
|
||||
};
|
||||
extern const char* _LOG_LEVEL_PREFIX[];
|
||||
|
||||
static void _LOG(_LOG_LEVEL logLevel, const char* file, const char* func, unsigned int line, const char* format, ...)
|
||||
{
|
||||
if (logLevel > LOG_LEVEL) {
|
||||
return;
|
||||
}
|
||||
|
||||
char* message = nullptr;
|
||||
va_list args;
|
||||
|
||||
va_start(args, format);
|
||||
size_t size = vsnprintf(message, 0, format, args) + 1;
|
||||
va_end(args);
|
||||
|
||||
va_start(args, format);
|
||||
message = new char[size];
|
||||
vsnprintf(message, size, format, args);
|
||||
va_end(args);
|
||||
|
||||
if (logLevel == LOG_LEVEL_ERROR) {
|
||||
std::cerr << file << ":" << line << " " << func << std::endl;
|
||||
std::cerr << _LOG_LEVEL_PREFIX[logLevel] << message << std::endl;
|
||||
} else {
|
||||
std::cout << _LOG_LEVEL_PREFIX[logLevel] << message << std::endl;
|
||||
}
|
||||
|
||||
delete[] message;
|
||||
}
|
||||
extern void _LOG(_LOG_LEVEL logLevel, const char* file, const char* func, unsigned int line, const char* format, ...);
|
||||
|
||||
#define LOG(logLevel, format, ...) \
|
||||
_LOG(logLevel, __BASE_FILE__, __func__, __LINE__, format, ##__VA_ARGS__)
|
||||
@@ -77,7 +45,11 @@ static void _LOG(_LOG_LEVEL logLevel, const char* file, const char* func, unsign
|
||||
#define LOG_INFO(format, ...) \
|
||||
LOG(LOG_LEVEL_INFO, format, ##__VA_ARGS__)
|
||||
|
||||
#ifdef DEBUG
|
||||
#define LOG_DEBUG(format, ...) \
|
||||
LOG(LOG_LEVEL_DEBUG, format, ##__VA_ARGS__)
|
||||
#else
|
||||
#define LOG_DEBUG(format, ...)
|
||||
#endif
|
||||
|
||||
#endif // Logging_h__
|
||||
@@ -23,7 +23,7 @@ public:
|
||||
m_SpeedMultiplier = m_Config->Get<float>("Editor.CameraSpeed", 3.f);
|
||||
}
|
||||
|
||||
virtual const glm::vec3 Movement() const override { return m_Movement * m_SpeedMultiplier; }
|
||||
virtual const glm::vec3 Movement() const override { return m_Movement * static_cast<float>(m_SpeedMultiplier); }
|
||||
|
||||
void Enable() { m_Enabled = true; }
|
||||
void Disable() { m_Enabled = false; }
|
||||
@@ -69,7 +69,7 @@ public:
|
||||
protected:
|
||||
ConfigFile* m_Config;
|
||||
bool m_Enabled = false;
|
||||
float m_SpeedMultiplier = 1.f;
|
||||
double m_SpeedMultiplier = 1.f;
|
||||
|
||||
EventRelay<EventContext, Events::MousePress> m_EMousePress;
|
||||
bool OnMousePress(const Events::MousePress& e)
|
||||
@@ -105,7 +105,7 @@ protected:
|
||||
return false;
|
||||
}
|
||||
|
||||
m_SpeedMultiplier += e.DeltaY * (0.1f * m_SpeedMultiplier);
|
||||
m_SpeedMultiplier += e.DeltaY * (0.1 * m_SpeedMultiplier);
|
||||
m_Config->Set("Editor.CameraSpeed", m_SpeedMultiplier);
|
||||
m_Config->SaveToDisk();
|
||||
return true;
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <nativefiledialog/nfd.h>
|
||||
#include <boost/filesystem.hpp>
|
||||
#include <boost/any.hpp>
|
||||
#include <boost/algorithm/string/replace.hpp>
|
||||
#include "../Common.h"
|
||||
#include "../GLM.h"
|
||||
#include <glm/gtx/common.hpp>
|
||||
@@ -18,6 +19,8 @@
|
||||
#include "../Core/ResourceManager.h"
|
||||
#include "../Core/EPause.h"
|
||||
#include "../Core/EKeyDown.h"
|
||||
#include "../Core/ELockMouse.h"
|
||||
#include "../Core/EFileDropped.h"
|
||||
#include "../Rendering/Texture.h"
|
||||
|
||||
class EditorGUI
|
||||
@@ -32,6 +35,12 @@ public:
|
||||
Scale
|
||||
};
|
||||
|
||||
enum class WidgetSpace
|
||||
{
|
||||
Global,
|
||||
Local
|
||||
};
|
||||
|
||||
void Draw();
|
||||
|
||||
void SelectEntity(EntityWrapper entity);
|
||||
@@ -73,6 +82,9 @@ public:
|
||||
// Called when the user selects a widget mode.
|
||||
typedef std::function<void(WidgetMode)> OnWidgetMode_t;
|
||||
void SetWidgetModeCallback(OnWidgetMode_t f) { m_OnWidgetMode = f; }
|
||||
// Called when the user selects a widget space.
|
||||
typedef std::function<void(WidgetSpace)> OnWidgetSpace_t;
|
||||
void SetWidgetSpaceCallback(OnWidgetSpace_t f) { m_OnWidgetSpace = f; }
|
||||
|
||||
private:
|
||||
World* m_World;
|
||||
@@ -93,8 +105,12 @@ private:
|
||||
EntityWrapper m_CurrentlyDragging = EntityWrapper::Invalid;
|
||||
std::string m_LastErrorMessage;
|
||||
WidgetMode m_CurrentWidgetMode = WidgetMode::Translate;
|
||||
WidgetSpace m_CurrentWidgetSpace = WidgetSpace::Global;
|
||||
std::set<std::string> m_ModalsToOpen;
|
||||
std::map<std::string, boost::any> m_ModalData;
|
||||
std::string m_DroppedFile = "";
|
||||
bool m_Paused = false;
|
||||
bool m_MouseLocked = false;
|
||||
|
||||
// Callbacks
|
||||
OnEntitySelectedCallback_t m_OnEntitySelected = nullptr;
|
||||
@@ -107,10 +123,21 @@ private:
|
||||
OnComponentAttach_t m_OnComponentAttach = nullptr;
|
||||
OnComponentDelete_t m_OnComponentDelete = nullptr;
|
||||
OnWidgetMode_t m_OnWidgetMode = nullptr;
|
||||
OnWidgetSpace_t m_OnWidgetSpace = nullptr;
|
||||
|
||||
// Events
|
||||
EventRelay<EditorGUI, Events::KeyDown> m_EKeyDown;
|
||||
bool OnKeyDown(const Events::KeyDown& e);
|
||||
EventRelay<EditorGUI, Events::FileDropped> m_EFileDropped;
|
||||
bool OnFileDropped(const Events::FileDropped& e);
|
||||
EventRelay<EditorGUI, Events::Pause> m_EPause;
|
||||
bool OnPause(const Events::Pause& e);
|
||||
EventRelay<EditorGUI, Events::Resume> m_EResume;
|
||||
bool OnResume(const Events::Resume& e);
|
||||
EventRelay<EditorGUI, Events::LockMouse> m_ELockMouse;
|
||||
bool OnLockMouse(const Events::LockMouse& e);
|
||||
EventRelay<EditorGUI, Events::UnlockMouse> m_EUnlockMouse;
|
||||
bool OnUnlockMouse(const Events::UnlockMouse& e);
|
||||
|
||||
// Utility functions
|
||||
boost::filesystem::path fileOpenDialog();
|
||||
@@ -118,6 +145,9 @@ private:
|
||||
const std::string formatEntityName(EntityWrapper entity);
|
||||
GLuint tryLoadTexture(std::string filePath);
|
||||
void openModal(const std::string& modal);
|
||||
void setWidgetMode(WidgetMode mode);
|
||||
void toggleWidgetSpace();
|
||||
static bool compareCharArray(const char* c1, const char* c2);
|
||||
|
||||
// Entity file handling methods
|
||||
void entityImport(World* world);
|
||||
|
||||
@@ -41,6 +41,7 @@ private:
|
||||
double m_LastTime = 0.f;
|
||||
bool m_Enabled = true;
|
||||
EditorGUI::WidgetMode m_WidgetMode = EditorGUI::WidgetMode::Translate;
|
||||
EditorGUI::WidgetSpace m_WidgetSpace = EditorGUI::WidgetSpace::Global;
|
||||
EntityWrapper m_Widget = EntityWrapper::Invalid;
|
||||
EntityWrapper m_CurrentSelection = EntityWrapper::Invalid;
|
||||
|
||||
@@ -57,6 +58,7 @@ private:
|
||||
void OnEntityChangeName(EntityWrapper entity, const std::string& name);
|
||||
void OnComponentAttach(EntityWrapper entity, const std::string& componentType);
|
||||
void OnComponentDelete(EntityWrapper entity, const std::string& componentType);
|
||||
void OnWidgetSpace(EditorGUI::WidgetSpace widgetSpace);
|
||||
|
||||
// Events
|
||||
EventRelay<EditorSystem, Events::MousePress> m_EMousePress;
|
||||
|
||||
@@ -15,7 +15,11 @@ public:
|
||||
virtual const glm::vec3 Rotation() const { return m_Rotation; }
|
||||
virtual bool Jumping() const { return m_Jumping; }
|
||||
virtual bool Crouching() const { return m_Crouching; }
|
||||
|
||||
virtual bool DoubleJumping() const { return m_DoubleJumping; }
|
||||
virtual void SetDoubleJumping(bool isDoubleJumping) {
|
||||
m_DoubleJumping = isDoubleJumping;
|
||||
}
|
||||
|
||||
void LockMouse();
|
||||
void UnlockMouse();
|
||||
virtual bool OnCommand(const Events::InputCommand& e) override;
|
||||
@@ -27,8 +31,9 @@ protected:
|
||||
glm::vec3 m_Rotation;
|
||||
glm::vec3 m_Movement;
|
||||
bool m_Jumping = false;
|
||||
bool m_DoubleJumping = false;
|
||||
bool m_Crouching = false;
|
||||
|
||||
|
||||
EventRelay<EventContext, Events::LockMouse> m_ELockMouse;
|
||||
bool OnLockMouse(const Events::LockMouse& e);
|
||||
EventRelay<EventContext, Events::UnlockMouse> m_EUnlockMouse;
|
||||
@@ -36,7 +41,7 @@ protected:
|
||||
};
|
||||
|
||||
template <typename EventContext>
|
||||
FirstPersonInputController<EventContext>::FirstPersonInputController(EventBroker* eventBroker, int playerID)
|
||||
FirstPersonInputController<EventContext>::FirstPersonInputController(EventBroker* eventBroker, int playerID)
|
||||
: InputController(eventBroker)
|
||||
, m_PlayerID(playerID)
|
||||
{
|
||||
@@ -113,14 +118,14 @@ bool FirstPersonInputController<EventContext>::OnCommand(const Events::InputComm
|
||||
template <typename EventContext>
|
||||
bool FirstPersonInputController<EventContext>::OnUnlockMouse(const Events::UnlockMouse& e)
|
||||
{
|
||||
m_MouseLocked = false;
|
||||
m_MouseLocked = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
template <typename EventContext>
|
||||
bool FirstPersonInputController<EventContext>::OnLockMouse(const Events::LockMouse& e)
|
||||
{
|
||||
m_MouseLocked = true;
|
||||
m_MouseLocked = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ private:
|
||||
boost::asio::ip::udp::socket m_Socket;
|
||||
|
||||
// Sending message to server logic
|
||||
int bytesRead = -1;
|
||||
size_t bytesRead = 0;
|
||||
char readBuf[INPUTSIZE] = { 0 };
|
||||
|
||||
// Packet loss logic
|
||||
@@ -69,7 +69,7 @@ private:
|
||||
|
||||
// Private member functions
|
||||
void readFromServer();
|
||||
int receive(char* data);
|
||||
size_t receive(char* data);
|
||||
void send(Packet& packet);
|
||||
void connect();
|
||||
void disconnect();
|
||||
|
||||
@@ -29,7 +29,7 @@ protected:
|
||||
unsigned int m_SaveDataIntervalMs = 1000;
|
||||
std::clock_t m_SaveDataTimer;
|
||||
unsigned int m_MaxConnections;
|
||||
unsigned int m_TimeoutMs;
|
||||
double m_TimeoutMs;
|
||||
void saveToFile();
|
||||
void updateNetworkData();
|
||||
void initialize();
|
||||
|
||||
@@ -3,16 +3,16 @@
|
||||
#include <vector>
|
||||
|
||||
struct NetworkData {
|
||||
unsigned int TotalTime = 0;
|
||||
unsigned int TotalDataReceived = 0;
|
||||
unsigned int TotalDataSent = 0;
|
||||
unsigned int AmountOfMessagesReceived = 0;
|
||||
double TotalTime = 0;
|
||||
size_t TotalDataReceived = 0;
|
||||
size_t TotalDataSent = 0;
|
||||
size_t AmountOfMessagesReceived = 0;
|
||||
unsigned int AmountOfMessagesSent = 0;
|
||||
// Interval based
|
||||
unsigned int DataReceivedThisInterval = 0;
|
||||
unsigned int DataSentThisInterval = 0;
|
||||
size_t DataReceivedThisInterval = 0;
|
||||
size_t DataSentThisInterval = 0;
|
||||
// pair: first=reveived, second=send
|
||||
std::vector<std::pair<unsigned int, unsigned int>> BandwidthBytes;
|
||||
std::vector<std::pair<size_t, size_t>> BandwidthBytes;
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
@@ -13,7 +13,7 @@ public:
|
||||
// arg2: PacketID for identifying packet loss.
|
||||
Packet(MessageType type, unsigned int& packetID);
|
||||
// Used to create packet from already existing data buffer.
|
||||
Packet(char* data, const int sizeOfPacket);
|
||||
Packet(char* data, const size_t sizeOfPacket);
|
||||
Packet(MessageType type);
|
||||
~Packet();
|
||||
void Init(MessageType type, unsigned int& packetID);
|
||||
@@ -51,18 +51,18 @@ public:
|
||||
std::string ReadString();
|
||||
char* ReadData(int SizeOfData);
|
||||
void ChangePacketID(unsigned int& packetID);
|
||||
int Size() { return m_Offset; };
|
||||
size_t Size() { return m_Offset; };
|
||||
char* Data() { return m_Data; };
|
||||
unsigned int DataReadSize() { return m_ReturnDataOffset; }
|
||||
unsigned int MaxSize() { return m_MaxPacketSize; }
|
||||
unsigned int HeaderSize() { return m_HeaderSize; }
|
||||
size_t DataReadSize() { return m_ReturnDataOffset; }
|
||||
size_t MaxSize() { return m_MaxPacketSize; }
|
||||
size_t HeaderSize() { return m_HeaderSize; }
|
||||
|
||||
private:
|
||||
char* m_Data;
|
||||
unsigned int m_ReturnDataOffset = 0;
|
||||
int m_Offset = 0;
|
||||
unsigned int m_MaxPacketSize = 512;
|
||||
unsigned int m_HeaderSize = 0;
|
||||
size_t m_ReturnDataOffset = 0;
|
||||
size_t m_Offset = 0;
|
||||
size_t m_MaxPacketSize = 512;
|
||||
size_t m_HeaderSize = 0;
|
||||
void resizeData();
|
||||
};
|
||||
|
||||
|
||||
@@ -36,14 +36,14 @@ private:
|
||||
std::map<PlayerID, PlayerDefinition> m_ConnectedPlayers;
|
||||
// HACK: Fix INPUTSIZE
|
||||
char readBuffer[INPUTSIZE] = { 0 };
|
||||
int bytesRead = 0;
|
||||
size_t bytesRead = 0;
|
||||
// time for previouse message
|
||||
std::clock_t previousePingMessage = std::clock();
|
||||
std::clock_t previousSnapshotMessage = std::clock();
|
||||
std::clock_t timOutTimer = std::clock();
|
||||
// How often we send messages (milliseconds)
|
||||
int pingIntervalMs;
|
||||
int snapshotInterval;
|
||||
float pingIntervalMs;
|
||||
float snapshotInterval;
|
||||
int checkTimeOutInterval = 100;
|
||||
int m_NextPlayerID = 0;
|
||||
|
||||
@@ -59,7 +59,7 @@ private:
|
||||
PacketID m_PreviousPacketID = 0;
|
||||
|
||||
// Private member functions
|
||||
int receive(char* data);
|
||||
size_t receive(char* data);
|
||||
void readFromClients();
|
||||
void send(PlayerID player, Packet& packet);
|
||||
void send(Packet& packet);
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "ShaderProgram.h"
|
||||
//#include "Util/UnorderedMapVec2.h"
|
||||
#include "Texture.h"
|
||||
#include "imgui/imgui.h"
|
||||
|
||||
class DrawColorCorrectionPass
|
||||
{
|
||||
@@ -16,14 +17,13 @@ public:
|
||||
void InitializeFrameBuffers();
|
||||
void InitializeShaderPrograms();
|
||||
|
||||
void Draw(GLuint sceneTexture, GLuint bloomTexture);
|
||||
void Draw(GLuint sceneTexture, GLuint bloomTexture, GLfloat gamma, GLfloat exposure);
|
||||
private:
|
||||
const IRenderer* m_Renderer;
|
||||
|
||||
ShaderProgram* m_ColorCorrectionProgram;
|
||||
|
||||
Model* m_ScreenQuad;
|
||||
GLfloat m_Exposure;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -40,6 +40,8 @@ private:
|
||||
|
||||
Texture* m_WhiteTexture;
|
||||
Texture* m_BlackTexture;
|
||||
Texture* m_NeutralNormalTexture;
|
||||
Texture* m_GreyTexture;
|
||||
|
||||
FrameBuffer m_FinalPassFrameBuffer;
|
||||
GLuint m_BloomTexture;
|
||||
|
||||
@@ -25,21 +25,23 @@ class IRenderer
|
||||
{
|
||||
public:
|
||||
GLFWwindow* Window() const { return m_Window; }
|
||||
//Returns screen size including window border and header
|
||||
Rectangle Resolution() const { return m_Resolution; }
|
||||
void SetResolution(const Rectangle& resolution) { m_Resolution = resolution; }
|
||||
virtual void SetResolution(const Rectangle& resolution) { m_Resolution = resolution; }
|
||||
bool Fullscreen() { return m_Fullscreen; }
|
||||
void SetFullscreen(bool fullscreen) { m_Fullscreen = fullscreen; }
|
||||
virtual void SetFullscreen(bool fullscreen) { m_Fullscreen = fullscreen; }
|
||||
bool VSYNC() const { return m_VSYNC; }
|
||||
void SetVSYNC(bool vsync) { m_VSYNC = vsync; }
|
||||
virtual void SetVSYNC(bool vsync) { m_VSYNC = vsync; }
|
||||
//Returns screen size excluding window border and header
|
||||
Rectangle GetViewportSize() const { return m_ViewportSize; }
|
||||
virtual void Initialize() = 0;
|
||||
virtual void Update(double dt) = 0;
|
||||
virtual void Draw(RenderFrame& rq) = 0;
|
||||
virtual PickData Pick(glm::vec2 screenCord) = 0;
|
||||
|
||||
World* m_World; //Temp world, untill viktor merge.
|
||||
|
||||
protected:
|
||||
Rectangle m_Resolution = Rectangle::Rectangle(1280, 720);
|
||||
Rectangle m_ViewportSize = Rectangle::Rectangle(1280, 720);
|
||||
bool m_Fullscreen = false;
|
||||
bool m_VSYNC = false;
|
||||
int m_GLVersion[2];
|
||||
|
||||
@@ -22,10 +22,26 @@ struct ModelJob : RenderJob
|
||||
{
|
||||
Model = model;
|
||||
TextureID = (matGroup.Texture) ? matGroup.Texture->ResourceID : 0;
|
||||
DiffuseTexture = matGroup.Texture.get();
|
||||
NormalTexture = matGroup.NormalMap.get();
|
||||
SpecularTexture = matGroup.SpecularMap.get();
|
||||
IncandescenceTexture = matGroup.IncandescenceMap.get();
|
||||
if (modelComponent["DiffuseTexture"]) {
|
||||
DiffuseTexture = matGroup.Texture.get();
|
||||
} else {
|
||||
DiffuseTexture = nullptr;
|
||||
}
|
||||
if (modelComponent["NormalMap"]) {
|
||||
NormalTexture = matGroup.NormalMap.get();
|
||||
} else {
|
||||
NormalTexture = nullptr;
|
||||
}
|
||||
if (modelComponent["SpecularMap"]) {
|
||||
SpecularTexture = matGroup.SpecularMap.get();
|
||||
} else {
|
||||
SpecularTexture = nullptr;
|
||||
}
|
||||
if (modelComponent["GlowMap"]) {
|
||||
IncandescenceTexture = matGroup.IncandescenceMap.get();
|
||||
} else {
|
||||
IncandescenceTexture = nullptr;
|
||||
}
|
||||
DiffuseColor = matGroup.DiffuseColor;
|
||||
SpecularColor = matGroup.SpecularColor;
|
||||
IncandescenceColor = matGroup.IncandescenceColor;
|
||||
|
||||
@@ -75,21 +75,21 @@ private:
|
||||
|
||||
|
||||
void ReadMeshFile(std::string filePath);
|
||||
void ReadMeshFileHeader(unsigned int& offset, char* fileData, unsigned int& fileByteSize);
|
||||
void ReadMesh(unsigned int& offset, char* fileData, unsigned int& fileByteSize);
|
||||
void ReadVertices(unsigned int& offset, char* fileData, unsigned int& fileByteSize);
|
||||
void ReadIndices(unsigned int& offset, char* fileData, unsigned int& fileByteSize);
|
||||
void ReadMeshFileHeader(std::size_t& offset, char* fileData);
|
||||
void ReadMesh(std::size_t& offset, char* fileData, const unsigned int& fileByteSize);
|
||||
void ReadVertices(std::size_t& offset, char* fileData, const unsigned int& fileByteSize);
|
||||
void ReadIndices(std::size_t& offset, char* fileData, const unsigned int& fileByteSize);
|
||||
|
||||
void ReadMaterialFile(std::string filePath);
|
||||
void ReadMaterials(unsigned int &offset, char* fileData, unsigned int& fileByteSize);
|
||||
void ReadMaterialSingle(unsigned int &offset, char* fileData, unsigned int& fileByteSize);
|
||||
void ReadMaterials(std::size_t& offset, char* fileData, const unsigned int& fileByteSize);
|
||||
void ReadMaterialSingle(std::size_t& offset, char* fileData, const unsigned int& fileByteSize);
|
||||
|
||||
void ReadAnimationFile(std::string filePath);
|
||||
void ReadAnimationBindPoses(unsigned int &offset, char* fileData, unsigned int& fileByteSize);
|
||||
void ReadAnimationJoint(unsigned int &offset, char* fileData, unsigned int& fileByteSize);
|
||||
void ReadAnimationClips(unsigned int &offset, char* fileData, unsigned int& fileByteSize, unsigned int numberOfClips);
|
||||
void ReadAnimationClipSingle(unsigned int &offset, char* fileData, unsigned int& fileByteSize, unsigned int clipIndex);
|
||||
void ReadAnimationKeyFrame(unsigned int &offset, char* fileData, unsigned int& fileByteSize, unsigned int numberOfJoints, Skeleton::Animation& animation);
|
||||
void ReadAnimationBindPoses(std::size_t& offset, char* fileData, const unsigned int& fileByteSize);
|
||||
void ReadAnimationJoint(std::size_t& offset, char* fileData, const unsigned int& fileByteSize);
|
||||
void ReadAnimationClips(std::size_t& offset, char* fileData, const unsigned int& fileByteSize, unsigned int numberOfClips);
|
||||
void ReadAnimationClipSingle(std::size_t& offset, char* fileData, const unsigned int& fileByteSize, unsigned int clipIndex);
|
||||
void ReadAnimationKeyFrame(std::size_t& offset, char* fileData, const unsigned int& fileByteSize, unsigned int numberOfJoints, Skeleton::Animation& animation);
|
||||
|
||||
//void CreateSkeleton(std::vector<std::tuple<std::string, glm::mat4>> &boneInfo, std::map<std::string, int> &boneNameMapping, aiNode* node, int parentID);
|
||||
};
|
||||
|
||||
@@ -26,6 +26,7 @@ struct RenderScene
|
||||
std::list<std::shared_ptr<RenderJob>> DirectionalLightJobs;
|
||||
Rectangle Viewport;
|
||||
bool ClearDepth = false;
|
||||
glm::vec4 AmbientColor;
|
||||
|
||||
void Clear()
|
||||
{
|
||||
@@ -40,6 +41,9 @@ struct RenderScene
|
||||
struct RenderFrame
|
||||
{
|
||||
public:
|
||||
//TODO: Getters
|
||||
GLfloat Gamma = 2.2f;
|
||||
GLfloat Exposure = 1.f;
|
||||
|
||||
void Add(RenderScene &scene)
|
||||
{
|
||||
|
||||
@@ -35,17 +35,19 @@ private:
|
||||
|
||||
EventRelay<RenderSystem, Events::SetCamera> m_ESetCamera;
|
||||
bool OnSetCamera(Events::SetCamera &event);
|
||||
EventRelay<RenderSystem, Events::InputCommand> m_EInputCommand;
|
||||
bool OnInputCommand(const Events::InputCommand& e);
|
||||
EventRelay<RenderSystem, Events::PlayerSpawned> m_EPlayerSpawned;
|
||||
bool OnPlayerSpawned(Events::PlayerSpawned& e);
|
||||
|
||||
void fillModels(std::list<std::shared_ptr<RenderJob>>& opaqueJobs, std::list<std::shared_ptr<RenderJob>>& transparentJobs);
|
||||
void fillText(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;
|
||||
bool OnInputCommand(const Events::InputCommand& e);
|
||||
|
||||
void fillModels(std::list<std::shared_ptr<RenderJob>>& opaqueJobs, std::list<std::shared_ptr<RenderJob>>& transparentJobs);
|
||||
void fillLight(std::list<std::shared_ptr<RenderJob>>& jobs);
|
||||
bool isChildOfACamera(EntityWrapper entity);
|
||||
bool isChildOfCurrentCamera(EntityWrapper entity);
|
||||
|
||||
EventRelay<RenderSystem, Events::PlayerSpawned> m_EPlayerSpawned;
|
||||
bool OnPlayerSpawned(Events::PlayerSpawned& e);
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -9,7 +9,7 @@ inline bool _GLERROR(const char* info, const char* file, const char* func, unsig
|
||||
GLenum error = glGetError();
|
||||
if (error != GL_NO_ERROR)
|
||||
{
|
||||
_LOG(LOG_LEVEL_ERROR, file, func, line, "GL Error: %s, %i, %s", info, error, gluErrorString(error));
|
||||
_LOG(LOG_LEVEL_ERROR, file, func, line, "GL Error: %s\nError code: %i, %s\n", info, error, gluErrorString(error));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+4
-2
@@ -22,6 +22,7 @@
|
||||
#include "Core/Octree.h"
|
||||
#include "Rendering/Font.h"
|
||||
#include "Systems/InterpolationSystem.h"
|
||||
#include "Collision/EntityAABB.h"
|
||||
// Network
|
||||
#include <boost/thread.hpp>
|
||||
#include "Network/Network.h"
|
||||
@@ -49,8 +50,9 @@ private:
|
||||
InputProxy* m_InputProxy;
|
||||
GUI::Frame* m_FrameStack;
|
||||
World* m_World;
|
||||
Octree<AABB>* m_OctreeCollision;
|
||||
Octree<AABB>* m_OctreeFrustrumCulling;
|
||||
Octree<EntityAABB>* m_OctreeCollision;
|
||||
Octree<EntityAABB>* m_OctreeTrigger;
|
||||
Octree<EntityAABB>* m_OctreeFrustrumCulling;
|
||||
SystemPipeline* m_SystemPipeline;
|
||||
RenderFrame* m_RenderFrame;
|
||||
// Network variables
|
||||
|
||||
@@ -40,7 +40,7 @@ private:
|
||||
int m_BlueTeamHomeCapturePoint = m_NotACapturePoint;
|
||||
|
||||
int m_NumberOfCapturePoints = 0;
|
||||
std::map<int, EntityID> m_CapturePointNumberToEntityIDMap;
|
||||
std::map<int, EntityWrapper> m_CapturePointNumberToEntityMap;
|
||||
|
||||
//std::vector<ComponentWrapper>
|
||||
|
||||
@@ -48,8 +48,8 @@ private:
|
||||
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;
|
||||
std::vector<std::tuple<EntityWrapper, EntityWrapper>> m_ETriggerTouchVector;
|
||||
std::vector<std::tuple<EntityWrapper, EntityWrapper>> m_ETriggerLeaveVector;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -23,7 +23,7 @@ class InterpolationSystem : public PureSystem
|
||||
glm::vec3 Position;
|
||||
glm::vec3 Scale;
|
||||
glm::quat Orientation;
|
||||
double interpolationTime;
|
||||
float interpolationTime;
|
||||
};
|
||||
public:
|
||||
InterpolationSystem(World* world, EventBroker* eventBroker);
|
||||
|
||||
@@ -15,10 +15,6 @@ Space=Jump
|
||||
LeftControl=Crouch
|
||||
LeftShift=Sprint
|
||||
F1=ToggleEditor
|
||||
1=EditorToolMove
|
||||
2=EditorToolRotate
|
||||
3=EditorToolScale
|
||||
X=EditorToggleTransformSpace
|
||||
C=ConnectToServer
|
||||
N=SwitchToServer
|
||||
M=SwitchToClient
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
<xs:include schemaLocation="Components/AABB.xsd"/>
|
||||
<xs:include schemaLocation="Components/PointLight.xsd"/>
|
||||
<xs:include schemaLocation="Components/DirectionalLight.xsd"/>
|
||||
<xs:include schemaLocation="Components/SceneLight.xsd"/>
|
||||
<xs:include schemaLocation="Components/Trigger.xsd"/>
|
||||
<xs:include schemaLocation="Components/ExplosionEffect.xsd"/>
|
||||
<xs:include schemaLocation="Components/Health.xsd"/>
|
||||
@@ -28,4 +29,5 @@
|
||||
<xs:include schemaLocation="Components/Animation.xsd"/>
|
||||
<xs:include schemaLocation="Components/Fill.xsd"/>
|
||||
<xs:include schemaLocation="Components/Lifetime.xsd"/>
|
||||
<xs:include schemaLocation="Components/HiddenForLocalPlayer.xsd"/>
|
||||
</xs:schema>
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<Animation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Animation.xsd">
|
||||
<Name></Name>
|
||||
<Time>0</Time>
|
||||
<Speed>0</Speed>
|
||||
<Loop>true</Loop>
|
||||
|
||||
@@ -2,22 +2,11 @@
|
||||
|
||||
<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:include schemaLocation="../Types/TeamEnum.xsd"/>
|
||||
|
||||
<xs:element name="CapturePoint">
|
||||
<xs:annotation>
|
||||
<xs:documentation>A Capture Point. Add a Team Component to specify who currently owns it</xs:documentation>
|
||||
<xs:documentation>A Capture Point. Make sure to update the HomePoint,CapturePointNumber,Team for each</xs:documentation>
|
||||
</xs:annotation>
|
||||
<xs:complexType>
|
||||
<xs:all>
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<Listener xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Listener.xsd"/>
|
||||
<HealthHUD xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="HealthHUD.xsd"/>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<HiddenForLocalPlayer xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="HiddenForLocalPlayer.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="HiddenForLocalPlayer">
|
||||
<xs:annotation>
|
||||
<xs:documentation>Used to make the entity invisible if it's parented to the current local player entity (for first person player model and such)</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:element>
|
||||
</xs:schema>
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<Lifetime xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Animation.xsd">
|
||||
<Lifetime xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Lifetime.xsd">
|
||||
<Lifetime>0</Lifetime>
|
||||
</Animation>
|
||||
</Lifetime>
|
||||
@@ -4,4 +4,8 @@
|
||||
<Color R="1" G="1" B="1" A="1"/>
|
||||
<Transparent>false</Transparent>
|
||||
<Visible>true</Visible>
|
||||
<DiffuseTexture>true</DiffuseTexture>
|
||||
<NormalMap>true</NormalMap>
|
||||
<SpecularMap>true</SpecularMap>
|
||||
<GlowMap>true</GlowMap>
|
||||
</Model>
|
||||
@@ -19,7 +19,19 @@
|
||||
<xs:annotation><xs:documentation>Wether the model is transparent or not</xs:documentation></xs:annotation>
|
||||
</xs:element>
|
||||
<xs:element name="Visible" type="t:bool" minOccurs="0">
|
||||
<xs:annotation><xs:documentation>Wether the model is visible or not</xs:documentation></xs:annotation>
|
||||
<xs:annotation><xs:documentation>Whether the model is visible or not</xs:documentation></xs:annotation>
|
||||
</xs:element>
|
||||
<xs:element name="DiffuseTexture" type="t:bool" minOccurs="0">
|
||||
<xs:annotation><xs:documentation>Whether the model should use the Diffuse texture or not</xs:documentation></xs:annotation>
|
||||
</xs:element>
|
||||
<xs:element name="NormalMap" type="t:bool" minOccurs="0">
|
||||
<xs:annotation><xs:documentation>Whether the model should use the Normalmap or not</xs:documentation></xs:annotation>
|
||||
</xs:element>
|
||||
<xs:element name="SpecularMap" type="t:bool" minOccurs="0">
|
||||
<xs:annotation><xs:documentation>Whether the model should use the Specularmap or not</xs:documentation></xs:annotation>
|
||||
</xs:element>
|
||||
<xs:element name="GlowMap" type="t:bool" minOccurs="0">
|
||||
<xs:annotation><xs:documentation>Whether the model should use the Glowmap or not</xs:documentation></xs:annotation>
|
||||
</xs:element>
|
||||
</xs:all>
|
||||
</xs:complexType>
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<SceneLight xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="SceneLight.xsd">
|
||||
<AmbientColor R="0.2" G="0.2" B="0.2" A="1"/>
|
||||
<Visible>true</Visible>
|
||||
<Gamma>2.2</Gamma>
|
||||
<Exposure>1</Exposure>
|
||||
</SceneLight>
|
||||
@@ -0,0 +1,25 @@
|
||||
<?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="SceneLight">
|
||||
<xs:annotation>
|
||||
<xs:documentation>Some settings for the scene lighting</xs:documentation>
|
||||
</xs:annotation>
|
||||
<xs:complexType>
|
||||
<xs:all>
|
||||
<xs:element name="AmbientColor" type="t:Color" minOccurs="0">
|
||||
<xs:annotation><xs:documentation>Color of the ambient light</xs:documentation></xs:annotation>
|
||||
</xs:element>
|
||||
<xs:element name="Visible" type="t:bool" minOccurs="0">
|
||||
<xs:annotation><xs:documentation>Wether the ambient light should be applied or not</xs:documentation></xs:annotation>
|
||||
</xs:element>
|
||||
<xs:element name="Gamma" type="t:double" minOccurs="0">
|
||||
<xs:annotation><xs:documentation>Gamma correction for the scene</xs:documentation></xs:annotation>
|
||||
</xs:element>
|
||||
<xs:element name="Exposure" type="t:double" minOccurs="0">
|
||||
<xs:annotation><xs:documentation>The exposure of the camera</xs:documentation></xs:annotation>
|
||||
</xs:element>
|
||||
</xs:all>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:schema>
|
||||
@@ -2,18 +2,7 @@
|
||||
|
||||
<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:include schemaLocation="../Types/TeamEnum.xsd"/>
|
||||
|
||||
<xs:element name="Team">
|
||||
<xs:annotation>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>models/dummyscene.mesh</Resource>
|
||||
<Resource>Models/Test/DummyScene.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Position X="0" Y="-0" Z="0"/>
|
||||
@@ -31,7 +31,7 @@
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>models/animtest.</Resource>
|
||||
<Resource>Models/Test/AnimTest.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Position X="-0.0966923237" Y="1.2939688" Z="0.399702221"/>
|
||||
@@ -42,7 +42,7 @@
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>models/animTest.mesh</Resource>
|
||||
<Resource>Models/Test/AnimTest.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Position X="0" Y="1.31816244" Z="1.1888907"/>
|
||||
@@ -53,7 +53,7 @@
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>models/animTest.mesh</Resource>
|
||||
<Resource>Models/Test/AnimTest.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Position X="0.708824873" Y="1.30000007" Z="0"/>
|
||||
@@ -64,7 +64,7 @@
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>models/animTest.mesh</Resource>
|
||||
<Resource>Models/Test/AnimTest.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Position X="1.36948848" Y="1.20000005" Z="0"/>
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<Entity name="AssetBase" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>Models/Core/UnitCylinder.mesh</Resource>
|
||||
<Color A="1" B="1.56862748" G="1.56862748" R="1.56862748"/>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Position X="0" Y="-0.231354833" Z="0"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
|
||||
<Children>
|
||||
<Entity name="Light">
|
||||
<Components>
|
||||
<c:PointLight/>
|
||||
<c:Transform>
|
||||
<Position X="0" Y="0.663784981" Z="0"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity name="RotationOrigin">
|
||||
<Components>
|
||||
<c:RaptorCopter>
|
||||
<Speed>0.5</Speed>
|
||||
<Axis X="0" Y="1" Z="0"/>
|
||||
</c:RaptorCopter>
|
||||
<c:Transform>
|
||||
<Orientation X="0" Y="28.7916641" Z="0"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity name="Asset">
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>Models/Weapons/Blue/AssaultWeaponBlue.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Position X="0" Y="1" Z="0"/>
|
||||
<Orientation X="0.524000049" Y="0" Z="0"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
</Children>
|
||||
|
||||
</Entity>
|
||||
@@ -0,0 +1,17 @@
|
||||
<?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:AABB/>
|
||||
<c:CapturePoint/>
|
||||
<c:Model>
|
||||
<Resource>Models/Core/UnitSphere.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Team/>
|
||||
<c:Transform/>
|
||||
<c:Trigger/>
|
||||
</Components>
|
||||
|
||||
<Children/>
|
||||
|
||||
</Entity>
|
||||
@@ -9,7 +9,7 @@
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/DummyScene.mesh</Resource>
|
||||
<Resource>Models/Test/DummyScene.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
@@ -41,7 +41,7 @@
|
||||
<HomePointForTeam>3</HomePointForTeam>
|
||||
</c:CapturePoint>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/Core/UnitSphere.mesh</Resource>
|
||||
<Resource>Models/Core/UnitSphere.mesh</Resource>
|
||||
<Color A="1" B="1" G="0.200000003" R="0"/>
|
||||
</c:Model>
|
||||
<c:Team>
|
||||
@@ -61,7 +61,7 @@
|
||||
<CapturePointNumber>1</CapturePointNumber>
|
||||
</c:CapturePoint>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/Core/UnitSphere.mesh</Resource>
|
||||
<Resource>Models/Core/UnitSphere.mesh</Resource>
|
||||
<Color A="1" B="0" G="1" R="1"/>
|
||||
</c:Model>
|
||||
<c:Team>
|
||||
@@ -81,7 +81,7 @@
|
||||
<CapturePointNumber>2</CapturePointNumber>
|
||||
</c:CapturePoint>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/Core/UnitSphere.mesh</Resource>
|
||||
<Resource>Models/Core/UnitSphere.mesh</Resource>
|
||||
<Color A="1" B="1" G="1" R="0"/>
|
||||
</c:Model>
|
||||
<c:Team>
|
||||
@@ -102,7 +102,7 @@
|
||||
<CapturePointNumber>3</CapturePointNumber>
|
||||
</c:CapturePoint>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/Core/UnitSphere.mesh</Resource>
|
||||
<Resource>Models/Core/UnitSphere.mesh</Resource>
|
||||
<Color A="1" B="0" G="0.200000003" R="1"/>
|
||||
</c:Model>
|
||||
<c:Team>
|
||||
@@ -120,7 +120,7 @@
|
||||
<c:Health/>
|
||||
<c:AABB/>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/Core/UnitCube.mesh</Resource>
|
||||
<Resource>Models/Core/UnitCube.mesh</Resource>
|
||||
<Color A="1" B="0.482352942" G="0.490196079" R="1"/>
|
||||
</c:Model>
|
||||
<c:Player/>
|
||||
@@ -138,7 +138,7 @@
|
||||
<c:Health/>
|
||||
<c:AABB/>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/Core/UnitCube.mesh</Resource>
|
||||
<Resource>Models/Core/UnitCube.mesh</Resource>
|
||||
<Color A="1" B="1" G="0.196078435" R="0.196078435"/>
|
||||
</c:Model>
|
||||
<c:Player/>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/DummyScene.mesh</Resource>
|
||||
<Resource>Models/Test/DummyScene.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
@@ -42,7 +42,7 @@
|
||||
<CaptureTimer>6.9158446328696002</CaptureTimer>
|
||||
</c:CapturePoint>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/Core/UnitSphere.mesh</Resource>
|
||||
<Resource>Models/Core/UnitSphere.mesh</Resource>
|
||||
<Color A="1" B="0" G="1" R="1"/>
|
||||
</c:Model>
|
||||
<c:Team>
|
||||
@@ -63,7 +63,7 @@
|
||||
<CapturePointNumber>1</CapturePointNumber>
|
||||
</c:CapturePoint>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/Core/UnitSphere.mesh</Resource>
|
||||
<Resource>Models/Core/UnitSphere.mesh</Resource>
|
||||
<Color A="1" B="1" G="1" R="0"/>
|
||||
</c:Model>
|
||||
<c:Team>
|
||||
@@ -83,7 +83,7 @@
|
||||
<CapturePointNumber>2</CapturePointNumber>
|
||||
</c:CapturePoint>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/Core/UnitSphere.mesh</Resource>
|
||||
<Resource>Models/Core/UnitSphere.mesh</Resource>
|
||||
<Color A="1" B="0" G="0.200000003" R="1"/>
|
||||
</c:Model>
|
||||
<c:Team>
|
||||
@@ -104,7 +104,7 @@
|
||||
<CapturePointNumber>3</CapturePointNumber>
|
||||
</c:CapturePoint>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/Core/UnitSphere.mesh</Resource>
|
||||
<Resource>Models/Core/UnitSphere.mesh</Resource>
|
||||
<Color A="1" B="0" G="0.200000003" R="1"/>
|
||||
</c:Model>
|
||||
<c:Team>
|
||||
@@ -122,7 +122,7 @@
|
||||
<c:Health/>
|
||||
<c:AABB/>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/Core/UnitCube.mesh</Resource>
|
||||
<Resource>Models/Core/UnitCube.mesh</Resource>
|
||||
<Color A="1" B="0.482352942" G="0.490196079" R="1"/>
|
||||
</c:Model>
|
||||
<c:Player/>
|
||||
@@ -140,7 +140,7 @@
|
||||
<c:Health/>
|
||||
<c:AABB/>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/Core/UnitCube.mesh</Resource>
|
||||
<Resource>Models/Core/UnitCube.mesh</Resource>
|
||||
<Color A="1" B="1" G="0.196078435" R="0.196078435"/>
|
||||
</c:Model>
|
||||
<c:Player/>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/DummyScene.mesh</Resource>
|
||||
<Resource>Models/Test/DummyScene.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
@@ -41,7 +41,7 @@
|
||||
<HomePointForTeam>3</HomePointForTeam>
|
||||
</c:CapturePoint>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/Core/UnitSphere.mesh</Resource>
|
||||
<Resource>Models/Core/UnitSphere.mesh</Resource>
|
||||
<Color A="1" B="1" G="0.200000003" R="0"/>
|
||||
</c:Model>
|
||||
<c:Team>
|
||||
@@ -61,7 +61,7 @@
|
||||
<CapturePointNumber>1</CapturePointNumber>
|
||||
</c:CapturePoint>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/Core/UnitSphere.mesh</Resource>
|
||||
<Resource>Models/Core/UnitSphere.mesh</Resource>
|
||||
<Color A="1" B="1" G="1" R="0"/>
|
||||
</c:Model>
|
||||
<c:Team/>
|
||||
@@ -79,7 +79,7 @@
|
||||
<CapturePointNumber>2</CapturePointNumber>
|
||||
</c:CapturePoint>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/Core/UnitSphere.mesh</Resource>
|
||||
<Resource>Models/Core/UnitSphere.mesh</Resource>
|
||||
<Color A="1" B="0" G="1" R="1"/>
|
||||
</c:Model>
|
||||
<c:Team/>
|
||||
@@ -98,7 +98,7 @@
|
||||
<CapturePointNumber>3</CapturePointNumber>
|
||||
</c:CapturePoint>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/Core/UnitSphere.mesh</Resource>
|
||||
<Resource>Models/Core/UnitSphere.mesh</Resource>
|
||||
<Color A="1" B="0" G="0.200000003" R="1"/>
|
||||
</c:Model>
|
||||
<c:Team>
|
||||
@@ -116,7 +116,7 @@
|
||||
<c:Health/>
|
||||
<c:AABB/>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/Core/UnitCube.mesh</Resource>
|
||||
<Resource>Models/Core/UnitCube.mesh</Resource>
|
||||
<Color A="1" B="0.482352942" G="0.490196079" R="1"/>
|
||||
</c:Model>
|
||||
<c:Player/>
|
||||
@@ -134,7 +134,7 @@
|
||||
<c:Health/>
|
||||
<c:AABB/>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/Core/UnitCube.mesh</Resource>
|
||||
<Resource>Models/Core/UnitCube.mesh</Resource>
|
||||
<Color A="1" B="1" G="0.196078435" R="0.196078435"/>
|
||||
</c:Model>
|
||||
<c:Player/>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/DummyScene.mesh</Resource>
|
||||
<Resource>Models/Test/DummyScene.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
@@ -41,7 +41,7 @@
|
||||
<HomePointForTeam>3</HomePointForTeam>
|
||||
</c:CapturePoint>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/Core/UnitSphere.mesh</Resource>
|
||||
<Resource>Models/Core/UnitSphere.mesh</Resource>
|
||||
<Color A="1" B="1" G="0.200000003" R="0"/>
|
||||
</c:Model>
|
||||
<c:Team>
|
||||
@@ -61,7 +61,7 @@
|
||||
<CapturePointNumber>1</CapturePointNumber>
|
||||
</c:CapturePoint>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/Core/UnitSphere.mesh</Resource>
|
||||
<Resource>Models/Core/UnitSphere.mesh</Resource>
|
||||
<Color A="1" B="0" G="1" R="1"/>
|
||||
</c:Model>
|
||||
<c:Team>
|
||||
@@ -81,7 +81,7 @@
|
||||
<CapturePointNumber>2</CapturePointNumber>
|
||||
</c:CapturePoint>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/Core/UnitSphere.mesh</Resource>
|
||||
<Resource>Models/Core/UnitSphere.mesh</Resource>
|
||||
<Color A="1" B="1" G="1" R="0"/>
|
||||
</c:Model>
|
||||
<c:Team>
|
||||
@@ -101,7 +101,7 @@
|
||||
<CapturePointNumber>3</CapturePointNumber>
|
||||
</c:CapturePoint>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/Core/UnitSphere.mesh</Resource>
|
||||
<Resource>Models/Core/UnitSphere.mesh</Resource>
|
||||
<Color A="1" B="0" G="0.200000003" R="1"/>
|
||||
</c:Model>
|
||||
<c:Team>
|
||||
@@ -122,7 +122,7 @@
|
||||
<CapturePointNumber>4</CapturePointNumber>
|
||||
</c:CapturePoint>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/Core/UnitSphere.mesh</Resource>
|
||||
<Resource>Models/Core/UnitSphere.mesh</Resource>
|
||||
<Color A="1" B="0" G="0.200000003" R="1"/>
|
||||
</c:Model>
|
||||
<c:Team>
|
||||
@@ -140,7 +140,7 @@
|
||||
<c:Health/>
|
||||
<c:AABB/>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/Core/UnitCube.mesh</Resource>
|
||||
<Resource>Models/Core/UnitCube.mesh</Resource>
|
||||
<Color A="1" B="0.482352942" G="0.490196079" R="1"/>
|
||||
</c:Model>
|
||||
<c:Player/>
|
||||
@@ -158,7 +158,7 @@
|
||||
<c:Health/>
|
||||
<c:AABB/>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/Core/UnitCube.mesh</Resource>
|
||||
<Resource>Models/Core/UnitCube.mesh</Resource>
|
||||
<Color A="1" B="0.482352942" G="0.490196079" R="1"/>
|
||||
</c:Model>
|
||||
<c:Player/>
|
||||
@@ -176,7 +176,7 @@
|
||||
<c:Health/>
|
||||
<c:AABB/>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/Core/UnitCube.mesh</Resource>
|
||||
<Resource>Models/Core/UnitCube.mesh</Resource>
|
||||
<Color A="1" B="1" G="0.196078435" R="0.196078435"/>
|
||||
</c:Model>
|
||||
<c:Player/>
|
||||
@@ -194,7 +194,7 @@
|
||||
<c:Health/>
|
||||
<c:AABB/>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/Core/UnitCube.mesh</Resource>
|
||||
<Resource>Models/Core/UnitCube.mesh</Resource>
|
||||
<Color A="1" B="1" G="0.196078435" R="0.196078435"/>
|
||||
</c:Model>
|
||||
<c:Player/>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/DummyScene.mesh</Resource>
|
||||
<Resource>Models/Test/DummyScene.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
@@ -41,7 +41,7 @@
|
||||
<HomePointForTeam>3</HomePointForTeam>
|
||||
</c:CapturePoint>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/Core/UnitSphere.mesh</Resource>
|
||||
<Resource>Models/Core/UnitSphere.mesh</Resource>
|
||||
<Color A="1" B="1" G="0.200000003" R="0"/>
|
||||
</c:Model>
|
||||
<c:Team>
|
||||
@@ -61,7 +61,7 @@
|
||||
<CapturePointNumber>1</CapturePointNumber>
|
||||
</c:CapturePoint>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/Core/UnitSphere.mesh</Resource>
|
||||
<Resource>Models/Core/UnitSphere.mesh</Resource>
|
||||
<Color A="1" B="1" G="1" R="0"/>
|
||||
</c:Model>
|
||||
<c:Team/>
|
||||
@@ -79,7 +79,7 @@
|
||||
<CapturePointNumber>2</CapturePointNumber>
|
||||
</c:CapturePoint>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/Core/UnitSphere.mesh</Resource>
|
||||
<Resource>Models/Core/UnitSphere.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Team/>
|
||||
<c:Transform>
|
||||
@@ -96,7 +96,7 @@
|
||||
<CapturePointNumber>3</CapturePointNumber>
|
||||
</c:CapturePoint>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/Core/UnitSphere.mesh</Resource>
|
||||
<Resource>Models/Core/UnitSphere.mesh</Resource>
|
||||
<Color A="1" B="0" G="1" R="1"/>
|
||||
</c:Model>
|
||||
<c:Team/>
|
||||
@@ -115,7 +115,7 @@
|
||||
<CapturePointNumber>4</CapturePointNumber>
|
||||
</c:CapturePoint>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/Core/UnitSphere.mesh</Resource>
|
||||
<Resource>Models/Core/UnitSphere.mesh</Resource>
|
||||
<Color A="1" B="0" G="0.200000003" R="1"/>
|
||||
</c:Model>
|
||||
<c:Team>
|
||||
@@ -133,7 +133,7 @@
|
||||
<c:Health/>
|
||||
<c:AABB/>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/Core/UnitCube.mesh</Resource>
|
||||
<Resource>Models/Core/UnitCube.mesh</Resource>
|
||||
<Color A="1" B="0.482352942" G="0.490196079" R="1"/>
|
||||
</c:Model>
|
||||
<c:Player/>
|
||||
@@ -151,7 +151,7 @@
|
||||
<c:Health/>
|
||||
<c:AABB/>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/Core/UnitCube.mesh</Resource>
|
||||
<Resource>Models/Core/UnitCube.mesh</Resource>
|
||||
<Color A="1" B="0.482352942" G="0.490196079" R="1"/>
|
||||
</c:Model>
|
||||
<c:Player/>
|
||||
@@ -169,7 +169,7 @@
|
||||
<c:Health/>
|
||||
<c:AABB/>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/Core/UnitCube.mesh</Resource>
|
||||
<Resource>Models/Core/UnitCube.mesh</Resource>
|
||||
<Color A="1" B="1" G="0.196078435" R="0.196078435"/>
|
||||
</c:Model>
|
||||
<c:Player/>
|
||||
@@ -187,7 +187,7 @@
|
||||
<c:Health/>
|
||||
<c:AABB/>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/Core/UnitCube.mesh</Resource>
|
||||
<Resource>Models/Core/UnitCube.mesh</Resource>
|
||||
<Color A="1" B="1" G="0.196078435" R="0.196078435"/>
|
||||
</c:Model>
|
||||
<c:Player/>
|
||||
|
||||
@@ -0,0 +1,173 @@
|
||||
<?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>
|
||||
<Position X="0.340887427" Y="0" Z="0"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
|
||||
<Children>
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:AABB/>
|
||||
<c:CapturePoint>
|
||||
<HomePointForTeam>
|
||||
<Red/>
|
||||
</HomePointForTeam>
|
||||
</c:CapturePoint>
|
||||
<c:Model>
|
||||
<Resource>Models/Core/UnitSphere.mesh</Resource>
|
||||
<Color A="1" B="0" G="0.200000003" R="1"/>
|
||||
</c:Model>
|
||||
<c:Team>
|
||||
<Team>
|
||||
<Red/>
|
||||
</Team>
|
||||
</c:Team>
|
||||
<c:Transform>
|
||||
<Position X="6.60000038" Y="0" Z="0"/>
|
||||
</c:Transform>
|
||||
<c:Trigger/>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:AABB/>
|
||||
<c:CapturePoint>
|
||||
<CapturePointNumber>1</CapturePointNumber>
|
||||
</c:CapturePoint>
|
||||
<c:Model>
|
||||
<Resource>Models/Core/UnitSphere.mesh</Resource>
|
||||
<Color A="1" B="1" G="1" R="0"/>
|
||||
</c:Model>
|
||||
<c:Team/>
|
||||
<c:Transform>
|
||||
<Position X="4.46673203" Y="0" Z="3.50259304"/>
|
||||
</c:Transform>
|
||||
<c:Trigger/>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:AABB/>
|
||||
<c:CapturePoint>
|
||||
<CapturePointNumber>2</CapturePointNumber>
|
||||
</c:CapturePoint>
|
||||
<c:Model>
|
||||
<Resource>Models/Core/UnitSphere.mesh</Resource>
|
||||
<Color A="1" B="1" G="0.200000003" R="0"/>
|
||||
</c:Model>
|
||||
<c:Team>
|
||||
<Team>
|
||||
<Blue/>
|
||||
</Team>
|
||||
</c:Team>
|
||||
<c:Transform>
|
||||
<Position X="3.00000024" Y="0" Z="0.113596022"/>
|
||||
</c:Transform>
|
||||
<c:Trigger/>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:AABB/>
|
||||
<c:CapturePoint>
|
||||
<CapturePointNumber>3</CapturePointNumber>
|
||||
</c:CapturePoint>
|
||||
<c:Model>
|
||||
<Resource>Models/Core/UnitSphere.mesh</Resource>
|
||||
<Color A="1" B="1" G="0.200000003" R="0"/>
|
||||
</c:Model>
|
||||
<c:Team>
|
||||
<Team>
|
||||
<Blue/>
|
||||
</Team>
|
||||
</c:Team>
|
||||
<c:Transform>
|
||||
<Position X="1.75382805" Y="0" Z="0.0895374417"/>
|
||||
</c:Transform>
|
||||
<c:Trigger/>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:AABB/>
|
||||
<c:CapturePoint>
|
||||
<HomePointForTeam>
|
||||
<Blue/>
|
||||
</HomePointForTeam>
|
||||
<CapturePointNumber>4</CapturePointNumber>
|
||||
</c:CapturePoint>
|
||||
<c:Model>
|
||||
<Resource>Models/Core/UnitSphere.mesh</Resource>
|
||||
<Color A="1" B="1" G="0.200000003" R="0"/>
|
||||
</c:Model>
|
||||
<c:Team>
|
||||
<Team>
|
||||
<Blue/>
|
||||
</Team>
|
||||
</c:Team>
|
||||
<c:Transform>
|
||||
<Position X="0.56674248" Y="0" Z="0"/>
|
||||
</c:Transform>
|
||||
<c:Trigger/>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:AABB/>
|
||||
<c:Health/>
|
||||
<c:Model>
|
||||
<Resource>Models/Core/UnitCube.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Player/>
|
||||
<c:Team>
|
||||
<Team>
|
||||
<Blue/>
|
||||
</Team>
|
||||
</c:Team>
|
||||
<c:Transform>
|
||||
<Position X="4.29100037" Y="-0.08556436" Z="1.29717529"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:AABB/>
|
||||
<c:Health/>
|
||||
<c:Model>
|
||||
<Resource>Models/Core/UnitCube.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Player/>
|
||||
<c:Team>
|
||||
<Team>
|
||||
<Red/>
|
||||
</Team>
|
||||
</c:Team>
|
||||
<c:Transform>
|
||||
<Position X="5.43557501" Y="0.888866663" Z="1.55849135"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>Models/Test/DummyScene.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Position X="-0.600000024" Y="0" Z="0"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
</Children>
|
||||
|
||||
</Entity>
|
||||
@@ -6,7 +6,7 @@
|
||||
<Orientation X="0" Y="0" Z="0"/>
|
||||
</c:Transform>
|
||||
<c:Model>
|
||||
<Resource>Models/DummyScene.mesh</Resource>
|
||||
<Resource>Models/Test/DummyScene.mesh</Resource>
|
||||
</c:Model>
|
||||
</Components>
|
||||
<Children>
|
||||
@@ -28,7 +28,7 @@
|
||||
<Scale X="2" Y="2" Z="2"/>
|
||||
</c:Transform>
|
||||
<c:Model>
|
||||
<Resource>Models/RotationWidgetX.mesh</Resource>
|
||||
<Resource>Models/Widgets/Rotate/RotationWidgetX.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Trigger>
|
||||
</c:Trigger>
|
||||
|
||||
@@ -2,11 +2,13 @@
|
||||
<Entity xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||
|
||||
<Components>
|
||||
<c:Transform/>
|
||||
<c:Transform>
|
||||
<Position X="0" Y="-1" Z="0"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
|
||||
<Children>
|
||||
<Entity>
|
||||
<Entity name="Ground">
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>Models/Core/UnitCube.mesh</Resource>
|
||||
@@ -18,90 +20,320 @@
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>An error</Resource>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Position X="1" Y="1" Z="0"/>
|
||||
<Orientation X="0" Y="0.785390019" Z="0"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>An error</Resource>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Position X="2" Y="0" Z="0"/>
|
||||
<Orientation X="0" Y="0.785390019" Z="0"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
<Entity>
|
||||
<Entity name="Listener">
|
||||
<Components>
|
||||
<c:Camera/>
|
||||
<c:Listener/>
|
||||
<c:Transform>
|
||||
<Position X="1.36896265" Y="4.4259491" Z="10.6640663"/>
|
||||
<Position X="1.36896265" Y="4.10503054" Z="10.6640663"/>
|
||||
<Orientation X="-0.0349078141" Y="0.157154545" Z="-2.60252193e-07"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity>
|
||||
<Entity name="DirectionalLight">
|
||||
<Components>
|
||||
<c:DirectionalLight/>
|
||||
<c:DirectionalLight>
|
||||
<Intensity>0.80000001192092896</Intensity>
|
||||
</c:DirectionalLight>
|
||||
<c:Model>
|
||||
<Resource>Models/DirectionalLightWidget.mesh</Resource>
|
||||
<Resource>Models/Widgets/Lights/DirectionalLightWidget.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:RaptorCopter>
|
||||
<Speed>1</Speed>
|
||||
<Axis X="0" Y="1" Z="0"/>
|
||||
</c:RaptorCopter>
|
||||
<c:Transform>
|
||||
<Position X="2.1529963" Y="6.59221172" Z="0.169116676"/>
|
||||
<Orientation X="4.32000017" Y="4.6340003" Z="0"/>
|
||||
<Orientation X="4.16300011" Y="7875.41211" Z="0"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity>
|
||||
<Entity name="AssaultTPose">
|
||||
<Components>
|
||||
<c:ExplosionEffect>
|
||||
<ColorByDistance>true</ColorByDistance>
|
||||
<Velocity X="0" Y="0" Z="0.300000012"/>
|
||||
<ExplosionOrigin X="0" Y="1.30000007" Z="0"/>
|
||||
<TimeSinceDeath>5.0498686575577523</TimeSinceDeath>
|
||||
<ExplosionDuration>5</ExplosionDuration>
|
||||
<EndColor A="1" B="1" G="0" R="0"/>
|
||||
<RandomnessScalar>3</RandomnessScalar>
|
||||
</c:ExplosionEffect>
|
||||
<c:Model>
|
||||
<Resource>Models/Assault.mesh</Resource>
|
||||
<Resource>Models/Characters/Assault/AssaultTPose.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Position X="-2.00568962" Y="0.527161121" Z="0"/>
|
||||
<Position X="-1.68900967" Y="0.527161121" Z="-1.59648728"/>
|
||||
<Orientation X="0" Y="1.64900005" Z="0"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity>
|
||||
<Entity name="SecondaryWeapon">
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>Models/SecondaryWeapon.fbx</Resource>
|
||||
<Resource>Models/Weapons/Red/AssaultWeaponRed.mesh</Resource>
|
||||
<Transparent>true</Transparent>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Position X="-0.546139359" Y="0.853016734" Z="0.177482292"/>
|
||||
<Orientation X="1.47266471" Y="0.524984181" Z="1.243698"/>
|
||||
<Position X="-0.560000002" Y="0.754308224" Z="0.181485131"/>
|
||||
<Orientation X="0.989000022" Y="0" Z="6.10900021"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity name="SecondaryWeaponRed">
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>Models/Weapons/Red/DefenderGunRed.mesh</Resource>
|
||||
<Transparent>true</Transparent>
|
||||
<NormalMap>false</NormalMap>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Position X="0.515922487" Y="0.787437975" Z="0.132855967"/>
|
||||
<Orientation X="0.989000022" Y="0" Z="0"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
<Entity>
|
||||
<Entity name="AnimationGroupOrigin">
|
||||
<Components>
|
||||
<c:Transform>
|
||||
<Position X="1.11190474" Y="0.490183681" Z="0"/>
|
||||
<Orientation X="0" Y="1.02100003" Z="0"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity name="RunAnim">
|
||||
<Components>
|
||||
<c:Animation>
|
||||
<Name>Run</Name>
|
||||
<Time>0.17818245776980568</Time>
|
||||
<Speed>1</Speed>
|
||||
</c:Animation>
|
||||
<c:Model>
|
||||
<Resource>Models/Characters/Assault/AssaultAnimated.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Position X="0.786919653" Y="0" Z="0"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity name="Walkanim">
|
||||
<Components>
|
||||
<c:Animation>
|
||||
<Name>Walk</Name>
|
||||
<Time>0.34546191187031372</Time>
|
||||
<Speed>1</Speed>
|
||||
</c:Animation>
|
||||
<c:Model>
|
||||
<Resource>Models/Characters/Assault/AssaultAnimated.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity name="UnitSphere">
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>Models/Core/UnitSphere.mesh</Resource>
|
||||
<Color A="0.294117659" B="19.6078434" G="1.17647064" R="0.0392156877"/>
|
||||
<Transparent>true</Transparent>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Position X="0" Y="0.754540265" Z="0"/>
|
||||
<Scale X="0.800000012" Y="1.9000001" Z="1"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
<Entity name="Log">
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>Models/Core/UnitSphere.mesh</Resource>
|
||||
<Resource>Models/Props/TreeLog.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Position X="0" Y="3.70000029" Z="0"/>
|
||||
<Position X="-4" Y="0.698000014" Z="-1"/>
|
||||
<Orientation X="0" Y="2.74900007" Z="0"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity name="SpheresOrigin">
|
||||
<Components>
|
||||
<c:Transform>
|
||||
<Position X="6.80000019" Y="4.9000001" Z="-5.9000001"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity name="CombinedSpheres">
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>Models/Test/NormSpecIncdMapSphere.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity name="RotationPoint">
|
||||
<Components>
|
||||
<c:RaptorCopter>
|
||||
<Speed>1</Speed>
|
||||
<Axis X="1" Y="1" Z="1"/>
|
||||
</c:RaptorCopter>
|
||||
<c:Transform>
|
||||
<Orientation X="6484.80273" Y="6484.80273" Z="6484.80273"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity name="PointLight">
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>Models/Core/UnitSphere.mesh</Resource>
|
||||
<Color A="1" B="0" G="3.92156863" R="3.92156863"/>
|
||||
</c:Model>
|
||||
<c:PointLight>
|
||||
<Radius>3</Radius>
|
||||
<Intensity>1.1399998664855957</Intensity>
|
||||
</c:PointLight>
|
||||
<c:Transform>
|
||||
<Position X="-1.70000005" Y="0" Z="0"/>
|
||||
<Scale X="0.100000001" Y="0.100000001" Z="0.100000001"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity name="PointLight">
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>Models/Core/UnitSphere.mesh</Resource>
|
||||
<Color A="1" B="0" G="3.92156863" R="3.92156863"/>
|
||||
</c:Model>
|
||||
<c:PointLight>
|
||||
<Radius>5.0100002288818359</Radius>
|
||||
<Intensity>0.69999998807907104</Intensity>
|
||||
</c:PointLight>
|
||||
<c:Transform>
|
||||
<Position X="0.900000036" Y="1.10000002" Z="0"/>
|
||||
<Scale X="0.100000001" Y="0.100000001" Z="0.100000001"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity name="PointLight">
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>Models/Core/UnitSphere.mesh</Resource>
|
||||
<Color A="1" B="0" G="3.92156863" R="3.92156863"/>
|
||||
</c:Model>
|
||||
<c:PointLight>
|
||||
<Radius>4</Radius>
|
||||
<Intensity>0.80000001192092896</Intensity>
|
||||
</c:PointLight>
|
||||
<c:Transform>
|
||||
<Position X="0.400000006" Y="-1" Z="-1.50000012"/>
|
||||
<Scale X="0.100000001" Y="0.100000001" Z="0.100000001"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
<Entity name="SphereRotationOrigin">
|
||||
<Components>
|
||||
<c:RaptorCopter>
|
||||
<Speed>1</Speed>
|
||||
<Axis X="0" Y="1" Z="0"/>
|
||||
</c:RaptorCopter>
|
||||
<c:Transform>
|
||||
<Orientation X="0" Y="6281.02246" Z="0"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity name="NormalSphere">
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>Models/Test/NormalMapSphere.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Position X="1.82700014" Y="0" Z="-0.166000009"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity name="SpecularSphere">
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>Models/Test/SpecularMapSphere.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Position X="-1.06487739" Y="0" Z="1.52336037"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity name="Rotationpoint">
|
||||
<Components>
|
||||
<c:RaptorCopter>
|
||||
<Speed>1</Speed>
|
||||
<Axis X="0.699999988" Y="1" Z="0.300000012"/>
|
||||
</c:RaptorCopter>
|
||||
<c:Transform>
|
||||
<Orientation X="4905.44824" Y="7008.50781" Z="2103.03223"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children>
|
||||
<Entity name="PointLight">
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>Models/Core/UnitSphere.mesh</Resource>
|
||||
<Color A="1" B="0" G="3.92156863" R="3.92156863"/>
|
||||
</c:Model>
|
||||
<c:PointLight>
|
||||
<Radius>3</Radius>
|
||||
<Intensity>1.1399998664855957</Intensity>
|
||||
</c:PointLight>
|
||||
<c:Transform>
|
||||
<Position X="0.600000024" Y="0.5" Z="0"/>
|
||||
<Scale X="0.100000001" Y="0.100000001" Z="0.100000001"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
<Entity name="GlowMap">
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>Models/Test/IncandescenceMapSphere.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Position X="-1.10000002" Y="0" Z="-1.80000007"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
</Children>
|
||||
</Entity>
|
||||
<Entity name="SceneColors">
|
||||
<Components>
|
||||
<c:SceneLight>
|
||||
<Gamma>1.3999999761581421</Gamma>
|
||||
</c:SceneLight>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
</Children>
|
||||
|
||||
</Entity>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<Axis X="1" Y="0" Z="0"/>
|
||||
</c:EditorWidget>
|
||||
<c:Model>
|
||||
<Resource>Models/RotationWidgetX.mesh</Resource>
|
||||
<Resource>Models/Widgets/Rotate/RotationWidgetX.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
@@ -33,7 +33,7 @@
|
||||
<Axis X="0" Y="1" Z="0"/>
|
||||
</c:EditorWidget>
|
||||
<c:Model>
|
||||
<Resource>Models/RotationWidgetY.mesh</Resource>
|
||||
<Resource>Models/Widgets/Rotate/RotationWidgetY.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
@@ -48,7 +48,7 @@
|
||||
<Axis X="0" Y="0" Z="1"/>
|
||||
</c:EditorWidget>
|
||||
<c:Model>
|
||||
<Resource>Models/RotationWidgetZ.mesh</Resource>
|
||||
<Resource>Models/Widgets/Rotate/RotationWidgetZ.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>Models/ScaleWidgetOrigin.mesh</Resource>
|
||||
<Resource>Models/Widgets/Scale/ScalingWidgetOrigin.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform/>
|
||||
<c:UniformScale>
|
||||
@@ -20,7 +20,7 @@
|
||||
</Type>
|
||||
</c:EditorWidget>
|
||||
<c:Model>
|
||||
<Resource>Models/ScaleWidgetX.mesh</Resource>
|
||||
<Resource>Models/Widgets/Scale/ScalingWidgetX.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
@@ -34,7 +34,7 @@
|
||||
</Type>
|
||||
</c:EditorWidget>
|
||||
<c:Model>
|
||||
<Resource>Models/ScaleWidgetY.mesh</Resource>
|
||||
<Resource>Models/Widgets/Scale/ScalingWidgetY.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
@@ -48,7 +48,7 @@
|
||||
</Type>
|
||||
</c:EditorWidget>
|
||||
<c:Model>
|
||||
<Resource>Models/ScaleWidgetZ.mesh</Resource>
|
||||
<Resource>Models/Widgets/Scale/ScalingWidgetZ.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>Models/TranslationWidgetOrigin.mesh</Resource>
|
||||
<Resource>Models/Widgets/Translate/TranslationWidgetOrigin.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform/>
|
||||
<c:UniformScale>
|
||||
@@ -18,7 +18,7 @@
|
||||
<Axis X="1" Y="0" Z="0"/>
|
||||
</c:EditorWidget>
|
||||
<c:Model>
|
||||
<Resource>Models/TranslationWidgetX.mesh</Resource>
|
||||
<Resource>Models/Widgets/Translate/TranslationWidgetX.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
@@ -30,7 +30,7 @@
|
||||
<Axis X="0" Y="1" Z="0"/>
|
||||
</c:EditorWidget>
|
||||
<c:Model>
|
||||
<Resource>Models/TranslationWidgetY.mesh</Resource>
|
||||
<Resource>Models/Widgets/Translate/TranslationWidgetY.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
@@ -42,7 +42,7 @@
|
||||
<Axis X="0" Y="0" Z="1"/>
|
||||
</c:EditorWidget>
|
||||
<c:Model>
|
||||
<Resource>Models/TranslationWidgetZ.mesh</Resource>
|
||||
<Resource>Models/Widgets/Translate/TranslationWidgetZ.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
@@ -54,7 +54,7 @@
|
||||
<Axis X="0" Y="1" Z="1"/>
|
||||
</c:EditorWidget>
|
||||
<c:Model>
|
||||
<Resource>Models/WidgetPlaneX.mesh</Resource>
|
||||
<Resource>Models/Widgets/Translate/TranslationWidgetPlaneX.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
@@ -66,7 +66,7 @@
|
||||
<Axis X="1" Y="0" Z="1"/>
|
||||
</c:EditorWidget>
|
||||
<c:Model>
|
||||
<Resource>Models/WidgetPlaneY.mesh</Resource>
|
||||
<Resource>Models/Widgets/Translate/TranslationWidgetPlaneY.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
@@ -78,21 +78,12 @@
|
||||
<Axis X="1" Y="1" Z="0"/>
|
||||
</c:EditorWidget>
|
||||
<c:Model>
|
||||
<Resource>Models/WidgetPlaneZ.mesh</Resource>
|
||||
<Resource>Models/Widgets/Translate/TranslationWidgetPlaneZ.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity name="Light">
|
||||
<Components>
|
||||
<c:PointLight/>
|
||||
<c:Transform>
|
||||
<Position X="0.400000006" Y="0.400000006" Z="0.400000006"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
</Children>
|
||||
|
||||
</Entity>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<Entity name="Scenemesh">
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>Models\MapVersion1.mesh</Resource>
|
||||
<Resource>Models/LevelBase/MapVersion1.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
@@ -21,7 +21,7 @@
|
||||
<Intensity>2</Intensity>
|
||||
</c:DirectionalLight>
|
||||
<c:Model>
|
||||
<Resource>Models/DirectionalLightWidget.mesh</Resource>
|
||||
<Resource>Models/Widgets/Lights/DirectionalLightWidget.mesh</Resource>
|
||||
<Visible>false</Visible>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>models/animTest.mesh</Resource>
|
||||
<Resource>Models/Test/AnimTest.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
<Components>
|
||||
<c:SpawnPoint/>
|
||||
<c:Model>
|
||||
<Resource>Models/Assault.mesh</Resource>
|
||||
<Resource>Models/Characters/Assault/AssaultTPose.mesh</Resource>
|
||||
<Color A="1" B="0" G="0" R="1"/>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
@@ -55,7 +55,7 @@
|
||||
<Components>
|
||||
<c:SpawnPoint/>
|
||||
<c:Model>
|
||||
<Resource>Models/Assault.mesh</Resource>
|
||||
<Resource>Models/Characters/Assault/AssaultTPose.mesh</Resource>
|
||||
<Color A="1" B="0.0117647061" G="0" R="1"/>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
@@ -70,7 +70,7 @@
|
||||
<Components>
|
||||
<c:DirectionalLight/>
|
||||
<c:Model>
|
||||
<Resource>Models/DirectionalLightWidget.mesh</Resource>
|
||||
<Resource>sModels/Widgets/Lights/DirectionalLightWidget.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Position X="-6.00145912" Y="1.42697716" Z="3.04144025"/>
|
||||
@@ -153,7 +153,7 @@
|
||||
<Components>
|
||||
<c:SpawnPoint/>
|
||||
<c:Model>
|
||||
<Resource>Models/Assault.mesh</Resource>
|
||||
<Resource>Models/Characters/Assault/AssaultTPose.mesh</Resource>
|
||||
<Color A="1" B="1" G="0.254901975" R="0"/>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
@@ -166,7 +166,7 @@
|
||||
<Components>
|
||||
<c:SpawnPoint/>
|
||||
<c:Model>
|
||||
<Resource>Models/Assault.mesh</Resource>
|
||||
<Resource>Models/Characters/Assault/AssaultTPose.mesh</Resource>
|
||||
<Color A="1" B="1" G="0.254901975" R="0"/>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
@@ -228,7 +228,7 @@
|
||||
<Entity name="CameraModel">
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>Models/Camera.mesh</Resource>
|
||||
<Resource>Models/Widgets/Camera.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Position X="0" Y="0.0331346765" Z="-0.0792061687"/>
|
||||
@@ -243,7 +243,7 @@
|
||||
<Components>
|
||||
<c:Camera/>
|
||||
<c:Model>
|
||||
<Resource>Models/Camera.mesh</Resource>
|
||||
<Resource>Models/Widgets/Camera.mesh</Resource>
|
||||
<Visible>false</Visible>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
@@ -256,7 +256,7 @@
|
||||
<Entity name="PlayerModel">
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>Models/AssaultHeadless.mesh</Resource>
|
||||
<Resource>Models/Characters/Assault/AssaultHeadless.mesh</Resource>
|
||||
<Color A="1" B="0" G="0" R="1"/>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
<Entity name="Player" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||
|
||||
<Components>
|
||||
<c:Health/>
|
||||
<c:AABB>
|
||||
<Origin X="0" Y="0.772000015" Z="0"/>
|
||||
<Size X="1" Y="1.60000002" Z="1"/>
|
||||
</c:AABB>
|
||||
<c:Collidable/>
|
||||
<c:Health/>
|
||||
<c:Physics>
|
||||
<Velocity X="2.30999646e-23" Y="0" Z="1.05272533e-23"/>
|
||||
</c:Physics>
|
||||
@@ -20,7 +20,7 @@
|
||||
</Team>
|
||||
</c:Team>
|
||||
<c:Transform>
|
||||
<Orientation X="0" Y="2.24449515" Z="0"/>
|
||||
<Position X="9.56501799e-22" Y="-0.471999973" Z="4.35902473e-22"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
<Entity name="CameraModel">
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>Models/Camera.mesh</Resource>
|
||||
<Resource>Models/Widgets/Camera.mesh</Resource>
|
||||
<Visible>false</Visible>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
@@ -89,7 +89,7 @@
|
||||
<Entity name="Crosshair">
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>Models/CrosshairQuad.mesh</Resource>
|
||||
<Resource>Models/Weapons/CrosshairQuad.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Position X="0" Y="0" Z="0.200000003"/>
|
||||
@@ -101,12 +101,19 @@
|
||||
</Entity>
|
||||
<Entity name="Weapon">
|
||||
<Components>
|
||||
<c:ExplosionEffect>
|
||||
<ColorByDistance>true</ColorByDistance>
|
||||
<Velocity X="0.800000012" Y="0.0379999988" Z="0"/>
|
||||
<ExplosionDuration>3.7999999523162842</ExplosionDuration>
|
||||
<EndColor A="0" B="23.5294113" G="11.7647057" R="0"/>
|
||||
<Randomness>true</Randomness>
|
||||
</c:ExplosionEffect>
|
||||
<c:Model>
|
||||
<Resource>Models/AssaultWeapon.mesh</Resource>
|
||||
<Resource>Models/Weapons/Red/AssaultWeaponRed.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Position X="0.180000007" Y="-0.183000013" Z="0"/>
|
||||
<Orientation X="0" Y="4.64700031" Z="0"/>
|
||||
<Orientation X="0" Y="3.08300018" Z="0"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
@@ -127,7 +134,7 @@
|
||||
<Components>
|
||||
<c:Camera/>
|
||||
<c:Model>
|
||||
<Resource>Models/Camera.mesh</Resource>
|
||||
<Resource>Models/Widgets/Camera.mesh</Resource>
|
||||
<Visible>false</Visible>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
@@ -141,11 +148,12 @@
|
||||
<Components>
|
||||
<c:Animation>
|
||||
<Name>Hold Pos</Name>
|
||||
<Time>0.9779997896222552</Time>
|
||||
<Time>0.73506627647571587</Time>
|
||||
<Speed>1</Speed>
|
||||
</c:Animation>
|
||||
<c:HiddenForLocalPlayer/>
|
||||
<c:Model>
|
||||
<Resource>Models/AssaultAnimated.mesh</Resource>
|
||||
<Resource>Models/Characters/Assault/AssaultAnimated.mesh</Resource>
|
||||
<Color A="1" B="0" G="0" R="1"/>
|
||||
</c:Model>
|
||||
<c:Transform/>
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<Entity name="PointLight" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>Models/Core/UnitSphere.mesh</Resource>
|
||||
<Color A="1" B="0" G="3.92156863" R="3.92156863"/>
|
||||
</c:Model>
|
||||
<c:PointLight>
|
||||
<Radius>3</Radius>
|
||||
<Intensity>1.1399998664855957</Intensity>
|
||||
</c:PointLight>
|
||||
<c:Transform>
|
||||
<Scale X="0.100000001" Y="0.100000001" Z="0.100000001"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
|
||||
<Children/>
|
||||
|
||||
</Entity>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -6,8 +6,9 @@
|
||||
<Lifetime>0.25</Lifetime>
|
||||
</c:Lifetime>
|
||||
<c:Model>
|
||||
<Resource>Models/CylinderBullet.mesh</Resource>
|
||||
<Color A="1" B="39.2156868" G="7.84313726" R="0"/>
|
||||
<Resource>Models/Weapons/CylinderBullet.mesh</Resource>
|
||||
<Color A="0.156862751" B="39.2156868" G="7.84313726" R="0"/>
|
||||
<Transparent>true</Transparent>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Scale X="0.0109999999" Y="0.0289999992" Z="100"/>
|
||||
|
||||
@@ -6,8 +6,9 @@
|
||||
<Lifetime>0.25</Lifetime>
|
||||
</c:Lifetime>
|
||||
<c:Model>
|
||||
<Resource>Models/CylinderBullet.mesh</Resource>
|
||||
<Color A="1" B="0" G="0.525490224" R="39.2156868"/>
|
||||
<Resource>Models/Weapons/CylinderBullet.mesh</Resource>
|
||||
<Color A="0.156862751" B="0" G="0.525490224" R="39.2156868"/>
|
||||
<Transparent>true</Transparent>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Scale X="0.0110000009" Y="0.029000001" Z="100"/>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<Entity name="Model">
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>Models/Assault.obj</Resource>
|
||||
<Resource>Models/Characters/Assault/AssaultTPose.mesh</Resource>
|
||||
<Color A="1" B="3.92156863" G="3.92156863" R="3.92156863"/>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
@@ -35,7 +35,7 @@
|
||||
<FOV>80</FOV>
|
||||
</c:Camera>
|
||||
<c:Model>
|
||||
<Resource>Models/Camera.mesh</Resource>
|
||||
<Resource>Models/Widgets/Camera.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Position X="0" Y="1.39121652" Z="-0.043014247"/>
|
||||
@@ -132,7 +132,7 @@
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>Models/Assault.mesh</Resource>
|
||||
<Resource>Models/Characters/Assault/AssaultTPose.mesh</Resource>
|
||||
<Color A="1" B="3.92156863" G="1" R="1"/>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
@@ -308,7 +308,7 @@
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>Models/Assault.mesh</Resource>
|
||||
<Resource>Models/Characters/Assault/AssaultTPose.mesh</Resource>
|
||||
<Color A="1" B="1" G="1" R="3.92156863"/>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
@@ -324,7 +324,7 @@
|
||||
<Intensity>0.10000000149011612</Intensity>
|
||||
</c:DirectionalLight>
|
||||
<c:Model>
|
||||
<Resource>Models/DirectionalLightWidget.mesh</Resource>
|
||||
<Resource>Models/Widgets/Lights/DirectionalLightWidget.mesh</Resource>
|
||||
<Color A="1" B="0" G="3.92156863" R="3.92156863"/>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<Entity>
|
||||
<Components>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/DummyScene.mesh</Resource>
|
||||
<Resource>Models/Test/DummyScene.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
@@ -41,7 +41,7 @@
|
||||
<HomePointForTeam>3</HomePointForTeam>
|
||||
</c:CapturePoint>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/Core/UnitSphere.mesh</Resource>
|
||||
<Resource>Models/Core/UnitSphere.mesh</Resource>
|
||||
<Color A="1" B="1" G="0.200000003" R="0"/>
|
||||
</c:Model>
|
||||
<c:Team>
|
||||
@@ -61,7 +61,7 @@
|
||||
<CapturePointNumber>1</CapturePointNumber>
|
||||
</c:CapturePoint>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/Core/UnitSphere.mesh</Resource>
|
||||
<Resource>Models/Core/UnitSphere.mesh</Resource>
|
||||
<Color A="1" B="1" G="1" R="0"/>
|
||||
</c:Model>
|
||||
<c:Team/>
|
||||
@@ -79,7 +79,7 @@
|
||||
<CapturePointNumber>2</CapturePointNumber>
|
||||
</c:CapturePoint>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/Core/UnitSphere.mesh</Resource>
|
||||
<Resource>Models/Core/UnitSphere.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Team/>
|
||||
<c:Transform>
|
||||
@@ -96,7 +96,7 @@
|
||||
<CapturePointNumber>3</CapturePointNumber>
|
||||
</c:CapturePoint>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/Core/UnitSphere.mesh</Resource>
|
||||
<Resource>Models/Core/UnitSphere.mesh</Resource>
|
||||
<Color A="1" B="0" G="1" R="1"/>
|
||||
</c:Model>
|
||||
<c:Team/>
|
||||
@@ -115,7 +115,7 @@
|
||||
<CapturePointNumber>4</CapturePointNumber>
|
||||
</c:CapturePoint>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/Core/UnitSphere.mesh</Resource>
|
||||
<Resource>Models/Core/UnitSphere.mesh</Resource>
|
||||
<Color A="1" B="0" G="0.200000003" R="1"/>
|
||||
</c:Model>
|
||||
<c:Team>
|
||||
@@ -133,7 +133,7 @@
|
||||
<c:Health/>
|
||||
<c:AABB/>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/Core/UnitCube.mesh</Resource>
|
||||
<Resource>Models/Core/UnitCube.mesh</Resource>
|
||||
<Color A="1" B="0.482352942" G="0.490196079" R="1"/>
|
||||
</c:Model>
|
||||
<c:Player/>
|
||||
@@ -151,7 +151,7 @@
|
||||
<c:Health/>
|
||||
<c:AABB/>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/Core/UnitCube.mesh</Resource>
|
||||
<Resource>Models/Core/UnitCube.mesh</Resource>
|
||||
<Color A="1" B="0.482352942" G="0.490196079" R="1"/>
|
||||
</c:Model>
|
||||
<c:Player/>
|
||||
@@ -171,7 +171,7 @@
|
||||
</c:Health>
|
||||
<c:AABB/>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/Core/UnitCube.mesh</Resource>
|
||||
<Resource>Models/Core/UnitCube.mesh</Resource>
|
||||
<Color A="1" B="0" G="0" R="2.25"/>
|
||||
</c:Model>
|
||||
<c:Player/>
|
||||
@@ -191,7 +191,7 @@
|
||||
</c:Health>
|
||||
<c:AABB/>
|
||||
<c:Model>
|
||||
<Resource>../assets/Models/Core/UnitCube.mesh</Resource>
|
||||
<Resource>Models/Core/UnitCube.mesh</Resource>
|
||||
<Color A="1" B="0" G="0" R="4.5"/>
|
||||
</c:Model>
|
||||
<c:Player/>
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<Entity name="SoundEmitter" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||
|
||||
<Components>
|
||||
<c:SoundEmitter/>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
|
||||
<Children>
|
||||
<Entity name="SoundEmitterText">
|
||||
<Components>
|
||||
<c:Text>
|
||||
<Content>SoundEmitter</Content>
|
||||
<Resource>Fonts/DroidSans.ttf,64</Resource>
|
||||
</c:Text>
|
||||
<c:Transform>
|
||||
<Scale X="0.5" Y="0.5" Z="0.5"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
</Children>
|
||||
|
||||
</Entity>
|
||||
@@ -0,0 +1,68 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<Entity name="SpawnerRedTeam" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||
|
||||
<Components>
|
||||
<c:PlayerSpawn/>
|
||||
<c:Spawner>
|
||||
<EntityFile>Schema/Entities/Player.xml</EntityFile>
|
||||
</c:Spawner>
|
||||
<c:Team>
|
||||
<Team>
|
||||
<Red/>
|
||||
</Team>
|
||||
</c:Team>
|
||||
<c:Transform/>
|
||||
</Components>
|
||||
|
||||
<Children>
|
||||
<Entity name="SpawnPointRedTeam">
|
||||
<Components>
|
||||
<c:SpawnPoint/>
|
||||
<c:Model>
|
||||
<Resource>Models/Characters/Assault/AssaultTPose.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Position X="1" Y="0" Z="0"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity name="SpawnPointRedTeam">
|
||||
<Components>
|
||||
<c:SpawnPoint/>
|
||||
<c:Model>
|
||||
<Resource>Models/Characters/Assault/AssaultTPose.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Position X="-1" Y="0" Z="0"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity name="SpawnPointRedTeam">
|
||||
<Components>
|
||||
<c:SpawnPoint/>
|
||||
<c:Model>
|
||||
<Resource>Models/Characters/Assault/AssaultTPose.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Position X="0" Y="0" Z="1"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
<Entity name="SpawnPointRedTeam">
|
||||
<Components>
|
||||
<c:SpawnPoint/>
|
||||
<c:Model>
|
||||
<Resource>Models/Characters/Assault/AssaultTPose.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Position X="0" Y="0" Z="-1"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
<Children/>
|
||||
</Entity>
|
||||
</Children>
|
||||
|
||||
</Entity>
|
||||
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<Entity name="SpawnPointRedTeam" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
|
||||
|
||||
<Components>
|
||||
<c:SpawnPoint/>
|
||||
<c:Model>
|
||||
<Resource>Models/Characters/Assault/AssaultTPose.mesh</Resource>
|
||||
</c:Model>
|
||||
<c:Transform>
|
||||
<Position X="1.31625879" Y="0" Z="0"/>
|
||||
</c:Transform>
|
||||
</Components>
|
||||
|
||||
<Children/>
|
||||
|
||||
</Entity>
|
||||
@@ -6,7 +6,7 @@
|
||||
<Orientation X="0" Y="0" Z="0"/>
|
||||
</c:Transform>
|
||||
<c:Model>
|
||||
<Resource>Models/DummyScene.mesh</Resource>
|
||||
<Resource>Models/Test/DummyScene.mesh</Resource>
|
||||
</c:Model>
|
||||
</Components>
|
||||
<Children>
|
||||
@@ -36,7 +36,7 @@
|
||||
<ExponentialAccelaration>0</ExponentialAccelaration>
|
||||
</c:ExplosionEffect>
|
||||
<c:Model>
|
||||
<Resource>Models/Camera.mesh</Resource>
|
||||
<Resource>Models/Widgets/Camera.mesh</Resource>
|
||||
</c:Model>
|
||||
</Components>
|
||||
</Entity>
|
||||
|
||||
@@ -31,9 +31,13 @@
|
||||
<xs:element ref="c:PlayerSpawn" minOccurs="0"/>
|
||||
<xs:element ref="c:Team" minOccurs="0"/>
|
||||
<xs:element ref="c:DirectionalLight" minOccurs="0"/>
|
||||
<xs:element ref="c:SceneLight" minOccurs="0"/>
|
||||
<xs:element ref="c:UniformScale" minOccurs="0"/>
|
||||
<xs:element ref="c:EditorWidget" minOccurs="0"/>
|
||||
<xs:element ref="c:Lifetime" minOccurs="0"/>
|
||||
<xs:element ref="c:HiddenForLocalPlayer" minOccurs="0"/>
|
||||
<xs:element ref="c:Fill" minOccurs="0"/>
|
||||
<xs:element ref="c:Animation" minOccurs="0"/>
|
||||
</xs:all>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
@@ -44,7 +48,7 @@
|
||||
<xs:element ref="Entity" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="EntityRef" minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:complexType>
|
||||
<xs:attribute name="file" type="xs:string" minOccurs="0"/>
|
||||
<xs:attribute name="file" type="xs:string"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
@@ -52,7 +56,7 @@
|
||||
</xs:element>
|
||||
</xs:all>
|
||||
<xs:attribute ref="xml:base"/>
|
||||
<xs:attribute name="name" type="xs:string" minOccurs="0" default=""/>
|
||||
<xs:attribute name="name" type="xs:string" default=""/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:schema>
|
||||
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified" 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="t:int" fixed="1" minOccurs="0"/>
|
||||
<xs:element name="Red" type="t:int" fixed="2" minOccurs="0"/>
|
||||
<xs:element name="Blue" type="t:int" fixed="3" minOccurs="0"/>
|
||||
</xs:choice>
|
||||
</xs:extension>
|
||||
</xs:complexContent>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
||||
@@ -3,6 +3,7 @@
|
||||
layout (binding = 0) uniform sampler2D SceneTexture;
|
||||
layout (binding = 1) uniform sampler2D BloomTexture;
|
||||
uniform float Exposure;
|
||||
uniform float Gamma;
|
||||
|
||||
in VertexData{
|
||||
vec2 TextureCoordinate;
|
||||
@@ -12,7 +13,6 @@ out vec4 fragmentColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
const float gamma = 2.2;
|
||||
vec4 hdrColor = texture(SceneTexture, Input.TextureCoordinate);
|
||||
vec4 bloomColor = texture(BloomTexture, Input.TextureCoordinate);
|
||||
hdrColor += bloomColor;
|
||||
@@ -21,7 +21,7 @@ void main()
|
||||
vec3 result = vec3(1.0) - exp(-hdrColor.rgb * Exposure);
|
||||
|
||||
//gamme correction
|
||||
result = pow(result, vec3(1.0 / gamma));
|
||||
result = pow(result, vec3(1.0 / Gamma));
|
||||
|
||||
fragmentColor = vec4(result, 1.0);
|
||||
//fragmentColor = hdrColor;
|
||||
|
||||
@@ -17,15 +17,21 @@ uniform bool ExponentialAccelaration;
|
||||
in VertexData{
|
||||
vec3 Position;
|
||||
vec3 Normal;
|
||||
vec3 Tangent;
|
||||
vec3 BiTangent;
|
||||
vec2 TextureCoordinate;
|
||||
vec4 ExplosionColor;
|
||||
float ExplosionPercentageElapsed;
|
||||
}Input[];
|
||||
|
||||
out VertexData{
|
||||
vec3 Position;
|
||||
vec3 Normal;
|
||||
vec3 Tangent;
|
||||
vec3 BiTangent;
|
||||
vec2 TextureCoordinate;
|
||||
vec4 ExplosionColor;
|
||||
float ExplosionPercentageElapsed;
|
||||
}Output;
|
||||
|
||||
layout(triangles) in;
|
||||
@@ -114,12 +120,17 @@ void main()
|
||||
{
|
||||
// calculate the max distance (s) the triangle will move
|
||||
float s = (randomVelocity.x * ExplosionDuration) + (0.5 * a * pow(ExplosionDuration, 2));
|
||||
float te = (length(triangleCenter2ExplosionRadius) / s);
|
||||
|
||||
Output.ExplosionColor = EndColor * (length(triangleCenter2ExplosionRadius) / s);
|
||||
Output.ExplosionColor = EndColor;
|
||||
Output.ExplosionPercentageElapsed = te;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
Output.ExplosionColor = EndColor * timePercetage;
|
||||
Output.ExplosionColor = EndColor;
|
||||
Output.ExplosionPercentageElapsed = timePercetage;
|
||||
|
||||
}
|
||||
|
||||
// for every vertex on the triangle...
|
||||
@@ -132,6 +143,8 @@ void main()
|
||||
Output.Normal = Input[i].Normal;
|
||||
Output.Position = Input[i].Position;
|
||||
Output.TextureCoordinate = Input[i].TextureCoordinate;
|
||||
Output.Tangent = Input[i].Tangent;
|
||||
Output.BiTangent = Input[i].BiTangent;
|
||||
|
||||
// convert to model space for the gravity to always be in -y
|
||||
vec4 ExplodedPositionInModelSpace = M * vec4(ExplodedPosition, 1.0);
|
||||
@@ -154,11 +167,14 @@ void main()
|
||||
// if explosion color should be affected by distance instead of time...
|
||||
if (ColorByDistance == true)
|
||||
{
|
||||
Output.ExplosionColor = vec4(0.0);
|
||||
Output.ExplosionColor = EndColor;
|
||||
Output.ExplosionPercentageElapsed = 0.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
Output.ExplosionColor = EndColor * timePercetage;
|
||||
Output.ExplosionColor = EndColor;
|
||||
Output.ExplosionPercentageElapsed = timePercetage;
|
||||
|
||||
}
|
||||
|
||||
// for every vertex on the triangle...
|
||||
@@ -168,7 +184,9 @@ void main()
|
||||
Output.Normal = Input[i].Normal;
|
||||
Output.Position = Input[i].Position;
|
||||
Output.TextureCoordinate = Input[i].TextureCoordinate;
|
||||
|
||||
Output.Tangent = Input[i].Tangent;
|
||||
Output.BiTangent = Input[i].BiTangent;
|
||||
|
||||
// no change in position, pass through vertex
|
||||
gl_Position = gl_in[i].gl_Position;
|
||||
EmitVertex();
|
||||
|
||||
@@ -7,10 +7,12 @@ uniform vec4 Color;
|
||||
uniform vec4 DiffuseColor;
|
||||
uniform vec2 ScreenDimensions;
|
||||
uniform vec4 FillColor;
|
||||
uniform vec4 AmbientColor;
|
||||
uniform float FillPercentage;
|
||||
layout (binding = 0) uniform sampler2D DiffuseTexture;
|
||||
layout (binding = 1) uniform sampler2D GlowMap;
|
||||
|
||||
layout (binding = 1) uniform sampler2D NormalMapTexture;
|
||||
layout (binding = 2) uniform sampler2D SpecularMapTexture;
|
||||
layout (binding = 3) uniform sampler2D GlowMapTexture;
|
||||
|
||||
#define TILE_SIZE 16
|
||||
|
||||
@@ -49,15 +51,16 @@ layout (std430, binding = 4) buffer LightIndexBuffer
|
||||
in VertexData{
|
||||
vec3 Position;
|
||||
vec3 Normal;
|
||||
vec3 Tangent;
|
||||
vec3 BiTangent;
|
||||
vec2 TextureCoordinate;
|
||||
vec4 ExplosionColor;
|
||||
float ExplosionPercentageElapsed;
|
||||
}Input;
|
||||
|
||||
out vec4 sceneColor;
|
||||
out vec4 bloomColor;
|
||||
|
||||
vec4 scene_ambient = vec4(0.3,0.3,0.3,1);
|
||||
|
||||
struct LightResult {
|
||||
vec4 Diffuse;
|
||||
vec4 Specular;
|
||||
@@ -102,13 +105,22 @@ LightResult CalcDirectionalLightSource(vec4 direction, vec4 color, float intensi
|
||||
return result;
|
||||
}
|
||||
|
||||
vec4 CalcNormalMappedValue(vec3 normal, vec3 tangent, vec3 bitangent, vec2 textureCoordinate, sampler2D normalMap)
|
||||
{
|
||||
mat3 TBN = mat3(tangent, bitangent, normal);
|
||||
vec3 NormalMap = texture(normalMap, textureCoordinate).xyz * 2.0 - vec3(1.0);
|
||||
return vec4(TBN * normalize(NormalMap), 0.0);
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 diffuseTexel = texture2D(DiffuseTexture, Input.TextureCoordinate);
|
||||
vec4 glowTexel = texture2D(GlowMap, Input.TextureCoordinate);
|
||||
vec4 glowTexel = texture2D(GlowMapTexture, Input.TextureCoordinate);
|
||||
vec4 specularTexel = texture2D(SpecularMapTexture, Input.TextureCoordinate);
|
||||
vec4 position = V * M * vec4(Input.Position, 1.0);
|
||||
vec4 normal = normalize(V * vec4(Input.Normal, 0.0));
|
||||
vec4 normal = V * CalcNormalMappedValue(Input.Normal, Input.Tangent, Input.BiTangent, Input.TextureCoordinate, NormalMapTexture);
|
||||
normal = normalize(normal);
|
||||
//vec4 normal = normalize(V * vec4(Input.Normal, 0.0));
|
||||
vec4 viewVec = normalize(-position);
|
||||
|
||||
vec2 tilePos;
|
||||
@@ -116,7 +128,7 @@ void main()
|
||||
tilePos.y = int(gl_FragCoord.y/TILE_SIZE);
|
||||
|
||||
LightResult totalLighting;
|
||||
totalLighting.Diffuse = scene_ambient;
|
||||
totalLighting.Diffuse = vec4(AmbientColor.rgb, 1.0);
|
||||
int currentTile = int(floor(gl_FragCoord.x/TILE_SIZE) + (floor(gl_FragCoord.y/TILE_SIZE) * int(ScreenDimensions.x/TILE_SIZE)));
|
||||
|
||||
int start = int(LightGrids.Data[currentTile].Start);
|
||||
@@ -138,8 +150,9 @@ void main()
|
||||
totalLighting.Specular += light_result.Specular;
|
||||
}
|
||||
|
||||
|
||||
vec4 color_result = (DiffuseColor + Input.ExplosionColor) * (totalLighting.Diffuse + totalLighting.Specular) * diffuseTexel * Color;
|
||||
vec4 color_result = mix((Color * diffuseTexel * DiffuseColor), Input.ExplosionColor, Input.ExplosionPercentageElapsed);
|
||||
color_result = color_result * (totalLighting.Diffuse + (totalLighting.Specular * specularTexel));
|
||||
//vec4 color_result = (DiffuseColor + Input.ExplosionColor) * (totalLighting.Diffuse + (totalLighting.Specular * specularTexel)) * diffuseTexel * Color;
|
||||
|
||||
|
||||
float pos = ((P * vec4(Input.Position, 1)).y + 1.0)/2.0;
|
||||
@@ -147,25 +160,10 @@ void main()
|
||||
if(pos <= FillPercentage) {
|
||||
color_result += FillColor;
|
||||
}
|
||||
//bloomColor = vec4(0.3, 0.8, 0.6, 1.0);
|
||||
sceneColor = vec4(color_result.xyz, clamp(color_result.a, 0, 1));
|
||||
//These if statements should be removed if they are slow.
|
||||
color_result += glowTexel;
|
||||
|
||||
|
||||
|
||||
color_result += glowTexel*3;
|
||||
|
||||
bloomColor = vec4(clamp(color_result.xyz - 1.0, 0, 100), 1.0);
|
||||
/*
|
||||
if(color_result.x > 1 || color_result.y > 1 || color_result.z > 1) {
|
||||
bloomColor = vec4(color_result.xyz, 1.0);
|
||||
} else {
|
||||
bloomColor = vec4(0.0, 0.0, 0.0, 1.0);
|
||||
} */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//Tiled Debug Code
|
||||
/*
|
||||
|
||||
@@ -16,8 +16,11 @@ layout(location = 6) in vec4 BoneWeights;
|
||||
out VertexData{
|
||||
vec3 Position;
|
||||
vec3 Normal;
|
||||
vec3 Tangent;
|
||||
vec3 BiTangent;
|
||||
vec2 TextureCoordinate;
|
||||
vec4 ExplosionColor;
|
||||
float ExplosionPercentageElapsed;
|
||||
}Output;
|
||||
|
||||
void main()
|
||||
@@ -37,5 +40,8 @@ void main()
|
||||
Output.Position = (boneTransform * vec4(Position, 1.0)).xyz;
|
||||
Output.TextureCoordinate = TextureCoords;
|
||||
Output.Normal = vec3(M * vec4(Normal, 0.0));
|
||||
Output.ExplosionColor = vec4(0.0);
|
||||
Output.Tangent = vec3(M * vec4(Tangent, 0.0));
|
||||
Output.BiTangent = vec3(M * vec4(BiTangent, 0.0));
|
||||
Output.ExplosionColor = vec4(1.0);
|
||||
Output.ExplosionPercentageElapsed = 0.0;
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
#version 430
|
||||
#extension GL_EXT_gpu_shader4 : enable
|
||||
|
||||
layout (binding = 0) uniform sampler2D Texture;
|
||||
|
||||
@@ -12,7 +13,7 @@ uniform float weight[5] = float[](0.227027, 0.1945946, 0.1216216, 0.054054, 0.01
|
||||
|
||||
void main()
|
||||
{
|
||||
vec2 tex_offset = 1.0 / textureSize(Texture, 0);
|
||||
vec2 tex_offset = 1.0 / textureSize2D(Texture, 0);
|
||||
vec3 result = texture(Texture, Input.TextureCoordinate).rgb * weight[0];
|
||||
|
||||
for(int i = 1; i < 5; ++i) {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#version 430
|
||||
#extension GL_EXT_gpu_shader4 : enable
|
||||
|
||||
layout (binding = 0) uniform sampler2D Texture;
|
||||
|
||||
@@ -12,7 +13,7 @@ uniform float weight[5] = float[](0.227027, 0.1945946, 0.1216216, 0.054054, 0.01
|
||||
|
||||
void main()
|
||||
{
|
||||
vec2 tex_offset = 1.0 / textureSize(Texture, 0);
|
||||
vec2 tex_offset = 1.0 / textureSize2D(Texture, 0);
|
||||
vec3 result = texture(Texture, Input.TextureCoordinate).rgb * weight[0];
|
||||
|
||||
for(int i = 1; i < 5; ++i) {
|
||||
|
||||
@@ -8,7 +8,7 @@ void CollidableOctreeSystem::Update(double dt)
|
||||
void CollidableOctreeSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper& component, double dt)
|
||||
{
|
||||
if (entity.HasComponent("AABB")) {
|
||||
boost::optional<AABB> absoluteAABB = Collision::EntityAbsoluteAABB(entity);
|
||||
boost::optional<EntityAABB> absoluteAABB = Collision::EntityAbsoluteAABB(entity);
|
||||
if (absoluteAABB) {
|
||||
m_Octree->AddDynamicObject(*absoluteAABB);
|
||||
}
|
||||
|
||||
@@ -239,20 +239,6 @@ bool AABBvsTriangles(const AABB& box, const std::vector<RawModel::Vertex>& model
|
||||
return hit;
|
||||
}
|
||||
|
||||
bool IsSameBoxProbably(const AABB& first, const AABB& second, const float epsilon)
|
||||
{
|
||||
const glm::vec3& ma1 = first.MaxCorner();
|
||||
const glm::vec3& ma2 = second.MaxCorner();
|
||||
const glm::vec3& mi1 = first.MinCorner();
|
||||
const glm::vec3& mi2 = second.MinCorner();
|
||||
return (std::abs(ma1.x - ma2.x) < epsilon) &&
|
||||
(std::abs(mi1.x - mi2.x) < epsilon) &&
|
||||
(std::abs(ma1.z - ma2.z) < epsilon) &&
|
||||
(std::abs(mi1.z - mi2.z) < epsilon) &&
|
||||
(std::abs(ma1.y - ma2.y) < epsilon) &&
|
||||
(std::abs(mi1.y - mi2.y) < epsilon);
|
||||
}
|
||||
|
||||
bool attachAABBComponentFromModel(World* world, EntityID id)
|
||||
{
|
||||
if (!world->HasComponent(id, "Model")) {
|
||||
@@ -283,7 +269,7 @@ bool attachAABBComponentFromModel(World* world, EntityID id)
|
||||
return true;
|
||||
}
|
||||
|
||||
boost::optional<AABB> EntityAbsoluteAABB(EntityWrapper& entity)
|
||||
boost::optional<EntityAABB> EntityAbsoluteAABB(EntityWrapper& entity)
|
||||
{
|
||||
if (!entity.HasComponent("AABB")) {
|
||||
return boost::none;
|
||||
@@ -294,7 +280,11 @@ boost::optional<AABB> EntityAbsoluteAABB(EntityWrapper& entity)
|
||||
glm::vec3 absScale = Transform::AbsoluteScale(entity.World, entity.ID);
|
||||
glm::vec3 origin = absPosition + (glm::vec3)cAABB["Origin"];
|
||||
glm::vec3 size = (glm::vec3)cAABB["Size"] * absScale;
|
||||
return AABB::FromOriginSize(origin, size);
|
||||
|
||||
EntityAABB aabb = EntityAABB::FromOriginSize(origin, size);
|
||||
aabb.Entity = entity;
|
||||
|
||||
return aabb;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,29 +9,27 @@ void CollisionSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper& c
|
||||
}
|
||||
ComponentWrapper& cPhysics = entity["Physics"];
|
||||
|
||||
boost::optional<AABB> boundingBox = Collision::EntityAbsoluteAABB(entity);
|
||||
boost::optional<EntityAABB> boundingBox = Collision::EntityAbsoluteAABB(entity);
|
||||
if (!boundingBox) {
|
||||
return;
|
||||
}
|
||||
ComponentWrapper& cTransform = entity["Transform"];
|
||||
AABB& boxA = *boundingBox;
|
||||
EntityAABB& boxA = *boundingBox;
|
||||
|
||||
//Press 'Z' to enable/disable collision.
|
||||
if (zPress) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Collide against octree
|
||||
std::vector<AABB> octreeResult;
|
||||
m_Octree->ObjectsInSameRegion(*boundingBox, octreeResult);
|
||||
for (auto& boxB : octreeResult) {
|
||||
// Collide against octree items
|
||||
m_OctreeResult.clear();
|
||||
m_Octree->ObjectsInSameRegion(*boundingBox, m_OctreeResult);
|
||||
for (auto& boxB : m_OctreeResult) {
|
||||
glm::vec3 resolutionVector;
|
||||
if (Collision::IsSameBoxProbably(boxA, boxB)) {
|
||||
if (boxA.Entity == boxB.Entity) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (Collision::AABBVsAABB(boxA, boxB, resolutionVector)) {
|
||||
(glm::vec3&)cTransform["Position"] += resolutionVector;
|
||||
((glm::vec3&)cPhysics["Velocity"]).y = 0.f;
|
||||
if (resolutionVector.y > 0) {
|
||||
((glm::vec3&)cPhysics["Velocity"]).y = 0.f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,12 +54,4 @@ void CollisionSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper& c
|
||||
// (glm::vec3&)cTransform["Position"] += resolutionVector;
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
||||
bool CollisionSystem::OnKeyUp(const Events::KeyUp & event)
|
||||
{
|
||||
if (event.KeyCode == GLFW_KEY_Z) {
|
||||
zPress = !zPress;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -3,79 +3,72 @@
|
||||
#include "Core/AABB.h"
|
||||
#include "Rendering/Model.h"
|
||||
|
||||
void TriggerSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper& component, double dt)
|
||||
void TriggerSystem::UpdateComponent(EntityWrapper& triggerEntity, ComponentWrapper& cTrigger, double dt)
|
||||
{
|
||||
//Currently only players can trigger things.
|
||||
auto players = m_World->GetComponents("Player");
|
||||
if (players == nullptr) {
|
||||
return;
|
||||
}
|
||||
EntityID tId = component.EntityID;
|
||||
boost::optional<AABB> triggerBox = Collision::EntityAbsoluteAABB(entity);
|
||||
//The trigger *should* have a bounding box, or something, to test against so it can be triggered.
|
||||
// The trigger *should* have a bounding box, or something, to test against so it can be triggered.
|
||||
boost::optional<EntityAABB> triggerBox = Collision::EntityAbsoluteAABB(triggerEntity);
|
||||
if (!triggerBox) {
|
||||
return;
|
||||
}
|
||||
for (auto& pc : *players) {
|
||||
EntityID pId = pc.EntityID;
|
||||
boost::optional<AABB> playerBox = Collision::EntityAbsoluteAABB(EntityWrapper(m_World, pId));
|
||||
//The player can't trigger anything without an AABB.
|
||||
if (!playerBox) {
|
||||
continue;
|
||||
}
|
||||
if (!Collision::AABBVsAABB(*triggerBox, *playerBox)) {
|
||||
//Entity is not touching the trigger,
|
||||
//Throw event if it was previously.
|
||||
if (throwLeaveIfWasInTrigger(m_EntitiesTouchingTrigger[tId], pId, tId)) {
|
||||
continue;
|
||||
}
|
||||
//This only occurs if the entity was completely inside the trigger one frame,
|
||||
//then completely outside the trigger, e.g. when dying and respawning.
|
||||
throwLeaveIfWasInTrigger(m_EntitiesCompletelyInTrigger[tId], pId, tId);
|
||||
} else {
|
||||
//Entity is at least touching the trigger.
|
||||
|
||||
m_OctreeOut.clear();
|
||||
m_Octree->ObjectsInSameRegion(*triggerBox, m_OctreeOut);
|
||||
|
||||
for (EntityAABB& colliderBox : m_OctreeOut) {
|
||||
EntityWrapper colliderEntity = colliderBox.Entity;
|
||||
|
||||
if (Collision::AABBVsAABB(*triggerBox, colliderBox)) {
|
||||
AABB completelyInsideBox;
|
||||
bool playerFitsInTrigger = glm::all(glm::greaterThan((*triggerBox).Size(), (*playerBox).Size()));
|
||||
if (playerFitsInTrigger) {
|
||||
completelyInsideBox = AABB::FromOriginSize((*triggerBox).Origin(), (*triggerBox).Size() - 2.0f * (*playerBox).Size());
|
||||
bool colliderFitsInTrigger = glm::all(glm::greaterThan((*triggerBox).Size(), colliderBox.Size()));
|
||||
if (colliderFitsInTrigger) {
|
||||
completelyInsideBox = AABB::FromOriginSize((*triggerBox).Origin(), (*triggerBox).Size() - 2.0f * colliderBox.Size());
|
||||
}
|
||||
if (playerFitsInTrigger && Collision::AABBVsAABB(completelyInsideBox, *playerBox)) {
|
||||
//Entity is completely inside the trigger.
|
||||
//If it was only touching before, it is erased.
|
||||
m_EntitiesTouchingTrigger[tId].erase(pId);
|
||||
std::unordered_set<EntityID>& completeSet = m_EntitiesCompletelyInTrigger[tId];
|
||||
if (completeSet.count(pId) == 0) {
|
||||
//If it wasn't completely in the trigger, throw Enter and add to the set.
|
||||
completeSet.insert(pId);
|
||||
publish<Events::TriggerEnter>(pId, tId);
|
||||
if (colliderFitsInTrigger && Collision::AABBVsAABB(completelyInsideBox, colliderBox)) {
|
||||
// Entity is completely inside the trigger.
|
||||
// If it was only touching before, it is erased.
|
||||
m_EntitiesTouchingTrigger[triggerEntity].erase(colliderEntity);
|
||||
auto& completeSet = m_EntitiesCompletelyInTrigger[triggerEntity];
|
||||
if (completeSet.count(colliderEntity) == 0) {
|
||||
// If it wasn't completely in the trigger, throw Enter and add to the set.
|
||||
completeSet.insert(colliderEntity);
|
||||
publish<Events::TriggerEnter>(colliderEntity, triggerEntity);
|
||||
}
|
||||
} else {
|
||||
//Entity is only touching the trigger.
|
||||
std::unordered_set<EntityID>& touchSet = m_EntitiesTouchingTrigger[tId];
|
||||
std::unordered_set<EntityID>& completeSet = m_EntitiesCompletelyInTrigger[tId];
|
||||
const auto& it = completeSet.find(pId);
|
||||
// Entity is only touching the trigger.
|
||||
auto& touchSet = m_EntitiesTouchingTrigger[triggerEntity];
|
||||
auto& completeSet = m_EntitiesCompletelyInTrigger[triggerEntity];
|
||||
const auto& it = completeSet.find(colliderEntity);
|
||||
//If it was completely inside before.
|
||||
if (it != completeSet.end()) {
|
||||
completeSet.erase(it);
|
||||
touchSet.insert(pId);
|
||||
touchSet.insert(colliderEntity);
|
||||
//If it was completely outside before.
|
||||
} else if (touchSet.count(pId) == 0) {
|
||||
publish<Events::TriggerTouch>(pId, tId);
|
||||
touchSet.insert(pId);
|
||||
} else if (touchSet.count(colliderEntity) == 0) {
|
||||
publish<Events::TriggerTouch>(colliderEntity, triggerEntity);
|
||||
touchSet.insert(colliderEntity);
|
||||
}
|
||||
//Else, it was touching the trigger last frame too and nothing is done.
|
||||
// Else, it was touching the trigger last frame too and nothing is done.
|
||||
}
|
||||
} else {
|
||||
// Entity is not touching the trigger,
|
||||
// Throw event if it was previously.
|
||||
if (throwLeaveIfWasInTrigger(m_EntitiesTouchingTrigger[triggerEntity], colliderEntity, triggerEntity)) {
|
||||
continue;
|
||||
}
|
||||
// This only occurs if the entity was completely inside the trigger one frame,
|
||||
// then completely outside the trigger, e.g. when dying and respawning.
|
||||
throwLeaveIfWasInTrigger(m_EntitiesCompletelyInTrigger[triggerEntity], colliderEntity, triggerEntity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool TriggerSystem::throwLeaveIfWasInTrigger(std::unordered_set<EntityID>& triggerSet, EntityID pId, EntityID tId)
|
||||
bool TriggerSystem::throwLeaveIfWasInTrigger(std::unordered_set<EntityWrapper>& triggerSet, EntityWrapper colliderEntity, EntityWrapper triggerEntity)
|
||||
{
|
||||
const auto& it = triggerSet.find(pId);
|
||||
const auto& it = triggerSet.find(colliderEntity);
|
||||
if (it != triggerSet.end()) {
|
||||
//If it was in the trigger, but not anymore, throw leaveEvent and erase from the set.
|
||||
triggerSet.erase(it);
|
||||
publish<Events::TriggerLeave>(pId, tId);
|
||||
publish<Events::TriggerLeave>(colliderEntity, triggerEntity);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -83,18 +76,18 @@ bool TriggerSystem::throwLeaveIfWasInTrigger(std::unordered_set<EntityID>& trigg
|
||||
|
||||
bool TriggerSystem::OnTouch(const Events::TriggerTouch &event)
|
||||
{
|
||||
LOG_INFO("Player entity %i touched trigger entity %i.", event.Entity, event.Trigger);
|
||||
LOG_INFO("Player entity %i touched trigger entity %i.", event.Entity.ID, event.Trigger.ID);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TriggerSystem::OnEnter(const Events::TriggerEnter &event)
|
||||
{
|
||||
LOG_INFO("Player entity %i entered trigger entity %i.", event.Entity, event.Trigger);
|
||||
LOG_INFO("Player entity %i entered trigger entity %i.", event.Entity.ID, event.Trigger.ID);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TriggerSystem::OnLeave(const Events::TriggerLeave &event)
|
||||
{
|
||||
LOG_INFO("Player entity %i left trigger entity %i.", event.Entity, event.Trigger);
|
||||
LOG_INFO("Player entity %i left trigger entity %i.", event.Entity.ID, event.Trigger.ID);
|
||||
return true;
|
||||
}
|
||||
@@ -20,10 +20,6 @@ AABB::AABB(const glm::vec3& minPos, const glm::vec3& maxPos)
|
||||
}
|
||||
}
|
||||
|
||||
AABB::AABB(const glm::vec4& minPos, const glm::vec4& maxPos)
|
||||
: AABB(glm::vec3(minPos), glm::vec3(maxPos))
|
||||
{ }
|
||||
|
||||
AABB AABB::FromOriginSize(const glm::vec3& origin, const glm::vec3& size)
|
||||
{
|
||||
return AABB(origin - (size/2.f), origin + (size/2.f));
|
||||
|
||||
@@ -20,7 +20,7 @@ void EntityFile::Parse(const EntityFileHandler* handler) const
|
||||
{
|
||||
using namespace xercesc;
|
||||
|
||||
EntityFileSAXHandler saxHandler(handler, nullptr);
|
||||
EntityFileSAXHandler saxHandler(handler, m_SAX2XMLReader);
|
||||
setReaderFeatures(m_SAX2XMLReader);
|
||||
m_SAX2XMLReader->setContentHandler(&saxHandler);
|
||||
m_SAX2XMLReader->setErrorHandler(&saxHandler);
|
||||
@@ -37,11 +37,12 @@ void EntityFile::setReaderFeatures(xercesc::SAX2XMLReader* reader)
|
||||
reader->setFeature(XMLUni::fgSAX2CoreNameSpaces, true);
|
||||
reader->setFeature(XMLUni::fgXercesSchema, true);
|
||||
reader->setFeature(XMLUni::fgXercesSchemaFullChecking, true);
|
||||
reader->setFeature(XMLUni::fgXercesCalculateSrcOfs, true);
|
||||
}
|
||||
|
||||
std::size_t EntityFile::GetTypeStride(std::string typeName)
|
||||
unsigned int EntityFile::GetTypeStride(std::string typeName)
|
||||
{
|
||||
std::map<std::string, size_t> typeStrides{
|
||||
std::map<std::string, unsigned int> typeStrides{
|
||||
{ "bool", sizeof(bool) },
|
||||
{ "int", sizeof(int) },
|
||||
{ "float", sizeof(float) },
|
||||
@@ -111,8 +112,9 @@ void EntityFile::WriteValueData(char* outData, const ComponentInfo::Field_t& fie
|
||||
} catch (const boost::bad_lexical_cast&) { }
|
||||
}
|
||||
|
||||
EntityFileSAXHandler::EntityFileSAXHandler(const EntityFileHandler* handler, xercesc::SAX2XMLReader* reader) : m_Handler(handler)
|
||||
, m_Reader(reader)
|
||||
EntityFileSAXHandler::EntityFileSAXHandler(const EntityFileHandler* handler, xercesc::SAX2XMLReader* reader)
|
||||
: m_Handler(handler)
|
||||
, m_Reader(reader)
|
||||
{
|
||||
// 0 is imaginary base parent
|
||||
m_EntityStack.push(0);
|
||||
@@ -188,21 +190,29 @@ void EntityFileSAXHandler::characters(const XMLCh* const chars, const XMLSize_t
|
||||
|
||||
void EntityFileSAXHandler::fatalError(const xercesc::SAXParseException& e)
|
||||
{
|
||||
XS::ToString s(e.getMessage());
|
||||
LOG_ERROR("SAXParseException: %s", ((std::string)s).c_str());
|
||||
//throw e;
|
||||
std::string message = XS::ToString(e.getMessage());
|
||||
std::string systemId = XS::ToString(e.getSystemId());
|
||||
XMLFileLoc line = e.getLineNumber();
|
||||
XMLFileLoc column = e.getColumnNumber();
|
||||
LOG_ERROR("SAXParseException\n\tLocation: %s:%i:%i\n\tFatal Error: %s", systemId.c_str(), line, column, message.c_str());
|
||||
}
|
||||
|
||||
void EntityFileSAXHandler::error(const xercesc::SAXParseException& e)
|
||||
{
|
||||
XS::ToString s(e.getMessage());
|
||||
LOG_ERROR("SAXParseException: %s", ((std::string)s).c_str());
|
||||
std::string message = XS::ToString(e.getMessage());
|
||||
std::string systemId = XS::ToString(e.getSystemId());
|
||||
XMLFileLoc line = e.getLineNumber();
|
||||
XMLFileLoc column = e.getColumnNumber();
|
||||
LOG_ERROR("SAXParseException\n\tLocation: %s:%i:%i\n\tError: %s", systemId.c_str(), line, column, message.c_str());
|
||||
}
|
||||
|
||||
void EntityFileSAXHandler::warning(const xercesc::SAXParseException& e)
|
||||
{
|
||||
XS::ToString s(e.getMessage());
|
||||
LOG_ERROR("SAXParseException: %s", ((std::string)s).c_str());
|
||||
std::string message = XS::ToString(e.getMessage());
|
||||
std::string systemId = XS::ToString(e.getSystemId());
|
||||
XMLFileLoc line = e.getLineNumber();
|
||||
XMLFileLoc column = e.getColumnNumber();
|
||||
LOG_ERROR("SAXParseException\n\tLocation: %s:%i:%i\n\tWarning: %s", systemId.c_str(), line, column, message.c_str());
|
||||
}
|
||||
|
||||
void EntityFileSAXHandler::onStartEntity(const xercesc::Attributes& attrs)
|
||||
|
||||
@@ -65,6 +65,7 @@ void EntityFilePreprocessor::parseComponentInfo()
|
||||
|
||||
// Name
|
||||
compInfo.Name = XS::ToString(element->getName());
|
||||
bool brk = compInfo.Name == "HiddenForLocalPlayer";
|
||||
// Known allocation
|
||||
compInfo.Meta->Allocation = m_ComponentCounts[compInfo.Name];
|
||||
// Annotation
|
||||
@@ -90,7 +91,7 @@ void EntityFilePreprocessor::parseComponentInfo()
|
||||
// <xs:all>
|
||||
auto modelGroupParticle = complexTypeDefinition->getParticle();
|
||||
if (modelGroupParticle == nullptr || modelGroupParticle->getTermType() != XSParticle::TERM_MODELGROUP) {
|
||||
//LOG_ERROR("Failed to parse component definition for \"%s\": Model group particle was null or wasn't TERM_MODELGROUP!", compInfo.Name.c_str());
|
||||
LOG_ERROR("Failed to parse component definition for \"%s\": Model group particle was null or wasn't TERM_MODELGROUP!", compInfo.Name.c_str());
|
||||
continue;
|
||||
}
|
||||
auto modelGroup = modelGroupParticle->getModelGroupTerm();
|
||||
@@ -113,7 +114,7 @@ void EntityFilePreprocessor::parseComponentInfo()
|
||||
std::string baseType = XS::ToString(elementDeclaration->getTypeDefinition()->getBaseType()->getName());
|
||||
|
||||
std::string effectiveType = type;
|
||||
size_t stride = EntityFile::GetTypeStride(type);
|
||||
unsigned int stride = EntityFile::GetTypeStride(type);
|
||||
if (stride == 0) {
|
||||
stride = EntityFile::GetTypeStride(baseType);
|
||||
if (stride == 0) {
|
||||
|
||||
@@ -97,11 +97,6 @@ EntityWrapper::operator EntityID() const
|
||||
return this->ID;
|
||||
}
|
||||
|
||||
EntityWrapper::operator bool()
|
||||
{
|
||||
return this->Valid();
|
||||
}
|
||||
|
||||
EntityWrapper EntityWrapper::firstChildByNameRecursive(const std::string& name, EntityID parent)
|
||||
{
|
||||
if (!this->World->ValidEntity(parent)) {
|
||||
|
||||
@@ -218,7 +218,7 @@ void InputManager::PublishGamepadAxisIfChanged(int gamepadID, Gamepad::Axis axis
|
||||
void InputManager::PublishGamepadButtonIfChanged(int gamepadID, Gamepad::Button button)
|
||||
{
|
||||
bool currentState = m_CurrentGamepadButtonState[gamepadID][static_cast<int>(button)];
|
||||
float lastState = m_LastGamepadButtonState[gamepadID][static_cast<int>(button)];
|
||||
bool lastState = m_LastGamepadButtonState[gamepadID][static_cast<int>(button)];
|
||||
if (currentState != lastState) {
|
||||
if (currentState == true) {
|
||||
Events::GamepadButtonDown e;
|
||||
|
||||
@@ -105,8 +105,7 @@ bool Child::BoxCollides(const AABB& boxToTest, AABB& outBoxIntersected) const
|
||||
for (int i : m_DynamicObjIndices) {
|
||||
if (!m_DynamicObjectsRef[i].Checked) {
|
||||
const AABB& objBox = *m_DynamicObjectsRef[i].Box;
|
||||
if (!Collision::IsSameBoxProbably(boxToTest, objBox) &&
|
||||
Collision::AABBVsAABB(boxToTest, objBox)) {
|
||||
if (Collision::AABBVsAABB(boxToTest, objBox)) {
|
||||
outBoxIntersected = objBox;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -4,4 +4,40 @@
|
||||
_LOG_LEVEL LOG_LEVEL = LOG_LEVEL_DEBUG;
|
||||
#else
|
||||
_LOG_LEVEL LOG_LEVEL = LOG_LEVEL_INFO;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
const char* _LOG_LEVEL_PREFIX[] =
|
||||
{
|
||||
"EE: ",
|
||||
"",
|
||||
"WW: ",
|
||||
"DD: "
|
||||
};
|
||||
|
||||
void _LOG(_LOG_LEVEL logLevel, const char* file, const char* func, unsigned int line, const char* format, ...)
|
||||
{
|
||||
if (logLevel > LOG_LEVEL) {
|
||||
return;
|
||||
}
|
||||
|
||||
char* message = nullptr;
|
||||
va_list args;
|
||||
|
||||
va_start(args, format);
|
||||
size_t size = vsnprintf(message, 0, format, args) + 1;
|
||||
va_end(args);
|
||||
|
||||
va_start(args, format);
|
||||
message = new char[size];
|
||||
vsnprintf(message, size, format, args);
|
||||
va_end(args);
|
||||
|
||||
if (logLevel == LOG_LEVEL_ERROR) {
|
||||
std::cerr << file << ":" << line << " " << func << std::endl;
|
||||
std::cerr << _LOG_LEVEL_PREFIX[logLevel] << message << std::endl;
|
||||
} else {
|
||||
std::cout << _LOG_LEVEL_PREFIX[logLevel] << message << std::endl;
|
||||
}
|
||||
|
||||
delete[] message;
|
||||
}
|
||||
@@ -54,8 +54,12 @@ ComponentWrapper World::AttachComponent(EntityID entity, const std::string& comp
|
||||
|
||||
bool World::HasComponent(EntityID entity, const std::string& componentType) const
|
||||
{
|
||||
ComponentPool* pool = m_ComponentPools.at(componentType);
|
||||
return pool->KnowsEntity(entity);
|
||||
auto it = m_ComponentPools.find(componentType);
|
||||
if (it == m_ComponentPools.end()) {
|
||||
return false;
|
||||
} else {
|
||||
return it->second->KnowsEntity(entity);
|
||||
}
|
||||
}
|
||||
|
||||
ComponentWrapper World::GetComponent(EntityID entity, const std::string& componentType)
|
||||
@@ -92,6 +96,13 @@ EntityID World::GetParent(EntityID entity)
|
||||
|
||||
void World::SetParent(EntityID entity, EntityID parent)
|
||||
{
|
||||
// Don't allow an entity to be a child to itself!
|
||||
if (entity == parent) {
|
||||
// HACK: We purposely don't check the whole hierarchy of children here, since it would be way too slow.
|
||||
// This might result in infinite loops if an entity somehow ends up as a child.
|
||||
return;
|
||||
}
|
||||
|
||||
EntityID lastParent = m_EntityParents.at(entity);
|
||||
auto parentChildren = m_EntityChildren.equal_range(lastParent);
|
||||
for (auto it = parentChildren.first; it != parentChildren.second; it++) {
|
||||
|
||||
+141
-26
@@ -6,6 +6,11 @@ EditorGUI::EditorGUI(World* world, EventBroker* eventBroker)
|
||||
, m_EventBroker(eventBroker)
|
||||
{
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EKeyDown, &EditorGUI::OnKeyDown);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EFileDropped, &EditorGUI::OnFileDropped);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EPause, &EditorGUI::OnPause);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EResume, &EditorGUI::OnResume);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_ELockMouse, &EditorGUI::OnLockMouse);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EUnlockMouse, &EditorGUI::OnUnlockMouse);
|
||||
}
|
||||
|
||||
void EditorGUI::Draw()
|
||||
@@ -37,39 +42,60 @@ void EditorGUI::drawTools()
|
||||
return;
|
||||
}
|
||||
|
||||
// Widget modes
|
||||
createWidgetToolButton(WidgetMode::Translate);
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Translate");
|
||||
ImGui::SetTooltip("Translate (W)");
|
||||
}
|
||||
ImGui::SameLine();
|
||||
createWidgetToolButton(WidgetMode::Rotate);
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Rotate");
|
||||
ImGui::SetTooltip("Rotate (E)");
|
||||
}
|
||||
ImGui::SameLine();
|
||||
createWidgetToolButton(WidgetMode::Scale);
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("Scale");
|
||||
ImGui::SetTooltip("Scale (R)");
|
||||
}
|
||||
|
||||
ImGui::SameLine();
|
||||
ImGui::ItemSize(ImVec2(5, 0));
|
||||
|
||||
// Widget space
|
||||
ImGui::SameLine();
|
||||
GLuint spaceTexture = 0;
|
||||
if (m_CurrentWidgetSpace == WidgetSpace::Global) {
|
||||
spaceTexture = tryLoadTexture("Textures/Icons/Global.png");
|
||||
} else if (m_CurrentWidgetSpace == WidgetSpace::Local) {
|
||||
spaceTexture = tryLoadTexture("Textures/Icons/Local.png");
|
||||
}
|
||||
if (ImGui::ImageButton(reinterpret_cast<void*>(spaceTexture), ImVec2(24, 24), ImVec2(0, 1), ImVec2(1, 0), -1, ImVec4(0, 0, 0, 0), ImVec4(1, 1, 1, 1))) {
|
||||
toggleWidgetSpace();
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
if (m_CurrentWidgetSpace == WidgetSpace::Global) {
|
||||
ImGui::SetTooltip("Widget space: Global (X)");
|
||||
} else if (m_CurrentWidgetSpace == WidgetSpace::Local) {
|
||||
ImGui::SetTooltip("Widget space: Local (X)");
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::SameLine();
|
||||
ImGui::ItemSize(ImVec2(5, 0));
|
||||
|
||||
// Play button
|
||||
ImGui::SameLine();
|
||||
static bool paused = false;
|
||||
if (ImGui::ImageButton((void*)tryLoadTexture("Textures/Icons/Play.png"), ImVec2(24, 24), ImVec2(0, 1), ImVec2(1, 0), -1, ImVec4(0, 0, 0, 0), (!paused) ? ImVec4(0, 1, 0, 1) : ImVec4(1, 1, 1, 1))) {
|
||||
if (ImGui::ImageButton(reinterpret_cast<void*>(tryLoadTexture("Textures/Icons/Play.png")), ImVec2(24, 24), ImVec2(0, 1), ImVec2(1, 0), -1, ImVec4(0, 0, 0, 0), (!m_Paused) ? ImVec4(0, 1, 0, 1) : ImVec4(1, 1, 1, 1))) {
|
||||
Events::Resume e;
|
||||
e.World = m_World;
|
||||
m_EventBroker->Publish(e);
|
||||
paused = false;
|
||||
}
|
||||
// Pause button
|
||||
ImGui::SameLine();
|
||||
if (ImGui::ImageButton((void*)tryLoadTexture("Textures/Icons/Pause.png"), ImVec2(24, 24), ImVec2(0, 1), ImVec2(1, 0), -1, ImVec4(0, 0, 0, 0), (paused) ? ImVec4(0, 1, 0, 1) : ImVec4(1, 1, 1, 1))) {
|
||||
if (ImGui::ImageButton(reinterpret_cast<void*>(tryLoadTexture("Textures/Icons/Pause.png")), ImVec2(24, 24), ImVec2(0, 1), ImVec2(1, 0), -1, ImVec4(0, 0, 0, 0), (m_Paused) ? ImVec4(0, 1, 0, 1) : ImVec4(1, 1, 1, 1))) {
|
||||
Events::Pause e;
|
||||
e.World = m_World;
|
||||
m_EventBroker->Publish(e);
|
||||
paused = true;
|
||||
}
|
||||
|
||||
ImGui::End();
|
||||
@@ -168,10 +194,7 @@ bool EditorGUI::drawEntityNode(EntityWrapper entity)
|
||||
ImGui::Text(formatEntityName(entity).c_str());
|
||||
ImGui::End();
|
||||
}
|
||||
}/* else if (m_CurrentlyDragging == entity) {
|
||||
LOG_DEBUG("Stopped dragging %i", entity.ID);
|
||||
m_CurrentlyDragging = EntityWrapper::Invalid;
|
||||
}*/
|
||||
}
|
||||
// Entity context menu
|
||||
std::string contextMenuUniqueID = std::string("EntityContextMenu") + std::to_string(entity.ID);
|
||||
if (hovered && ImGui::IsMouseClicked(1)) {
|
||||
@@ -234,10 +257,12 @@ void EditorGUI::drawComponents(EntityWrapper entity)
|
||||
componentTypes.push_back(pair.first.c_str());
|
||||
}
|
||||
}
|
||||
// Sort components in alphabetical order
|
||||
std::sort(componentTypes.begin(), componentTypes.end(), compareCharArray);
|
||||
// Draw combo box
|
||||
ImGui::PushItemWidth(ImGui::GetContentRegionAvailWidth() - 10.f);
|
||||
int selectedItem = -1;
|
||||
if (ImGui::Combo("", &selectedItem, componentTypes.data(), componentTypes.size())) {
|
||||
if (ImGui::Combo("", &selectedItem, componentTypes.data(), static_cast<int>(componentTypes.size()), static_cast<int>(componentTypes.size()))) {
|
||||
if (selectedItem != -1) {
|
||||
if (m_OnComponentAttach != nullptr) {
|
||||
std::string chosenComponentType(componentTypes.at(selectedItem));
|
||||
@@ -283,9 +308,8 @@ bool EditorGUI::drawComponentNode(EntityWrapper entity, const ComponentInfo& ci)
|
||||
|
||||
// Draw component fields
|
||||
ComponentWrapper& component = entity.World->GetComponent(entity.ID, ci.Name);
|
||||
for (auto& kv : ci.Fields) {
|
||||
const std::string& fieldName = kv.first;
|
||||
const ComponentInfo::Field_t& field = kv.second;
|
||||
for (auto& fieldName : ci.FieldsInOrder) {
|
||||
const ComponentInfo::Field_t& field = ci.Fields.at(fieldName);
|
||||
|
||||
// Draw the field widget based on its type
|
||||
bool dirty = drawComponentField(component, field);
|
||||
@@ -435,18 +459,31 @@ bool EditorGUI::drawComponentField_bool(ComponentWrapper &c, const ComponentInfo
|
||||
|
||||
bool EditorGUI::drawComponentField_string(ComponentWrapper &c, const ComponentInfo::Field_t &field)
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
auto& val = c.Field<std::string>(field.Name);
|
||||
|
||||
char tempString[1024]; // Let's just hope this is an sufficiently large buffer for strings :)
|
||||
tempString[1023] = '\0'; // Null terminator just in case the string is larger than the buffer
|
||||
// Copy the string into the buffer, taking the null terminator into account
|
||||
memcpy(tempString, val.c_str(), std::min(val.length() + 1, sizeof(tempString) - 1));
|
||||
if (ImGui::InputText("", tempString, sizeof(tempString))) {
|
||||
val = std::string(tempString);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
result = true;
|
||||
}
|
||||
// TODO: Handle drag and drop of files
|
||||
|
||||
// Handle file drag and drop
|
||||
if (ImGui::IsItemHovered() && !m_DroppedFile.empty()) {
|
||||
// Unset potential input focus or our newly set value will be overwritten!
|
||||
if (ImGui::IsItemActive()) {
|
||||
ImGui::SetActiveID(0, nullptr);
|
||||
}
|
||||
// Set the actual dropped value
|
||||
val = m_DroppedFile;
|
||||
m_DroppedFile = "";
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void EditorGUI::drawModals()
|
||||
@@ -528,7 +565,7 @@ void EditorGUI::createWidgetToolButton(WidgetMode mode)
|
||||
break;
|
||||
}
|
||||
if (ImGui::ImageButton(
|
||||
(void*)texture,
|
||||
reinterpret_cast<void*>(texture),
|
||||
ImVec2(24, 24),
|
||||
ImVec2(0, 1),
|
||||
ImVec2(1, 0),
|
||||
@@ -537,10 +574,7 @@ void EditorGUI::createWidgetToolButton(WidgetMode mode)
|
||||
(m_CurrentWidgetMode == mode) ? ImVec4(0, 1, 0, 1) : ImVec4(1, 1, 1, 1)
|
||||
)
|
||||
) {
|
||||
if (m_OnWidgetMode != nullptr) {
|
||||
m_OnWidgetMode(mode);
|
||||
}
|
||||
m_CurrentWidgetMode = mode;
|
||||
setWidgetMode(mode);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -570,6 +604,61 @@ bool EditorGUI::OnKeyDown(const Events::KeyDown& e)
|
||||
}
|
||||
}
|
||||
|
||||
if (!m_MouseLocked) {
|
||||
if (e.KeyCode == GLFW_KEY_W) {
|
||||
setWidgetMode(WidgetMode::Translate);
|
||||
}
|
||||
if (e.KeyCode == GLFW_KEY_E) {
|
||||
setWidgetMode(WidgetMode::Rotate);
|
||||
}
|
||||
if (e.KeyCode == GLFW_KEY_R) {
|
||||
setWidgetMode(WidgetMode::Scale);
|
||||
}
|
||||
|
||||
if (e.KeyCode == GLFW_KEY_X) {
|
||||
toggleWidgetSpace();
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool EditorGUI::OnFileDropped(const Events::FileDropped& e)
|
||||
{
|
||||
// Make a best effort to make the path relative to the working directory of the executable
|
||||
m_DroppedFile = boost::filesystem::path(e.Path).lexically_relative(boost::filesystem::current_path()).string();
|
||||
// Compensate for Windows retardedness
|
||||
std::replace(m_DroppedFile.begin(), m_DroppedFile.end(), '\\', '/');
|
||||
// Special case for when people drop from the asset folder instead of from the symlink to the asset folders in bin
|
||||
boost::algorithm::replace_first(m_DroppedFile, "../assets/", "");
|
||||
return true;
|
||||
}
|
||||
|
||||
bool EditorGUI::OnPause(const Events::Pause& e)
|
||||
{
|
||||
if (e.World == m_World) {
|
||||
m_Paused = true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool EditorGUI::OnResume(const Events::Resume& e)
|
||||
{
|
||||
if (e.World == m_World) {
|
||||
m_Paused = false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool EditorGUI::OnLockMouse(const Events::LockMouse& e)
|
||||
{
|
||||
m_MouseLocked = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool EditorGUI::OnUnlockMouse(const Events::UnlockMouse& e)
|
||||
{
|
||||
m_MouseLocked = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -644,6 +733,32 @@ void EditorGUI::openModal(const std::string& modal)
|
||||
m_ModalsToOpen.insert(modal);
|
||||
}
|
||||
|
||||
void EditorGUI::setWidgetMode(WidgetMode mode)
|
||||
{
|
||||
if (m_OnWidgetMode != nullptr) {
|
||||
m_OnWidgetMode(mode);
|
||||
}
|
||||
m_CurrentWidgetMode = mode;
|
||||
}
|
||||
|
||||
void EditorGUI::toggleWidgetSpace()
|
||||
{
|
||||
if (m_CurrentWidgetSpace == WidgetSpace::Global) {
|
||||
m_CurrentWidgetSpace = WidgetSpace::Local;
|
||||
} else if (m_CurrentWidgetSpace == WidgetSpace::Local) {
|
||||
m_CurrentWidgetSpace = WidgetSpace::Global;
|
||||
}
|
||||
|
||||
if (m_OnWidgetSpace != nullptr) {
|
||||
m_OnWidgetSpace(m_CurrentWidgetSpace);
|
||||
}
|
||||
}
|
||||
|
||||
bool EditorGUI::compareCharArray(const char* c1, const char* c2)
|
||||
{
|
||||
return strcmp(c1, c2) < 0;
|
||||
}
|
||||
|
||||
void EditorGUI::SetDirty(EntityWrapper entity)
|
||||
{
|
||||
EntityWrapper baseParent = entity;
|
||||
@@ -731,7 +846,7 @@ void EditorGUI::entityDelete(EntityWrapper entity)
|
||||
|
||||
void EditorGUI::entityChangeParent(EntityWrapper entity, EntityWrapper parent)
|
||||
{
|
||||
if (entity == parent) {
|
||||
if (entity == parent || parent.IsChildOf(entity)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ EditorRenderSystem::EditorRenderSystem(World* m_World, EventBroker* eventBroker,
|
||||
|
||||
void EditorRenderSystem::Update(double dt)
|
||||
{
|
||||
if (m_CurrentCamera) {
|
||||
if (m_CurrentCamera.Valid()) {
|
||||
ComponentWrapper cameraTransform = m_CurrentCamera["Transform"];
|
||||
m_EditorCamera->SetPosition(cameraTransform["Position"]);
|
||||
m_EditorCamera->SetOrientation(glm::quat((const glm::vec3&)cameraTransform["Orientation"]));
|
||||
@@ -23,6 +23,12 @@ void EditorRenderSystem::Update(double dt)
|
||||
scene.Camera = m_EditorCamera;
|
||||
scene.Viewport = Rectangle(1920, 1080);
|
||||
|
||||
auto cSceneLight = m_World->GetComponents("SceneLight");
|
||||
if (cSceneLight != nullptr) {
|
||||
//these are hardcoded since they want special light treatment and a component just for widgets is stupid.
|
||||
scene.AmbientColor = glm::vec4(0.8, 0.8, 0.8, 1.0);
|
||||
}
|
||||
|
||||
auto models = m_World->GetComponents("Model");
|
||||
if (models != nullptr) {
|
||||
for (auto& cModel : *models) {
|
||||
@@ -49,7 +55,7 @@ void EditorRenderSystem::Update(double dt)
|
||||
glm::mat4 modelMatrix = Transform::ModelMatrix(entity.ID, entity.World);
|
||||
for (auto matGroup : model->MaterialGroups()) {
|
||||
std::shared_ptr<ModelJob> modelJob = std::make_shared<ModelJob>(model, scene.Camera, modelMatrix, matGroup, cModel, entity.World, glm::vec4(0), 0.f);
|
||||
if(cModel["Transparent"]) {
|
||||
if (cModel["Transparent"]) {
|
||||
scene.TransparentObjects.push_back(modelJob);
|
||||
} else {
|
||||
scene.OpaqueObjects.push_back(modelJob);
|
||||
@@ -80,9 +86,9 @@ bool EditorRenderSystem::OnSetCamera(Events::SetCamera& e)
|
||||
{
|
||||
ComponentWrapper cTransform = e.CameraEntity["Transform"];
|
||||
ComponentWrapper cCamera = e.CameraEntity["Camera"];
|
||||
m_EditorCamera->SetFOV((double)cCamera["FOV"]);
|
||||
m_EditorCamera->SetNearClip((double)cCamera["NearClip"]);
|
||||
m_EditorCamera->SetFarClip((double)cCamera["FarClip"]);
|
||||
m_EditorCamera->SetFOV(static_cast<float>((double)cCamera["FOV"]));
|
||||
m_EditorCamera->SetNearClip(static_cast<float>((double)cCamera["NearClip"]));
|
||||
m_EditorCamera->SetFarClip(static_cast<float>((double)cCamera["FarClip"]));
|
||||
m_EditorCamera->SetPosition(cTransform["Position"]);
|
||||
m_EditorCamera->SetOrientation(glm::quat((const glm::vec3&)cTransform["Orientation"]));
|
||||
m_CurrentCamera = e.CameraEntity;
|
||||
|
||||
@@ -31,6 +31,7 @@ EditorSystem::EditorSystem(World* world, EventBroker* eventBroker, IRenderer* re
|
||||
m_EditorGUI->SetComponentAttachCallback(std::bind(&EditorSystem::OnComponentAttach, this, std::placeholders::_1, std::placeholders::_2));
|
||||
m_EditorGUI->SetComponentDeleteCallback(std::bind(&EditorSystem::OnComponentDelete, this, std::placeholders::_1, std::placeholders::_2));
|
||||
m_EditorGUI->SetWidgetModeCallback(std::bind(&EditorSystem::setWidgetMode, this, std::placeholders::_1));
|
||||
m_EditorGUI->SetWidgetSpaceCallback(std::bind(&EditorSystem::OnWidgetSpace, this, std::placeholders::_1));
|
||||
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EMousePress, &EditorSystem::OnMousePress);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EWidgetDelta, &EditorSystem::OnWidgetDelta);
|
||||
@@ -65,7 +66,12 @@ void EditorSystem::Update(double dt)
|
||||
m_EditorStats->Draw(actualDelta);
|
||||
|
||||
if (m_CurrentSelection.Valid() && m_Widget.Valid()) {
|
||||
(glm::vec3&)m_Widget["Transform"]["Position"] = Transform::AbsolutePosition(m_CurrentSelection.World, m_CurrentSelection.ID);
|
||||
(glm::vec3&)m_Widget["Transform"]["Position"] = Transform::AbsolutePosition(m_CurrentSelection);
|
||||
if (m_WidgetSpace == EditorGUI::WidgetSpace::Local) {
|
||||
(glm::vec3&)m_Widget["Transform"]["Orientation"] = Transform::AbsoluteOrientationEuler(m_CurrentSelection);
|
||||
} else {
|
||||
(glm::vec3&)m_Widget["Transform"]["Orientation"] = glm::vec3(0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
m_EditorWorldSystemPipeline->Update(actualDelta);
|
||||
@@ -82,11 +88,22 @@ void EditorSystem::Update(double dt)
|
||||
void EditorSystem::Enable()
|
||||
{
|
||||
m_EditorCameraInputController->Enable();
|
||||
|
||||
m_EventBroker->Publish(Events::UnlockMouse());
|
||||
Events::SetCamera e;
|
||||
e.CameraEntity = m_EditorCamera;
|
||||
m_EventBroker->Publish(e);
|
||||
(glm::vec3&)m_EditorCamera["Transform"]["Position"] = Transform::AbsolutePosition(m_ActualCamera);
|
||||
|
||||
// Enable editor camera
|
||||
Events::SetCamera eSetCamera;
|
||||
eSetCamera.CameraEntity = m_EditorCamera;
|
||||
m_EventBroker->Publish(eSetCamera);
|
||||
if (m_ActualCamera.Valid()) {
|
||||
(glm::vec3&)m_EditorCamera["Transform"]["Position"] = Transform::AbsolutePosition(m_ActualCamera);
|
||||
}
|
||||
|
||||
// Pause the world we're editing
|
||||
Events::Pause ePause;
|
||||
ePause.World = m_World;
|
||||
m_EventBroker->Publish(ePause);
|
||||
|
||||
m_Enabled = true;
|
||||
}
|
||||
|
||||
@@ -154,6 +171,11 @@ void EditorSystem::OnComponentDelete(EntityWrapper entity, const std::string& co
|
||||
}
|
||||
}
|
||||
|
||||
void EditorSystem::OnWidgetSpace(EditorGUI::WidgetSpace widgetSpace)
|
||||
{
|
||||
m_WidgetSpace = widgetSpace;
|
||||
}
|
||||
|
||||
bool EditorSystem::OnMousePress(const Events::MousePress& e)
|
||||
{
|
||||
ImGuiIO& io = ImGui::GetIO();
|
||||
@@ -170,12 +192,18 @@ bool EditorSystem::OnMousePress(const Events::MousePress& e)
|
||||
bool EditorSystem::OnWidgetDelta(const Events::WidgetDelta& e)
|
||||
{
|
||||
if (m_CurrentSelection.Valid()) {
|
||||
glm::quat parentOrientation;
|
||||
EntityWrapper parent = m_CurrentSelection.Parent();
|
||||
if (parent.Valid()) {
|
||||
parentOrientation = glm::inverse(Transform::AbsoluteOrientation(parent.World, parent.ID));
|
||||
if (m_WidgetSpace == EditorGUI::WidgetSpace::Global) {
|
||||
glm::quat parentOrientation;
|
||||
EntityWrapper parent = m_CurrentSelection.Parent();
|
||||
if (parent.Valid()) {
|
||||
parentOrientation = glm::inverse(Transform::AbsoluteOrientation(parent));
|
||||
}
|
||||
(glm::vec3&)m_CurrentSelection["Transform"]["Position"] += parentOrientation * e.Translation;
|
||||
} else if (m_WidgetSpace == EditorGUI::WidgetSpace::Local) {
|
||||
glm::quat selectionOri = glm::quat((glm::vec3)m_CurrentSelection["Transform"]["Orientation"]);
|
||||
glm::vec3 localTranslation = selectionOri * e.Translation;
|
||||
(glm::vec3&)m_CurrentSelection["Transform"]["Position"] += localTranslation;
|
||||
}
|
||||
(glm::vec3&)m_CurrentSelection["Transform"]["Position"] += parentOrientation * e.Translation;
|
||||
m_EditorGUI->SetDirty(m_CurrentSelection);
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -23,14 +23,18 @@ void EditorWidgetSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper
|
||||
|
||||
Events::WidgetDelta e;
|
||||
|
||||
EntityWrapper moveEntity = entity.Parent();
|
||||
if (!moveEntity.Valid()) {
|
||||
moveEntity = entity;
|
||||
// Widget axes should have a common parent
|
||||
EntityWrapper widgetBase = entity.Parent();
|
||||
if (!widgetBase.Valid()) {
|
||||
widgetBase = entity;
|
||||
}
|
||||
glm::vec3 widgetBasePos = widgetBase["Transform"]["Position"];
|
||||
glm::quat widgetBaseOri = glm::quat((glm::vec3)widgetBase["Transform"]["Orientation"]);
|
||||
|
||||
auto camera = m_PickData.Camera;
|
||||
glm::vec3 axis = cEditorWidget["Axis"];
|
||||
glm::vec2 axisScreen = camera->WorldToScreen(axis, m_Renderer->Resolution()) - camera->WorldToScreen(glm::vec3(0, 0, 0), m_Renderer->Resolution());
|
||||
glm::vec3 axis = (glm::vec3)cEditorWidget["Axis"];
|
||||
glm::vec3 axisOriented = widgetBaseOri * axis;
|
||||
glm::vec2 axisScreen = camera->WorldToScreen(widgetBasePos + axisOriented, m_Renderer->GetViewportSize()) - camera->WorldToScreen(widgetBasePos, m_Renderer->GetViewportSize());
|
||||
float dot = glm::dot(m_MouseDelta, glm::normalize(axisScreen)) / glm::length(axisScreen);
|
||||
glm::vec3 worldMovement = dot * axis;
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ bool MouseInputHandler::OnMouseMove(const Events::MouseMove& e)
|
||||
Events::InputCommand ic;
|
||||
ic.PlayerID = -1;
|
||||
std::tie(ic.Command, ic.Value) = it->second;
|
||||
ic.Value *= e.DeltaX;
|
||||
ic.Value *= static_cast<float>(e.DeltaX);
|
||||
m_InputProxy->Publish(ic);
|
||||
}
|
||||
}
|
||||
@@ -109,7 +109,7 @@ bool MouseInputHandler::OnMouseMove(const Events::MouseMove& e)
|
||||
Events::InputCommand ic;
|
||||
ic.PlayerID = -1;
|
||||
std::tie(ic.Command, ic.Value) = it->second;
|
||||
ic.Value *= e.DeltaY;
|
||||
ic.Value *= static_cast<float>(e.DeltaY);
|
||||
m_InputProxy->Publish(ic);
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user