moved "no collision" in _internal_collision_get_overlap
This commit is contained in:
parent
46602abbae
commit
3e6ee52d3e
|
@ -79,16 +79,14 @@ int _internal_collision_get_overlap(PhysicsEntity self, PhysicsEntity other, Col
|
|||
// the smallest escape vector on this axis
|
||||
Vector escape = _internal_collision_overlap_on_axis(self, other, vnormalizedf(normal), &overlap_point);
|
||||
float sqr_mag = vsqrmagnitudef(escape);
|
||||
if(sqr_mag == 0) {
|
||||
return 0;
|
||||
}
|
||||
if(sqr_mag < shortest_sqrmag) {
|
||||
shortest_sqrmag = sqr_mag;
|
||||
shortest_escape = escape;
|
||||
shortest_escape_edge = point_index;
|
||||
}
|
||||
|
||||
if(sqr_mag == 0) {
|
||||
out->penetration_vector = InfinityVector;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
RigidBody* rba = self.tc->get_rigidbody(self.data);
|
||||
|
|
Loading…
Reference in a new issue