diff options
author | Mikael Hermansson <mikael@hermansson.io> | 2023-09-19 22:20:39 +0200 |
---|---|---|
committer | Mikael Hermansson <mikael@hermansson.io> | 2023-09-20 12:24:32 +0200 |
commit | ee9f41a12d399611d60bbc7a11bb07b12e16dca3 (patch) | |
tree | d9a5023d96d373688a93fdcb576523108771b6e4 /servers | |
parent | 571cd0eb791b37e9a8adda9f909251138170f6b7 (diff) | |
download | redot-engine-ee9f41a12d399611d60bbc7a11bb07b12e16dca3.tar.gz |
Fix bindings of `PhysicsServer3DRenderingServerHandler`
Diffstat (limited to 'servers')
-rw-r--r-- | servers/physics_3d/godot_soft_body_3d.cpp | 6 | ||||
-rw-r--r-- | servers/physics_server_3d.cpp | 16 | ||||
-rw-r--r-- | servers/physics_server_3d.h | 8 |
3 files changed, 16 insertions, 14 deletions
diff --git a/servers/physics_3d/godot_soft_body_3d.cpp b/servers/physics_3d/godot_soft_body_3d.cpp index 4b35dd1500..2081c132af 100644 --- a/servers/physics_3d/godot_soft_body_3d.cpp +++ b/servers/physics_3d/godot_soft_body_3d.cpp @@ -155,11 +155,9 @@ void GodotSoftBody3D::update_rendering_server(PhysicsServer3DRenderingServerHand for (uint32_t i = 0; i < vertex_count; ++i) { const uint32_t node_index = map_visual_to_physics[i]; const Node &node = nodes[node_index]; - const Vector3 &vertex_position = node.x; - const Vector3 &vertex_normal = node.n; - p_rendering_server_handler->set_vertex(i, &vertex_position); - p_rendering_server_handler->set_normal(i, &vertex_normal); + p_rendering_server_handler->set_vertex(i, node.x); + p_rendering_server_handler->set_normal(i, node.n); } p_rendering_server_handler->set_aabb(bounds); diff --git a/servers/physics_server_3d.cpp b/servers/physics_server_3d.cpp index 8497bc78e2..0dfc87f199 100644 --- a/servers/physics_server_3d.cpp +++ b/servers/physics_server_3d.cpp @@ -34,20 +34,24 @@ #include "core/string/print_string.h" #include "core/variant/typed_array.h" -void PhysicsServer3DRenderingServerHandler::set_vertex(int p_vertex_id, const void *p_vector3) { - GDVIRTUAL_REQUIRED_CALL(_set_vertex, p_vertex_id, p_vector3); +void PhysicsServer3DRenderingServerHandler::set_vertex(int p_vertex_id, const Vector3 &p_vertex) { + GDVIRTUAL_REQUIRED_CALL(_set_vertex, p_vertex_id, p_vertex); } -void PhysicsServer3DRenderingServerHandler::set_normal(int p_vertex_id, const void *p_vector3) { - GDVIRTUAL_REQUIRED_CALL(_set_normal, p_vertex_id, p_vector3); +void PhysicsServer3DRenderingServerHandler::set_normal(int p_vertex_id, const Vector3 &p_normal) { + GDVIRTUAL_REQUIRED_CALL(_set_normal, p_vertex_id, p_normal); } void PhysicsServer3DRenderingServerHandler::set_aabb(const AABB &p_aabb) { GDVIRTUAL_REQUIRED_CALL(_set_aabb, p_aabb); } void PhysicsServer3DRenderingServerHandler::_bind_methods() { - GDVIRTUAL_BIND(_set_vertex, "vertex_id", "vertices"); - GDVIRTUAL_BIND(_set_normal, "vertex_id", "normals"); + GDVIRTUAL_BIND(_set_vertex, "vertex_id", "vertex"); + GDVIRTUAL_BIND(_set_normal, "vertex_id", "normal"); GDVIRTUAL_BIND(_set_aabb, "aabb"); + + ClassDB::bind_method(D_METHOD("set_vertex", "vertex_id", "vertex"), &PhysicsServer3DRenderingServerHandler::set_vertex); + ClassDB::bind_method(D_METHOD("set_normal", "vertex_id", "normal"), &PhysicsServer3DRenderingServerHandler::set_normal); + ClassDB::bind_method(D_METHOD("set_aabb", "aabb"), &PhysicsServer3DRenderingServerHandler::set_aabb); } PhysicsServer3D *PhysicsServer3D::singleton = nullptr; diff --git a/servers/physics_server_3d.h b/servers/physics_server_3d.h index 553d73b549..68dda8b84d 100644 --- a/servers/physics_server_3d.h +++ b/servers/physics_server_3d.h @@ -211,15 +211,15 @@ public: class PhysicsServer3DRenderingServerHandler : public Object { GDCLASS(PhysicsServer3DRenderingServerHandler, Object) protected: - GDVIRTUAL2(_set_vertex, int, GDExtensionConstPtr<void>) - GDVIRTUAL2(_set_normal, int, GDExtensionConstPtr<void>) + GDVIRTUAL2(_set_vertex, int, const Vector3 &) + GDVIRTUAL2(_set_normal, int, const Vector3 &) GDVIRTUAL1(_set_aabb, const AABB &) static void _bind_methods(); public: - virtual void set_vertex(int p_vertex_id, const void *p_vector3); - virtual void set_normal(int p_vertex_id, const void *p_vector3); + virtual void set_vertex(int p_vertex_id, const Vector3 &p_vertex); + virtual void set_normal(int p_vertex_id, const Vector3 &p_normal); virtual void set_aabb(const AABB &p_aabb); virtual ~PhysicsServer3DRenderingServerHandler() {} |