Fix uninitialized members in physics query results

This commit is contained in:
PouleyKetchoupp 2021-06-07 10:40:15 -07:00
parent 5d8fe70de5
commit c6bd0fd0f7
2 changed files with 16 additions and 16 deletions

View file

@ -160,9 +160,9 @@ public:
Vector2 position; Vector2 position;
Vector2 normal; Vector2 normal;
RID rid; RID rid;
ObjectID collider_id; ObjectID collider_id = 0;
Object *collider; Object *collider = nullptr;
int shape; int shape = 0;
Variant metadata; Variant metadata;
}; };
@ -170,9 +170,9 @@ public:
struct ShapeResult { struct ShapeResult {
RID rid; RID rid;
ObjectID collider_id; ObjectID collider_id = 0;
Object *collider; Object *collider = nullptr;
int shape; int shape = 0;
Variant metadata; Variant metadata;
}; };
@ -189,8 +189,8 @@ public:
Vector2 point; Vector2 point;
Vector2 normal; Vector2 normal;
RID rid; RID rid;
ObjectID collider_id; ObjectID collider_id = 0;
int shape; int shape = 0;
Vector2 linear_velocity; //velocity at contact point Vector2 linear_velocity; //velocity at contact point
Variant metadata; Variant metadata;
}; };

View file

@ -154,9 +154,9 @@ protected:
public: public:
struct ShapeResult { struct ShapeResult {
RID rid; RID rid;
ObjectID collider_id; ObjectID collider_id = 0;
Object *collider; Object *collider = nullptr;
int shape; int shape = 0;
}; };
virtual int intersect_point(const Vector3 &p_point, ShapeResult *r_results, int p_result_max, const Set<RID> &p_exclude = Set<RID>(), uint32_t p_collision_mask = 0xFFFFFFFF, bool p_collide_with_bodies = true, bool p_collide_with_areas = false) = 0; virtual int intersect_point(const Vector3 &p_point, ShapeResult *r_results, int p_result_max, const Set<RID> &p_exclude = Set<RID>(), uint32_t p_collision_mask = 0xFFFFFFFF, bool p_collide_with_bodies = true, bool p_collide_with_areas = false) = 0;
@ -165,9 +165,9 @@ public:
Vector3 position; Vector3 position;
Vector3 normal; Vector3 normal;
RID rid; RID rid;
ObjectID collider_id; ObjectID collider_id = 0;
Object *collider; Object *collider = nullptr;
int shape; int shape = 0;
}; };
virtual bool intersect_ray(const Vector3 &p_from, const Vector3 &p_to, RayResult &r_result, const Set<RID> &p_exclude = Set<RID>(), uint32_t p_collision_mask = 0xFFFFFFFF, bool p_collide_with_bodies = true, bool p_collide_with_areas = false, bool p_pick_ray = false) = 0; virtual bool intersect_ray(const Vector3 &p_from, const Vector3 &p_to, RayResult &r_result, const Set<RID> &p_exclude = Set<RID>(), uint32_t p_collision_mask = 0xFFFFFFFF, bool p_collide_with_bodies = true, bool p_collide_with_areas = false, bool p_pick_ray = false) = 0;
@ -178,8 +178,8 @@ public:
Vector3 point; Vector3 point;
Vector3 normal; Vector3 normal;
RID rid; RID rid;
ObjectID collider_id; ObjectID collider_id = 0;
int shape; int shape = 0;
Vector3 linear_velocity; //velocity at contact point Vector3 linear_velocity; //velocity at contact point
}; };