diff options
Diffstat (limited to 'modules/bullet/godot_result_callbacks.h')
-rw-r--r-- | modules/bullet/godot_result_callbacks.h | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/modules/bullet/godot_result_callbacks.h b/modules/bullet/godot_result_callbacks.h index 4f40f7ecfd..96a649d77a 100644 --- a/modules/bullet/godot_result_callbacks.h +++ b/modules/bullet/godot_result_callbacks.h @@ -47,8 +47,6 @@ bool godotContactAddedCallback(btManifoldPoint &cp, const btCollisionObjectWrapp /// This class is required to implement custom collision behaviour in the broadphase struct GodotFilterCallback : public btOverlapFilterCallback { - static bool test_collision_filters(uint32_t body0_collision_layer, uint32_t body0_collision_mask, uint32_t body1_collision_layer, uint32_t body1_collision_mask); - // return true when pairs need collision virtual bool needBroadphaseCollision(btBroadphaseProxy *proxy0, btBroadphaseProxy *proxy1) const; }; @@ -59,8 +57,8 @@ struct GodotClosestRayResultCallback : public btCollisionWorld::ClosestRayResult bool m_pickRay = false; int m_shapeId = 0; - bool collide_with_bodies; - bool collide_with_areas; + bool collide_with_bodies = false; + bool collide_with_areas = false; public: GodotClosestRayResultCallback(const btVector3 &rayFromWorld, const btVector3 &rayToWorld, const Set<RID> *p_exclude, bool p_collide_with_bodies, bool p_collide_with_areas) : @@ -84,8 +82,8 @@ public: // store all colliding object struct GodotAllConvexResultCallback : public btCollisionWorld::ConvexResultCallback { public: - PhysicsDirectSpaceState3D::ShapeResult *m_results; - int m_resultMax; + PhysicsDirectSpaceState3D::ShapeResult *m_results = nullptr; + int m_resultMax = 0; const Set<RID> *m_exclude; int count = 0; @@ -102,11 +100,13 @@ public: struct GodotKinClosestConvexResultCallback : public btCollisionWorld::ClosestConvexResultCallback { public: const RigidBodyBullet *m_self_object; + const Set<RID> *m_exclude; const bool m_infinite_inertia; - GodotKinClosestConvexResultCallback(const btVector3 &convexFromWorld, const btVector3 &convexToWorld, const RigidBodyBullet *p_self_object, bool p_infinite_inertia) : + GodotKinClosestConvexResultCallback(const btVector3 &convexFromWorld, const btVector3 &convexToWorld, const RigidBodyBullet *p_self_object, bool p_infinite_inertia, const Set<RID> *p_exclude) : btCollisionWorld::ClosestConvexResultCallback(convexFromWorld, convexToWorld), m_self_object(p_self_object), + m_exclude(p_exclude), m_infinite_inertia(p_infinite_inertia) {} virtual bool needsCollision(btBroadphaseProxy *proxy0) const; @@ -117,8 +117,8 @@ public: const Set<RID> *m_exclude; int m_shapeId = 0; - bool collide_with_bodies; - bool collide_with_areas; + bool collide_with_bodies = false; + bool collide_with_areas = false; GodotClosestConvexResultCallback(const btVector3 &convexFromWorld, const btVector3 &convexToWorld, const Set<RID> *p_exclude, bool p_collide_with_bodies, bool p_collide_with_areas) : btCollisionWorld::ClosestConvexResultCallback(convexFromWorld, convexToWorld), @@ -134,13 +134,13 @@ public: struct GodotAllContactResultCallback : public btCollisionWorld::ContactResultCallback { public: const btCollisionObject *m_self_object; - PhysicsDirectSpaceState3D::ShapeResult *m_results; - int m_resultMax; + PhysicsDirectSpaceState3D::ShapeResult *m_results = nullptr; + int m_resultMax = 0; const Set<RID> *m_exclude; int m_count = 0; - bool collide_with_bodies; - bool collide_with_areas; + bool collide_with_bodies = false; + bool collide_with_areas = false; GodotAllContactResultCallback(btCollisionObject *p_self_object, PhysicsDirectSpaceState3D::ShapeResult *p_results, int p_resultMax, const Set<RID> *p_exclude, bool p_collide_with_bodies, bool p_collide_with_areas) : m_self_object(p_self_object), @@ -159,13 +159,13 @@ public: struct GodotContactPairContactResultCallback : public btCollisionWorld::ContactResultCallback { public: const btCollisionObject *m_self_object; - Vector3 *m_results; - int m_resultMax; + Vector3 *m_results = nullptr; + int m_resultMax = 0; const Set<RID> *m_exclude; int m_count = 0; - bool collide_with_bodies; - bool collide_with_areas; + bool collide_with_bodies = false; + bool collide_with_areas = false; GodotContactPairContactResultCallback(btCollisionObject *p_self_object, Vector3 *p_results, int p_resultMax, const Set<RID> *p_exclude, bool p_collide_with_bodies, bool p_collide_with_areas) : m_self_object(p_self_object), @@ -183,14 +183,14 @@ public: struct GodotRestInfoContactResultCallback : public btCollisionWorld::ContactResultCallback { public: const btCollisionObject *m_self_object; - PhysicsDirectSpaceState3D::ShapeRestInfo *m_result; + PhysicsDirectSpaceState3D::ShapeRestInfo *m_result = nullptr; const Set<RID> *m_exclude; bool m_collided = false; - real_t m_min_distance = 0; - const btCollisionObject *m_rest_info_collision_object; + real_t m_min_distance = 0.0; + const btCollisionObject *m_rest_info_collision_object = nullptr; btVector3 m_rest_info_bt_point; - bool collide_with_bodies; - bool collide_with_areas; + bool collide_with_bodies = false; + bool collide_with_areas = false; GodotRestInfoContactResultCallback(btCollisionObject *p_self_object, PhysicsDirectSpaceState3D::ShapeRestInfo *p_result, const Set<RID> *p_exclude, bool p_collide_with_bodies, bool p_collide_with_areas) : m_self_object(p_self_object), |