collision relative velocity is now calculated in one line

This commit is contained in:
Sara 2023-10-19 13:50:35 +02:00
parent 37b1fc3228
commit b8ae02109a

View file

@ -86,8 +86,7 @@ int _internal_collision_get_overlap(PhysicsEntity self, PhysicsEntity other, Col
RigidBody* rba = self.tc->get_rigidbody(self.data);
RigidBody* rbb = other.tc->get_rigidbody(other.data);
Vector velocity = rigidbody_get_velocity(rba);
velocity = vsubf(velocity, rigidbody_get_velocity(rbb));
Vector velocity = vsubf(rigidbody_get_velocity(rba), rigidbody_get_velocity(rbb));
*out = (Collision) {
.other = other,