collision relative velocity is now calculated in one line
This commit is contained in:
parent
37b1fc3228
commit
b8ae02109a
|
@ -86,8 +86,7 @@ int _internal_collision_get_overlap(PhysicsEntity self, PhysicsEntity other, Col
|
||||||
|
|
||||||
RigidBody* rba = self.tc->get_rigidbody(self.data);
|
RigidBody* rba = self.tc->get_rigidbody(self.data);
|
||||||
RigidBody* rbb = other.tc->get_rigidbody(other.data);
|
RigidBody* rbb = other.tc->get_rigidbody(other.data);
|
||||||
Vector velocity = rigidbody_get_velocity(rba);
|
Vector velocity = vsubf(rigidbody_get_velocity(rba), rigidbody_get_velocity(rbb));
|
||||||
velocity = vsubf(velocity, rigidbody_get_velocity(rbb));
|
|
||||||
|
|
||||||
*out = (Collision) {
|
*out = (Collision) {
|
||||||
.other = other,
|
.other = other,
|
||||||
|
|
Loading…
Reference in a new issue