mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-07-16 20:46:16 +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();
|
glm::vec3 relativeVelocity = entityA->getVelocity() - entityB->getVelocity();
|
||||||
|
|
||||||
bool movingTowardEachOther = glm::dot(relativeVelocity, penetrationInTreeUnits) > 0.0f;
|
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) {
|
if (doCollisions) {
|
||||||
quint64 now = usecTimestampNow();
|
quint64 now = usecTimestampNow();
|
||||||
|
|
Loading…
Reference in a new issue