Showing the changes to libraries/entities/src/EntityCollisionSystem.cpp (1 of 1 file). Show all
Unified · Split
| @@ -115,6 +115,11 @@ void EntityCollisionSystem::updateCollisionWithEntities(EntityItem* entityA) { · 114 unmodified lines | ||
| 115 | 115 | return; // bail early if this entity is to be ignored... |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | + // don't collide entities with unknown IDs, | |
| 119 | + if (!entityA->isKnownID()) { | |
| 120 | + return; | |
| 121 | + } | |
| 122 | + | |
| 118 | 123 | glm::vec3 penetration; |
| 119 | 124 | EntityItem* entityB = NULL; |
| 120 | 125 | |
| @@ -133,6 +138,11 @@ void EntityCollisionSystem::updateCollisionWithEntities(EntityItem* entityA) { · 12 unmodified lines | ||
| 133 | 138 | penetration = collision->_penetration; |
| 134 | 139 | entityB = static_cast<EntityItem*>(collision->_extraData); |
| 135 | 140 | |
| 141 | + // don't collide entities with unknown IDs, | |
| 142 | + if (!entityB->isKnownID()) { | |
| 143 | + continue; // skip this loop pass if the entity has an unknown ID | |
| 144 | + } | |
| 145 | + | |
| 136 | 146 | // NOTE: 'penetration' is the depth that 'entityA' overlaps 'entityB'. It points from A into B. |
| 137 | 147 | glm::vec3 penetrationInTreeUnits = penetration / (float)(TREE_SCALE); |
| 138 | 148 | |
| @@ -267,6 +277,12 @@ void EntityCollisionSystem::updateCollisionWithAvatars(EntityItem* entity) { · 128 unmodified lines | ||
| 267 | 277 | } |
| 268 | 278 | |
| 269 | 279 | void EntityCollisionSystem::applyHardCollision(EntityItem* entity, const CollisionInfo& collisionInfo) { |
| 280 | + | |
| 281 | + // don't collide entities with unknown IDs, | |
| 282 | + if (!entity->isKnownID()) { | |
| 283 | + return; | |
| 284 | + } | |
| 285 | + | |
| 270 | 286 | // HALTING_* params are determined using expected acceleration of gravity over some timescale. |
| 271 | 287 | // This is a HACK for entities that bounce in a 1.0 gravitational field and should eventually be made more universal. |
| 272 | 288 | const float HALTING_ENTITY_PERIOD = 0.0167f; // ~1/60th of a second |