Showing the changes to libraries/entities/src/EntityCollisionSystem.cpp (1 of 1 file). Show all
Unified · Split
| @@ -78,6 +78,11 @@ void EntityCollisionSystem::emitGlobalEntityCollisionWithEntity(EntityItem* enti · 77 unmodified lines | |||
| 78 | } | 78 | } |
| 79 | 79 | ||
| 80 | void EntityCollisionSystem::updateCollisionWithVoxels(EntityItem* entity) { | 80 | void EntityCollisionSystem::updateCollisionWithVoxels(EntityItem* entity) { |
| 81 | |||
| 82 | if (entity->getIgnoreForCollisions() || !entity->getCollisionsWillMove()) { | ||
| 83 | return; // bail early if this entity is to be ignored or wont move | ||
| 84 | } | ||
| 85 | |||
| 81 | glm::vec3 center = entity->getPosition() * (float)(TREE_SCALE); | 86 | glm::vec3 center = entity->getPosition() * (float)(TREE_SCALE); |
| 82 | float radius = entity->getRadius() * (float)(TREE_SCALE); | 87 | float radius = entity->getRadius() * (float)(TREE_SCALE); |
| 83 | const float ELASTICITY = 0.4f; | 88 | const float ELASTICITY = 0.4f; |
| @@ -220,6 +225,10 @@ void EntityCollisionSystem::updateCollisionWithAvatars(EntityItem* entity) { · 136 unmodified lines | |||
| 220 | return; | 225 | return; |
| 221 | } | 226 | } |
| 222 | 227 | ||
| 228 | if (entity->getIgnoreForCollisions() || !entity->getCollisionsWillMove()) { | ||
| 229 | return; // bail early if this entity is to be ignored or wont move | ||
| 230 | } | ||
| 231 | |||
| 223 | glm::vec3 center = entity->getPosition() * (float)(TREE_SCALE); | 232 | glm::vec3 center = entity->getPosition() * (float)(TREE_SCALE); |
| 224 | float radius = entity->getRadius() * (float)(TREE_SCALE); | 233 | float radius = entity->getRadius() * (float)(TREE_SCALE); |
| 225 | const float ELASTICITY = 0.9f; | 234 | const float ELASTICITY = 0.9f; |