Showing the changes to libraries/entities/src/EntityCollisionSystem.cpp (1 of 1 file). Show all
Unified · Split
| @@ -116,7 +116,7 @@ void EntityCollisionSystem::updateCollisionWithEntities(EntityItem* entityA) { · 115 unmodified lines | ||
| 116 | 116 | glm::vec3 relativeVelocity = entityA->getVelocity() - entityB->getVelocity(); |
| 117 | 117 | |
| 118 | 118 | bool movingTowardEachOther = glm::dot(relativeVelocity, penetrationInTreeUnits) > 0.0f; |
| 119 | − bool doCollisions = true; | |
| 119 | + bool doCollisions = movingTowardEachOther; // don't do collisions if the entities are moving away from each other | |
| 120 | 120 | |
| 121 | 121 | if (doCollisions) { |
| 122 | 122 | quint64 now = usecTimestampNow(); |