summaryrefslogtreecommitdiff
path: root/scene/3d/physics_body_3d.h
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-07-15 23:18:59 +0200
committerGitHub <noreply@github.com>2021-07-15 23:18:59 +0200
commit60add98a4cff0d27c6aa2f52042555eccb86ed70 (patch)
treefa9bf87f60bef4d5676c207086c6737a50c91b71 /scene/3d/physics_body_3d.h
parent7aa44bef1ebef91bcb1c728e39007d8f5bf276ff (diff)
parent7f9212795955dd3be741b04c6442db51bb9f4612 (diff)
Merge pull request #49328 from nekomatata/sync-to-physics-3d
Support for 3D sync to physics
Diffstat (limited to 'scene/3d/physics_body_3d.h')
-rw-r--r--scene/3d/physics_body_3d.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/scene/3d/physics_body_3d.h b/scene/3d/physics_body_3d.h
index 9d45ce3799..0ef9c78f3b 100644
--- a/scene/3d/physics_body_3d.h
+++ b/scene/3d/physics_body_3d.h
@@ -82,13 +82,16 @@ class StaticBody3D : public PhysicsBody3D {
Ref<PhysicsMaterial> physics_material_override;
bool kinematic_motion = false;
+ bool sync_to_physics = false;
+
+ Transform3D last_valid_transform;
+
+ void _direct_state_changed(Object *p_state);
protected:
void _notification(int p_what);
static void _bind_methods();
- void _direct_state_changed(Object *p_state);
-
public:
void set_physics_material_override(const Ref<PhysicsMaterial> &p_physics_material_override);
Ref<PhysicsMaterial> get_physics_material_override() const;
@@ -102,6 +105,8 @@ public:
virtual Vector3 get_linear_velocity() const override;
virtual Vector3 get_angular_velocity() const override;
+ virtual TypedArray<String> get_configuration_warnings() const override;
+
StaticBody3D();
private:
@@ -111,6 +116,9 @@ private:
void set_kinematic_motion_enabled(bool p_enabled);
bool is_kinematic_motion_enabled() const;
+
+ void set_sync_to_physics(bool p_enable);
+ bool is_sync_to_physics_enabled() const;
};
class RigidBody3D : public PhysicsBody3D {
@@ -251,7 +259,7 @@ public:
void apply_impulse(const Vector3 &p_impulse, const Vector3 &p_position = Vector3());
void apply_torque_impulse(const Vector3 &p_impulse);
- TypedArray<String> get_configuration_warnings() const override;
+ virtual TypedArray<String> get_configuration_warnings() const override;
RigidBody3D();
~RigidBody3D();