Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
henrik committed Nov 30, 2023
1 parent 6f7ddf1 commit ee0ea4c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3615,6 +3615,9 @@ bool Main::iteration() {

PhysicsServer3D::get_singleton()->end_sync();
PhysicsServer3D::get_singleton()->step(physics_step * time_scale);
if (Engine::get_singleton()->get_physics_flush_transforms()) {
PhysicsServer3D::get_singleton()->flush_transforms();
}

PhysicsServer2D::get_singleton()->end_sync();
PhysicsServer2D::get_singleton()->step(physics_step * time_scale);
Expand Down
1 change: 1 addition & 0 deletions servers/physics_2d/godot_physics_server_2d.h
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ class GodotPhysicsServer2D : public PhysicsServer2D {
virtual void flush_queries() override;
virtual void end_sync() override;
virtual void finish() override;
virtual void flush_transforms() override;

Check failure on line 298 in servers/physics_2d/godot_physics_server_2d.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor w/ Mono (target=editor)

'virtual void GodotPhysicsServer2D::flush_transforms()' marked 'override', but does not override

Check failure on line 298 in servers/physics_2d/godot_physics_server_2d.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with doubles and GCC sanitizers (target=editor, tests=yes, dev_build=yes, scu_build=yes, precision=double, use_asan=yes, use_ubsan=yes, linker=gold)

'virtual void GodotPhysicsServer2D::flush_transforms()' marked 'override', but does not override

Check failure on line 298 in servers/physics_2d/godot_physics_server_2d.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with clang sanitizers (target=editor, tests=yes, dev_build=yes, use_asan=yes, use_ubsan=yes, use_llvm=yes, linker=lld)

'flush_transforms' marked 'override' but does not override any member functions

Check failure on line 298 in servers/physics_2d/godot_physics_server_2d.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with ThreadSanitizer (target=editor, tests=yes, dev_build=yes, use_tsan=yes, use_llvm=yes, linker=lld)

'flush_transforms' marked 'override' but does not override any member functions

Check failure on line 298 in servers/physics_2d/godot_physics_server_2d.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Template w/ Mono (target=template_release)

'virtual void GodotPhysicsServer2D::flush_transforms()' marked 'override', but does not override

Check failure on line 298 in servers/physics_2d/godot_physics_server_2d.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Minimal template (target=template_release, everything disabled)

'virtual void GodotPhysicsServer2D::flush_transforms()' marked 'override', but does not override

Check failure on line 298 in servers/physics_2d/godot_physics_server_2d.h

View workflow job for this annotation

GitHub Actions / 🏁 Windows / Editor (target=editor, tests=yes)

'GodotPhysicsServer2D::flush_transforms': method with override specifier 'override' did not override any base class methods

Check failure on line 298 in servers/physics_2d/godot_physics_server_2d.h

View workflow job for this annotation

GitHub Actions / 🏁 Windows / Template (target=template_release)

'GodotPhysicsServer2D::flush_transforms': method with override specifier 'override' did not override any base class methods

virtual bool is_flushing_queries() const override { return flushing_queries; }

Expand Down
1 change: 1 addition & 0 deletions servers/physics_3d/godot_physics_server_3d.h
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ class GodotPhysicsServer3D : public PhysicsServer3D {
virtual void flush_queries() override;
virtual void end_sync() override;
virtual void finish() override;
virtual void flush_transforms() override;

virtual bool is_flushing_queries() const override { return flushing_queries; }

Expand Down
4 changes: 4 additions & 0 deletions servers/physics_server_3d.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
#include "core/object/gdvirtual.gen.inc"
#include "core/variant/native_ptr.h"

#include <functional>

class PhysicsDirectSpaceState3D;
template <typename T>
class TypedArray;
Expand Down Expand Up @@ -513,6 +515,7 @@ class PhysicsServer3D : public Object {

virtual void body_set_state_sync_callback(RID p_body, const Callable &p_callable) = 0;
virtual void body_set_force_integration_callback(RID p_body, const Callable &p_callable, const Variant &p_udata = Variant()) = 0;
virtual void body_set_flush_transform_callback(RID p_body, Object *p_receiver, std::function<void(PhysicsDirectBodyState3D*)> callback) = 0;

virtual void body_set_ray_pickable(RID p_body, bool p_enable) = 0;

Expand Down Expand Up @@ -799,6 +802,7 @@ class PhysicsServer3D : public Object {
virtual void flush_queries() = 0;
virtual void end_sync() = 0;
virtual void finish() = 0;
virtual void flush_transforms() = 0;

virtual bool is_flushing_queries() const = 0;

Expand Down

0 comments on commit ee0ea4c

Please sign in to comment.