diff options
Diffstat (limited to 'servers/physics_2d/shape_2d_sw.h')
-rw-r--r-- | servers/physics_2d/shape_2d_sw.h | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/servers/physics_2d/shape_2d_sw.h b/servers/physics_2d/shape_2d_sw.h index ecc829f962..c118826284 100644 --- a/servers/physics_2d/shape_2d_sw.h +++ b/servers/physics_2d/shape_2d_sw.h @@ -47,8 +47,8 @@ public: class Shape2DSW { RID self; Rect2 aabb; - bool configured; - real_t custom_bias; + bool configured = false; + real_t custom_bias = 0.0; Map<ShapeOwner2DSW *, int> owners; @@ -121,8 +121,7 @@ public: } } } - - Shape2DSW(); + Shape2DSW() {} virtual ~Shape2DSW(); }; @@ -144,7 +143,7 @@ public: class WorldBoundaryShape2DSW : public Shape2DSW { Vector2 normal; - real_t d; + real_t d = 0.0; public: _FORCE_INLINE_ Vector2 get_normal() const { return normal; } @@ -180,8 +179,8 @@ public: }; class SeparationRayShape2DSW : public Shape2DSW { - real_t length; - bool slide_on_slope; + real_t length = 0.0; + bool slide_on_slope = false; public: _FORCE_INLINE_ real_t get_length() const { return length; } @@ -366,8 +365,8 @@ public: }; class CapsuleShape2DSW : public Shape2DSW { - real_t radius; - real_t height; + real_t radius = 0.0; + real_t height = 0.0; public: _FORCE_INLINE_ const real_t &get_radius() const { return radius; } @@ -412,8 +411,8 @@ class ConvexPolygonShape2DSW : public Shape2DSW { Vector2 normal; //normal to next segment }; - Point *points; - int point_count; + Point *points = nullptr; + int point_count = 0; public: _FORCE_INLINE_ int get_point_count() const { return point_count; } @@ -458,7 +457,7 @@ public: DEFAULT_PROJECT_RANGE_CAST - ConvexPolygonShape2DSW(); + ConvexPolygonShape2DSW() {} ~ConvexPolygonShape2DSW(); }; @@ -474,7 +473,7 @@ public: class ConcavePolygonShape2DSW : public ConcaveShape2DSW { struct Segment { - int points[2]; + int points[2] = {}; }; Vector<Segment> segments; @@ -482,11 +481,11 @@ class ConcavePolygonShape2DSW : public ConcaveShape2DSW { struct BVH { Rect2 aabb; - int left, right; + int left = 0, right = 0; }; Vector<BVH> bvh; - int bvh_depth; + int bvh_depth = 0; struct BVH_CompareX { _FORCE_INLINE_ bool operator()(const BVH &a, const BVH &b) const { |