-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #362 from TheMadDodger/physics-module-base
Add physics module base and inherit it in Jolt module
- Loading branch information
Showing
18 changed files
with
140 additions
and
15 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
GloryEngine/Editor/Extensions/JoltEditorExtension/CharacterControllerEditor.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
GloryEngine/Editor/Extensions/JoltEditorExtension/PhysicsBodyEditor.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
28 changes: 28 additions & 0 deletions
28
GloryEngine/Modules/Base/GloryPhysicsModule/PhysicsModule.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#include "PhysicsModule.h" | ||
#include "PhysicsComponents.h" | ||
|
||
#include <GloryECS/EntityRegistry.h> | ||
#include <GloryECS/EntityView.h> | ||
|
||
#include <Engine.h> | ||
#include <SceneManager.h> | ||
|
||
namespace Glory | ||
{ | ||
PhysicsModule::PhysicsModule() {} | ||
PhysicsModule::~PhysicsModule() {} | ||
|
||
const std::type_info& PhysicsModule::GetBaseModuleType() | ||
{ | ||
return typeid(PhysicsModule); | ||
} | ||
|
||
void PhysicsModule::Initialize() | ||
{ | ||
Reflect::SetReflectInstance(&m_pEngine->Reflection()); | ||
Reflect::RegisterEnum<BodyType>(); | ||
|
||
m_pEngine->GetSceneManager()->RegisterComponent<PhysicsBody>(); | ||
m_pEngine->GetSceneManager()->RegisterComponent<CharacterController>(); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
GloryEngine/Modules/Base/GloryPhysicsModule/PhysicsModule.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#pragma once | ||
#include <Module.h> | ||
|
||
#include <functional> | ||
|
||
namespace Glory | ||
{ | ||
/** @brief Base class for audio backend and mixing modules */ | ||
class PhysicsModule : public Module | ||
{ | ||
public: | ||
/** @brief Constructor */ | ||
PhysicsModule(); | ||
/** @brief Destructor */ | ||
virtual ~PhysicsModule(); | ||
|
||
/** @brief PhysicsModule type */ | ||
const std::type_info& GetBaseModuleType() override; | ||
|
||
protected: | ||
virtual void Initialize() override; | ||
virtual void Cleanup() = 0; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
project "GloryPhysicsModule" | ||
kind "StaticLib" | ||
language "C++" | ||
cppdialect "C++17" | ||
staticruntime "Off" | ||
|
||
targetdir ("%{moduleBaseOutDir}") | ||
objdir ("%{outputDir}") | ||
|
||
files | ||
{ | ||
"**.h", | ||
"**.cpp", | ||
"premake5.lua", | ||
} | ||
|
||
vpaths | ||
{ | ||
|
||
} | ||
|
||
includedirs | ||
{ | ||
"%{DepsIncludeDir}", | ||
|
||
"%{IncludeDir.glm}", | ||
"%{GloryIncludeDir.core}", | ||
"%{IncludeDir.Reflect}", | ||
"%{IncludeDir.Version}", | ||
"%{IncludeDir.Utils}", | ||
"%{IncludeDir.ECS}", | ||
|
||
"%{IncludeDir.yaml_cpp}", | ||
|
||
"%{DepIncludesDir}", | ||
} | ||
|
||
defines | ||
{ | ||
"GLORY_EXPORTS" | ||
} | ||
|
||
filter "system:windows" | ||
systemversion "10.0.19041.0" | ||
toolset "v143" | ||
|
||
defines | ||
{ | ||
"_LIB" | ||
} | ||
|
||
filter "platforms:Win32" | ||
architecture "x86" | ||
defines "WIN32" | ||
|
||
filter "platforms:x64" | ||
architecture "x64" | ||
|
||
filter "configurations:Debug" | ||
runtime "Debug" | ||
defines "_DEBUG" | ||
symbols "On" | ||
|
||
filter "configurations:Release" | ||
runtime "Release" | ||
defines "NDEBUG" | ||
optimize "On" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#pragma once | ||
#include "Physics.h" | ||
#include <Physics.h> | ||
|
||
#include <map> | ||
#include <cstdint> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
GloryEngine/Scripting/Mono/GloryJoltMonoExtender/PhysicsComponentsCSAPI.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters