diff --git a/src/RecastNavMesh.cpp b/src/RecastNavMesh.cpp new file mode 100644 index 0000000..a0fd4a9 --- /dev/null +++ b/src/RecastNavMesh.cpp @@ -0,0 +1,15 @@ +#include "RecastNavMesh.hpp" + +RecastNavMesh::RecastNavMesh() { + +} + +RecastNavMesh::~RecastNavMesh() { + +} + +void RecastNavMesh::_bind_methods() { + +} + + diff --git a/src/RecastNavMesh.hpp b/src/RecastNavMesh.hpp new file mode 100644 index 0000000..1de2f42 --- /dev/null +++ b/src/RecastNavMesh.hpp @@ -0,0 +1,22 @@ +#pragma once + +#include + +namespace godot { + + class RecastNavMesh : public Node3D { + GDCLASS(RecastNavMesh, Node3D) + private: + bool calculated = false; + protected: + static void _bind_methods(); + public: + RecastNavMesh(); + ~RecastNavMesh(); + void clear_vertices(); + bool add_vertices(const PackedByteArray& vertices); + bool recalculate_navmesh(); + bool is_calculated() { return calculated; } + }; + +} diff --git a/src/registration.cpp b/src/registration.cpp index b627431..66fdc14 100644 --- a/src/registration.cpp +++ b/src/registration.cpp @@ -1,12 +1,14 @@ #include #include +#include "RecastNavMesh.hpp" + void register_gameplay_types(godot::ModuleInitializationLevel p_level) { if (p_level != godot::ModuleInitializationLevel::MODULE_INITIALIZATION_LEVEL_SCENE) { return; } - // REGISTER CLASSES HERE LATER + ClassDB::register_class(); } void unregister_gameplay_types(godot::ModuleInitializationLevel p_level) { @@ -15,7 +17,6 @@ void unregister_gameplay_types(godot::ModuleInitializationLevel p_level) { extern "C" { - GDExtensionBool GDE_EXPORT recastnavigation_library_init(GDExtensionInterfaceGetProcAddress p_get_proc_address, GDExtensionClassLibraryPtr p_library, GDExtensionInitialization *r_initialization) { godot::GDExtensionBinding::InitObject init_obj(p_get_proc_address, p_library, r_initialization); init_obj.register_initializer(register_gameplay_types);