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
78}78}
79 79
80void EntityCollisionSystem::updateCollisionWithVoxels(EntityItem* entity) {80void 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;