Added physics module

Signed-off-by: Robear Selwans <robear.selwans@outlook.com>
This commit is contained in:
2021-03-31 03:42:19 +02:00
parent 4f23c60369
commit 5b7abac12a
3 changed files with 32 additions and 7 deletions

View File

@@ -13,6 +13,9 @@ evmodglfw_dep = dependency('evmod_glfw')
subproject('evmod_ecs')
evmodecs_dep = dependency('evmod_ecs')
subproject('evmod_physics')
evmodphysics_dep = dependency('evmod_physics')
sandbox_incdir = []
configure_file(input: 'config.lua', output: 'config.lua', copy: true)
@@ -27,6 +30,14 @@ if build_machine.system() == 'windows'
build_by_default: true,
)
# flecs dll needs to be copied to root builddir
flecsdllcopy = custom_target(
'flecsDLLCopy',
output: 'flecsDLL',
command: ['powershell.exe', meson.current_source_dir() + '/buildscripts/flecsdllcopy.ps1', meson.project_build_root()],
build_by_default: true,
)
# lua dll only needs to be copied in the environment setup
run_command('powershell.exe', meson.current_source_dir() + '/buildscripts/luadllcopy.ps1', meson.project_source_root(), meson.project_build_root())
endif
@@ -38,6 +49,7 @@ sandbox_exe = executable(
evol_dep,
evmodglfw_dep,
evmodecs_dep,
evmodphysics_dep,
],
install : true,
include_directories: sandbox_incdir,

View File

@@ -2,21 +2,24 @@
#include <evol/common/ev_log.h>
#include <assert.h>
#define NAMESPACE_MODULE evmod_glfw
#include <evol/meta/namespace_import.h>
#define TYPE_MODULE evmod_glfw
#include <evol/meta/type_import.h>
#define TYPE_MODULE evmod_ecs
#include <evol/meta/type_import.h>
#define TYPE_MODULE evmod_physics
#include <evol/meta/type_import.h>
#define NAMESPACE_MODULE evmod_glfw
#include <evol/meta/namespace_import.h>
#define NAMESPACE_MODULE evmod_ecs
#include <evol/meta/namespace_import.h>
#define NAMESPACE_MODULE evmod_physics
#include <evol/meta/namespace_import.h>
#define IMPORT_NAMESPACES do { \
IMPORT_NAMESPACE(ECS, ecs_module); \
IMPORT_NAMESPACE(Window, window_module); \
IMPORT_NAMESPACE(Physics, physics_module); \
} while (0)
typedef struct Cmp1 {
@@ -45,8 +48,9 @@ int main(int argc, char **argv)
evol_parse_args(engine, argc, argv);
evol_init(engine);
evolmodule_t window_module = evol_loadmodule("window"); DEBUG_ASSERT(window_module);
evolmodule_t ecs_module = evol_loadmodule("ecs"); DEBUG_ASSERT(ecs_module);
evolmodule_t window_module = evol_loadmodule("window"); DEBUG_ASSERT(window_module);
evolmodule_t ecs_module = evol_loadmodule("ecs"); DEBUG_ASSERT(ecs_module);
evolmodule_t physics_module = evol_loadmodule("physics"); DEBUG_ASSERT(physics_module);
IMPORT_NAMESPACES;
@@ -72,12 +76,14 @@ int main(int argc, char **argv)
bool result = 0;
while(true) {
result |= Window->update(0.0);
result |= Window->update(0.0);
result |= ECS->update(0.0);
result |= Physics->update(0.0);
if(result) break;
}
evol_unloadmodule(physics_module);
evol_unloadmodule(ecs_module);
evol_unloadmodule(window_module);
evol_deinit(engine);

View File

@@ -0,0 +1,7 @@
[wrap-git]
directory = evmod_physics
url = https://github.com/evol3D/evol-mod-bullet3.git
revision = master
[provide]
dependency_names = evmod_physics