Create GDExtension clases for PhysicsServer3D
* Allows creating a GDExtension based 3D Physics Server (for Bullet, PhysX, etc. support) * Some changes on native struct binding for PhysicsServer This allows a 3D Physics server created entirely from GDExtension. Once it works, the idea is to port the 2D one to it.
This commit is contained in:
@ -33,6 +33,9 @@
|
||||
|
||||
#include "core/io/resource.h"
|
||||
#include "core/object/class_db.h"
|
||||
#include "core/object/gdvirtual.gen.inc"
|
||||
#include "core/object/script_language.h"
|
||||
#include "core/variant/native_ptr.h"
|
||||
|
||||
class PhysicsDirectSpaceState3D;
|
||||
|
||||
@ -202,13 +205,21 @@ public:
|
||||
PhysicsDirectSpaceState3D();
|
||||
};
|
||||
|
||||
class RenderingServerHandler {
|
||||
public:
|
||||
virtual void set_vertex(int p_vertex_id, const void *p_vector3) = 0;
|
||||
virtual void set_normal(int p_vertex_id, const void *p_vector3) = 0;
|
||||
virtual void set_aabb(const AABB &p_aabb) = 0;
|
||||
class PhysicsServer3DRenderingServerHandler : public Object {
|
||||
GDCLASS(PhysicsServer3DRenderingServerHandler, Object)
|
||||
protected:
|
||||
GDVIRTUAL2(_set_vertex, int, GDNativeConstPtr<void>)
|
||||
GDVIRTUAL2(_set_normal, int, GDNativeConstPtr<void>)
|
||||
GDVIRTUAL1(_set_aabb, const AABB &)
|
||||
|
||||
virtual ~RenderingServerHandler() {}
|
||||
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_aabb(const AABB &p_aabb);
|
||||
|
||||
virtual ~PhysicsServer3DRenderingServerHandler() {}
|
||||
};
|
||||
|
||||
class PhysicsTestMotionParameters3D;
|
||||
@ -552,7 +563,7 @@ public:
|
||||
|
||||
virtual RID soft_body_create() = 0;
|
||||
|
||||
virtual void soft_body_update_rendering_server(RID p_body, RenderingServerHandler *p_rendering_server_handler) = 0;
|
||||
virtual void soft_body_update_rendering_server(RID p_body, PhysicsServer3DRenderingServerHandler *p_rendering_server_handler) = 0;
|
||||
|
||||
virtual void soft_body_set_space(RID p_body, RID p_space) = 0;
|
||||
virtual RID soft_body_get_space(RID p_body) const = 0;
|
||||
@ -624,7 +635,7 @@ public:
|
||||
virtual void joint_set_solver_priority(RID p_joint, int p_priority) = 0;
|
||||
virtual int joint_get_solver_priority(RID p_joint) const = 0;
|
||||
|
||||
virtual void joint_disable_collisions_between_bodies(RID p_joint, const bool p_disable) = 0;
|
||||
virtual void joint_disable_collisions_between_bodies(RID p_joint, bool p_disable) = 0;
|
||||
virtual bool joint_is_disabled_collisions_between_bodies(RID p_joint) const = 0;
|
||||
|
||||
virtual void joint_make_pin(RID p_joint, RID p_body_A, const Vector3 &p_local_A, RID p_body_B, const Vector3 &p_local_B) = 0;
|
||||
|
||||
Reference in New Issue
Block a user