1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-28 16:07:14 +00:00

ObjectID converted to a structure, fixes many bugs where used incorrectly as 32 bits.

This commit is contained in:
Juan Linietsky
2020-02-12 14:24:06 -03:00
parent 4aa31a2851
commit cf8c679a23
89 changed files with 337 additions and 287 deletions

View File

@@ -80,7 +80,7 @@ int PhysicsDirectSpaceStateSW::intersect_point(const Vector3 &p_point, ShapeResu
continue;
r_results[cc].collider_id = col_obj->get_instance_id();
if (r_results[cc].collider_id != 0)
if (r_results[cc].collider_id.is_valid())
r_results[cc].collider = ObjectDB::get_instance(r_results[cc].collider_id);
else
r_results[cc].collider = NULL;
@@ -159,7 +159,7 @@ bool PhysicsDirectSpaceStateSW::intersect_ray(const Vector3 &p_from, const Vecto
return false;
r_result.collider_id = res_obj->get_instance_id();
if (r_result.collider_id != 0)
if (r_result.collider_id.is_valid())
r_result.collider = ObjectDB::get_instance(r_result.collider_id);
else
r_result.collider = NULL;
@@ -208,7 +208,7 @@ int PhysicsDirectSpaceStateSW::intersect_shape(const RID &p_shape, const Transfo
if (r_results) {
r_results[cc].collider_id = col_obj->get_instance_id();
if (r_results[cc].collider_id != 0)
if (r_results[cc].collider_id.is_valid())
r_results[cc].collider = ObjectDB::get_instance(r_results[cc].collider_id);
else
r_results[cc].collider = NULL;
@@ -705,7 +705,7 @@ bool SpaceSW::test_body_motion(BodySW *p_body, const Transform &p_from, const Ve
//but is it right? who knows at this point..
if (r_result) {
r_result->collider_id = 0;
r_result->collider_id = ObjectID();
r_result->collider_shape = 0;
}
AABB body_aabb;