summaryrefslogtreecommitdiff
path: root/modules/bullet/space_bullet.h
diff options
context:
space:
mode:
Diffstat (limited to 'modules/bullet/space_bullet.h')
-rw-r--r--modules/bullet/space_bullet.h18
1 files changed, 12 insertions, 6 deletions
diff --git a/modules/bullet/space_bullet.h b/modules/bullet/space_bullet.h
index aa9a70594e..897f902fe1 100644
--- a/modules/bullet/space_bullet.h
+++ b/modules/bullet/space_bullet.h
@@ -31,8 +31,8 @@
#ifndef SPACE_BULLET_H
#define SPACE_BULLET_H
+#include "core/local_vector.h"
#include "core/variant.h"
-#include "core/vector.h"
#include "godot_result_callbacks.h"
#include "rid_bullet.h"
#include "servers/physics_server_3d.h"
@@ -110,17 +110,23 @@ class SpaceBullet : public RIDBullet {
real_t linear_damp = 0.0;
real_t angular_damp = 0.0;
- Vector<CollisionObjectBullet *> collision_objects;
- Vector<AreaBullet *> areas;
+ LocalVector<CollisionObjectBullet *> queue_pre_flush;
+ LocalVector<CollisionObjectBullet *> queue_flush;
+ LocalVector<CollisionObjectBullet *> collision_objects;
+ LocalVector<AreaBullet *> areas;
- Vector<Vector3> contactDebug;
- int contactDebugCount = 0;
+ LocalVector<Vector3> contactDebug;
+ uint32_t contactDebugCount = 0;
real_t delta_time = 0.;
public:
SpaceBullet();
virtual ~SpaceBullet();
+ void add_to_flush_queue(CollisionObjectBullet *p_co);
+ void add_to_pre_flush_queue(CollisionObjectBullet *p_co);
+ void remove_from_any_queue(CollisionObjectBullet *p_co);
+
void flush_queries();
real_t get_delta_time() { return delta_time; }
void step(real_t p_delta_time);
@@ -177,7 +183,7 @@ public:
}
_FORCE_INLINE_ void add_debug_contact(const Vector3 &p_contact) {
if (contactDebugCount < contactDebug.size()) {
- contactDebug.write[contactDebugCount++] = p_contact;
+ contactDebug[contactDebugCount++] = p_contact;
}
}
_FORCE_INLINE_ Vector<Vector3> get_debug_contacts() { return contactDebug; }