History

also honor ignore collisions for voxels and avatars

ZappoMan committed 12 years ago

Commit 7bea4b31 parent bbd476d1 file · +9 −0Browse files

Showing the changes to libraries/entities/src/EntityCollisionSystem.cpp (1 of 1 file). Show all

Unified · Split

libraries/entities/src/EntityCollisionSystem.cpp+9−0
@@ -78,6 +78,11 @@ void EntityCollisionSystem::emitGlobalEntityCollisionWithEntity(EntityItem* enti · 77 unmodified lines
7878 }
7979
8080 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+
8186 glm::vec3 center = entity->getPosition() * (float)(TREE_SCALE);
8287 float radius = entity->getRadius() * (float)(TREE_SCALE);
8388 const float ELASTICITY = 0.4f;
@@ -220,6 +225,10 @@ void EntityCollisionSystem::updateCollisionWithAvatars(EntityItem* entity) { · 136 unmodified lines
220225 return;
221226 }
222227
228+ if (entity->getIgnoreForCollisions() || !entity->getCollisionsWillMove()) {
229+ return; // bail early if this entity is to be ignored or wont move
230+ }
231+
223232 glm::vec3 center = entity->getPosition() * (float)(TREE_SCALE);
224233 float radius = entity->getRadius() * (float)(TREE_SCALE);
225234 const float ELASTICITY = 0.9f;