mirror of
https://github.com/antopilo/Nuake.git
synced 2026-09-21 20:08:40 +03:00
Moved project out of engine.h
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
#include "Engine.h"
|
||||
|
||||
#include "src/Scene/Scene.h"
|
||||
#include "src/Resource/Project.h"
|
||||
#include "src/Physics/PhysicsManager.h"
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
#include "src/AI/NavManager.h"
|
||||
#include "src/Audio/AudioManager.h"
|
||||
@@ -13,6 +15,7 @@
|
||||
#include "src/Threading/JobSystem.h"
|
||||
#include "src/Modules/Modules.h"
|
||||
|
||||
#include <GLFW/glfw3.h>
|
||||
#include <imgui/imgui_impl_glfw.h>
|
||||
#include <imgui/imgui_impl_opengl3.h>
|
||||
#include <Tracy.hpp>
|
||||
|
||||
@@ -2,12 +2,13 @@
|
||||
#include "src/Core/Core.h"
|
||||
#include "src/Core/Logger.h"
|
||||
#include "src/Window.h"
|
||||
#include "src/Scene/Scene.h"
|
||||
#include "src/Resource/Project.h"
|
||||
|
||||
// Welcome to the Nuake source code.
|
||||
namespace Nuake
|
||||
{
|
||||
class Project;
|
||||
class Scene;
|
||||
|
||||
enum GameState
|
||||
{
|
||||
Playing,
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
#include "OS.h"
|
||||
|
||||
#include "src/Window.h"
|
||||
#include "Engine.h"
|
||||
#include "src/Resource/Project.h"
|
||||
#include "src/Window.h"
|
||||
#include "src/Core/String.h"
|
||||
|
||||
#ifdef NK_WIN
|
||||
#define GLFW_EXPOSE_NATIVE_WIN32
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#include "Engine.h"
|
||||
#include "src/Core/OS.h"
|
||||
#include "src/Core/String.h"
|
||||
|
||||
#include "Directory.h"
|
||||
#include "File.h"
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
#include "src/Core/Core.h"
|
||||
#include "src/Core/Logger.h"
|
||||
#include "src/Core/Maths.h"
|
||||
#include <src/Physics/PhysicsShapes.h>
|
||||
#include "src/Resource/Project.h"
|
||||
#include "src/Physics/PhysicsShapes.h"
|
||||
#include "src/Scene/Components/TransformComponent.h"
|
||||
#include "src/Scene/Components/CharacterControllerComponent.h"
|
||||
|
||||
@@ -417,11 +418,6 @@ namespace Nuake
|
||||
}
|
||||
}
|
||||
|
||||
void DynamicWorld::AddGhostbody(Ref<GhostObject> gb)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void DynamicWorld::AddCharacterController(Ref<CharacterController> cc)
|
||||
{
|
||||
JPH::Ref<JPH::CharacterVirtualSettings> settings = new JPH::CharacterVirtualSettings();
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
#include <map>
|
||||
#include "RaycastResult.h"
|
||||
|
||||
#include <src/Physics/GhostObject.h>
|
||||
#include "CharacterController.h"
|
||||
#include "CollisionData.h"
|
||||
|
||||
@@ -72,7 +71,6 @@ namespace Nuake
|
||||
void SetGravity(const Vector3& g);
|
||||
void AddRigidbody(Ref<RigidBody> rb);
|
||||
|
||||
void AddGhostbody(Ref<GhostObject> gb);
|
||||
void AddCharacterController(Ref<CharacterController> cc);
|
||||
bool IsCharacterGrounded(const Entity& entity);
|
||||
Vector3 GetCharacterGroundVelocity(const Entity& entity);
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
#include "GhostObject.h"
|
||||
|
||||
#include "src/Physics/PhysicsManager.h"
|
||||
|
||||
namespace Nuake
|
||||
{
|
||||
GhostObject::GhostObject(Vector3 position, Ref<Physics::PhysicShape> shape)
|
||||
{
|
||||
m_OverlappingEntities = std::vector<Entity>();
|
||||
}
|
||||
|
||||
int GhostObject::OverlappingCount()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void GhostObject::ClearOverlappingList()
|
||||
{
|
||||
m_OverlappingEntities.clear();
|
||||
}
|
||||
|
||||
void GhostObject::SetEntityID(Entity ent)
|
||||
{
|
||||
}
|
||||
|
||||
void GhostObject::ScanOverlap()
|
||||
{
|
||||
ClearOverlappingList();
|
||||
|
||||
for (int i = 0; i < OverlappingCount(); i++)
|
||||
{
|
||||
int index =0;
|
||||
if (index == -1)
|
||||
continue;
|
||||
|
||||
Entity handle = Engine::GetCurrentScene()->GetEntity(index);
|
||||
m_OverlappingEntities.push_back(handle);
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<Entity> GhostObject::GetOverlappingEntities()
|
||||
{
|
||||
return m_OverlappingEntities;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
#pragma once
|
||||
#include "src/Core/Core.h"
|
||||
#include "src/Core/Maths.h"
|
||||
#include "PhysicsShapes.h"
|
||||
|
||||
#include <vector>
|
||||
#include <Engine.h>
|
||||
|
||||
|
||||
|
||||
namespace Nuake
|
||||
{
|
||||
class GhostObject {
|
||||
private:
|
||||
std::vector<Entity> m_OverlappingEntities;
|
||||
|
||||
public:
|
||||
GhostObject(Vector3 position, Ref<Physics::PhysicShape> shape);
|
||||
|
||||
int OverlappingCount();
|
||||
void ClearOverlappingList();
|
||||
void ScanOverlap();
|
||||
|
||||
void SetEntityID(Entity ent);
|
||||
|
||||
std::vector<Entity> GetOverlappingEntities();
|
||||
|
||||
};
|
||||
}
|
||||
@@ -17,11 +17,6 @@ namespace Nuake
|
||||
m_World->AddRigidbody(rb);
|
||||
}
|
||||
|
||||
void PhysicsManager::RegisterGhostBody(Ref<GhostObject> rb)
|
||||
{
|
||||
m_World->AddGhostbody(rb);
|
||||
}
|
||||
|
||||
void PhysicsManager::RegisterCharacterController(Ref<Physics::CharacterController> cc)
|
||||
{
|
||||
m_World->AddCharacterController(cc);
|
||||
|
||||
@@ -56,7 +56,6 @@ namespace Nuake
|
||||
const std::vector<Physics::CollisionData> GetCollisions();
|
||||
|
||||
void RegisterBody(Ref<Physics::RigidBody> rb);
|
||||
void RegisterGhostBody(Ref<GhostObject> rb);
|
||||
void RegisterCharacterController(Ref<Physics::CharacterController> c);
|
||||
|
||||
void SetBodyTransform(const Entity& entity, const Vector3& position, const Quat& rotation);
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
#include "SceneRenderer.h"
|
||||
#include "src/Rendering/Shaders/ShaderManager.h"
|
||||
|
||||
#include "src/Rendering/Shaders/ShaderManager.h"
|
||||
#include "src/Resource/Project.h"
|
||||
#include "src/Scene/Components/BSPBrushComponent.h"
|
||||
#include "src/Scene/Components/ModelComponent.h"
|
||||
#include "src/Scene/Components/ParentComponent.h"
|
||||
#include "src/Scene/Components/ParticleEmitterComponent.h"
|
||||
#include "src/Scene/Components/SpriteComponent.h"
|
||||
#include <src/Scene/Components/SkinnedModelComponent.h>
|
||||
|
||||
#include <glad/glad.h>
|
||||
#include <src/Scene/Components/SkinnedModelComponent.h>
|
||||
#include <src/Vendors/imgui/imgui.h>
|
||||
#include <Tracy.hpp>
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include <src/Resource/FGD/FDGSerializer.h>
|
||||
#include "src/FileSystem/FileSystem.h"
|
||||
#include "Engine.h"
|
||||
#include "src/Resource/Project.h"
|
||||
|
||||
namespace Nuake {
|
||||
FGDFile::FGDFile(const std::string path)
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
#pragma once
|
||||
#include "src/Physics/GhostObject.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace Nuake {
|
||||
class TriggerZone {
|
||||
namespace Nuake
|
||||
{
|
||||
class TriggerZone
|
||||
{
|
||||
public:
|
||||
Ref<GhostObject> m_GhostObject;
|
||||
std::string target = "";
|
||||
|
||||
std::vector<Entity> Targets;
|
||||
@@ -16,23 +17,10 @@ namespace Nuake {
|
||||
Targets = std::vector<Entity>();
|
||||
}
|
||||
|
||||
int GetOverLappingCount()
|
||||
std::vector<Entity> GetTargets()
|
||||
{
|
||||
if (!Enabled) return 0;
|
||||
|
||||
return m_GhostObject->OverlappingCount();
|
||||
}
|
||||
|
||||
std::vector<Entity> GetTargets() {
|
||||
return Targets;
|
||||
}
|
||||
|
||||
std::vector<Entity> GetOverlappingBodies()
|
||||
{
|
||||
if (!Enabled)
|
||||
return std::vector<Entity>();
|
||||
|
||||
return m_GhostObject->GetOverlappingEntities();
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "src/Core/Logger.h"
|
||||
#include <src/Vendors/imgui/imgui.h>
|
||||
#include <Engine.h>
|
||||
#include "src/Resource/Project.h"
|
||||
|
||||
namespace Nuake
|
||||
{
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
#include "QuakeMapBuilder.h"
|
||||
|
||||
#include "Engine.h"
|
||||
#include "src/Resource/Project.h"
|
||||
|
||||
#include "src/Rendering/Mesh/Mesh.h"
|
||||
#include "src/FileSystem/FileSystem.h"
|
||||
#include "src/Core/String.h"
|
||||
@@ -24,12 +27,14 @@ extern "C" {
|
||||
#include "src/Scene/Components/WrenScriptComponent.h"
|
||||
#include "src/Scene/Components/PrefabComponent.h"
|
||||
#include "src/Scene/Components/ModelComponent.h"
|
||||
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <src/Resource/ResourceLoader.h>
|
||||
#include <src/Scene/Components/NetScriptComponent.h>
|
||||
#include <src/Scripting/ScriptingEngineNet.h>
|
||||
#include <src/Resource/FGD/FGDFile.h>
|
||||
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
|
||||
namespace Nuake {
|
||||
struct ProcessedMesh
|
||||
|
||||
@@ -423,7 +423,7 @@ namespace Nuake
|
||||
|
||||
TriggerZone trigger = ent.GetComponent<TriggerZone>();
|
||||
|
||||
int count = trigger.GetOverLappingCount();
|
||||
int count = 0;
|
||||
|
||||
wrenSetSlotDouble(vm, 0, count);
|
||||
}
|
||||
@@ -435,7 +435,7 @@ namespace Nuake
|
||||
|
||||
TriggerZone trigger = ent.GetComponent<TriggerZone>();
|
||||
|
||||
std::vector<Entity> entities = trigger.GetOverlappingBodies();
|
||||
std::vector<Entity> entities = {};
|
||||
|
||||
wrenEnsureSlots(vm, static_cast<int>(entities.size()));
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#include "ImUI.h"
|
||||
#include "Engine.h"
|
||||
#include "src/Resource/Project.h"
|
||||
|
||||
#include <imgui/imgui_internal.h>
|
||||
#include <Engine.h>
|
||||
|
||||
namespace Nuake {
|
||||
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
|
||||
#include "Window.h"
|
||||
|
||||
#include <glad/glad.h>
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
#include "Engine.h"
|
||||
#include "src/Resource/Project.h"
|
||||
#include "src/Core/Maths.h"
|
||||
#include "src/Rendering/Renderer.h"
|
||||
#include "src/Rendering/Buffers/Framebuffer.h"
|
||||
@@ -12,6 +10,8 @@
|
||||
|
||||
#include "src/Resource/StaticResources.h"
|
||||
|
||||
#include <glad/glad.h>
|
||||
#include <GLFW/glfw3.h>
|
||||
#include <glm/gtc/type_ptr.hpp>
|
||||
#include <glm/gtx/matrix_decompose.hpp>
|
||||
#include <imgui/imgui.h>
|
||||
|
||||
Reference in New Issue
Block a user