diff options
author | qarmin <mikrutrafal@protonmail.com> | 2021-09-14 11:01:49 +0200 |
---|---|---|
committer | RafaĆ Mikrut <mikrutrafal@protonmail.com> | 2021-09-15 19:41:32 +0200 |
commit | 91257c39000517dd5644caf0e02a7bc6cd4574a9 (patch) | |
tree | bda41f7f6f95f48a9e8a4f1df794e48c767eded3 /servers/physics_3d/collision_solver_3d_sat.cpp | |
parent | 7b21b1bb608909b373237d19467c6236537b8062 (diff) |
Initialize variables in servers/physics
Diffstat (limited to 'servers/physics_3d/collision_solver_3d_sat.cpp')
-rw-r--r-- | servers/physics_3d/collision_solver_3d_sat.cpp | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/servers/physics_3d/collision_solver_3d_sat.cpp b/servers/physics_3d/collision_solver_3d_sat.cpp index de81348b4e..ed0b53188d 100644 --- a/servers/physics_3d/collision_solver_3d_sat.cpp +++ b/servers/physics_3d/collision_solver_3d_sat.cpp @@ -66,11 +66,11 @@ struct _CollectorCallback { CollisionSolver3DSW::CallbackResult callback; - void *userdata; - bool swap; - bool collided; + void *userdata = nullptr; + bool swap = false; + bool collided = false; Vector3 normal; - Vector3 *prev_axis; + Vector3 *prev_axis = nullptr; _FORCE_INLINE_ void call(const Vector3 &p_point_A, const Vector3 &p_point_B) { if (swap) { @@ -606,15 +606,15 @@ static void _generate_contacts_from_supports(const Vector3 *p_points_A, int p_po template <class ShapeA, class ShapeB, bool withMargin = false> class SeparatorAxisTest { - const ShapeA *shape_A; - const ShapeB *shape_B; - const Transform3D *transform_A; - const Transform3D *transform_B; - real_t best_depth; + const ShapeA *shape_A = nullptr; + const ShapeB *shape_B = nullptr; + const Transform3D *transform_A = nullptr; + const Transform3D *transform_B = nullptr; + real_t best_depth = 1e15; Vector3 best_axis; - _CollectorCallback *callback; - real_t margin_A; - real_t margin_B; + _CollectorCallback *callback = nullptr; + real_t margin_A = 0.0; + real_t margin_B = 0.0; Vector3 separator_axis; public: @@ -749,7 +749,6 @@ public: } _FORCE_INLINE_ SeparatorAxisTest(const ShapeA *p_shape_A, const Transform3D &p_transform_A, const ShapeB *p_shape_B, const Transform3D &p_transform_B, _CollectorCallback *p_callback, real_t p_margin_A = 0, real_t p_margin_B = 0) { - best_depth = 1e15; shape_A = p_shape_A; shape_B = p_shape_B; transform_A = &p_transform_A; |