summaryrefslogtreecommitdiff
path: root/servers/physics_server_3d.h
diff options
context:
space:
mode:
Diffstat (limited to 'servers/physics_server_3d.h')
-rw-r--r--servers/physics_server_3d.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/servers/physics_server_3d.h b/servers/physics_server_3d.h
index fcdd207843..1fabedc6ad 100644
--- a/servers/physics_server_3d.h
+++ b/servers/physics_server_3d.h
@@ -225,11 +225,15 @@ public:
virtual ~RenderingServerHandler() {}
};
+class PhysicsTestMotionResult3D;
+
class PhysicsServer3D : public Object {
GDCLASS(PhysicsServer3D, Object);
static PhysicsServer3D *singleton;
+ virtual bool _body_test_motion(RID p_body, const Transform3D &p_from, const Vector3 &p_motion, bool p_infinite_inertia, real_t p_margin = 0.001, const Ref<PhysicsTestMotionResult3D> &p_result = Ref<PhysicsTestMotionResult3D>());
+
protected:
static void _bind_methods();
@@ -770,6 +774,33 @@ public:
~PhysicsServer3D();
};
+class PhysicsTestMotionResult3D : public RefCounted {
+ GDCLASS(PhysicsTestMotionResult3D, RefCounted);
+
+ PhysicsServer3D::MotionResult result;
+ friend class PhysicsServer3D;
+
+protected:
+ static void _bind_methods();
+
+public:
+ PhysicsServer3D::MotionResult *get_result_ptr() const { return const_cast<PhysicsServer3D::MotionResult *>(&result); }
+
+ Vector3 get_motion() const;
+ Vector3 get_motion_remainder() const;
+
+ Vector3 get_collision_point() const;
+ Vector3 get_collision_normal() const;
+ Vector3 get_collider_velocity() const;
+ ObjectID get_collider_id() const;
+ RID get_collider_rid() const;
+ Object *get_collider() const;
+ int get_collider_shape() const;
+ real_t get_collision_depth() const;
+ real_t get_collision_safe_fraction() const;
+ real_t get_collision_unsafe_fraction() const;
+};
+
typedef PhysicsServer3D *(*CreatePhysicsServer3DCallback)();
class PhysicsServer3DManager {