mirror of
https://github.com/lubosz/overte.git
synced 2025-04-23 12:14:00 +02:00
only do collisions on entities moving toward each other
This commit is contained in:
parent
2cfa14d5ad
commit
9cc1fe35db
1 changed files with 1 additions and 1 deletions
|
@ -116,7 +116,7 @@ void EntityCollisionSystem::updateCollisionWithEntities(EntityItem* entityA) {
|
|||
glm::vec3 relativeVelocity = entityA->getVelocity() - entityB->getVelocity();
|
||||
|
||||
bool movingTowardEachOther = glm::dot(relativeVelocity, penetrationInTreeUnits) > 0.0f;
|
||||
bool doCollisions = true;
|
||||
bool doCollisions = movingTowardEachOther; // don't do collisions if the entities are moving away from each other
|
||||
|
||||
if (doCollisions) {
|
||||
quint64 now = usecTimestampNow();
|
||||
|
|
Loading…
Reference in a new issue