mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 16:36:54 +02:00
Merge pull request #3561 from ZappoMan/master
don't collide with entities with unknown IDs
This commit is contained in:
commit
b5b7cdbc71
1 changed files with 16 additions and 0 deletions
|
@ -115,6 +115,11 @@ void EntityCollisionSystem::updateCollisionWithEntities(EntityItem* entityA) {
|
||||||
return; // bail early if this entity is to be ignored...
|
return; // bail early if this entity is to be ignored...
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// don't collide entities with unknown IDs,
|
||||||
|
if (!entityA->isKnownID()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
glm::vec3 penetration;
|
glm::vec3 penetration;
|
||||||
EntityItem* entityB = NULL;
|
EntityItem* entityB = NULL;
|
||||||
|
|
||||||
|
@ -133,6 +138,11 @@ void EntityCollisionSystem::updateCollisionWithEntities(EntityItem* entityA) {
|
||||||
penetration = collision->_penetration;
|
penetration = collision->_penetration;
|
||||||
entityB = static_cast<EntityItem*>(collision->_extraData);
|
entityB = static_cast<EntityItem*>(collision->_extraData);
|
||||||
|
|
||||||
|
// don't collide entities with unknown IDs,
|
||||||
|
if (!entityB->isKnownID()) {
|
||||||
|
continue; // skip this loop pass if the entity has an unknown ID
|
||||||
|
}
|
||||||
|
|
||||||
// NOTE: 'penetration' is the depth that 'entityA' overlaps 'entityB'. It points from A into B.
|
// NOTE: 'penetration' is the depth that 'entityA' overlaps 'entityB'. It points from A into B.
|
||||||
glm::vec3 penetrationInTreeUnits = penetration / (float)(TREE_SCALE);
|
glm::vec3 penetrationInTreeUnits = penetration / (float)(TREE_SCALE);
|
||||||
|
|
||||||
|
@ -267,6 +277,12 @@ void EntityCollisionSystem::updateCollisionWithAvatars(EntityItem* entity) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void EntityCollisionSystem::applyHardCollision(EntityItem* entity, const CollisionInfo& collisionInfo) {
|
void EntityCollisionSystem::applyHardCollision(EntityItem* entity, const CollisionInfo& collisionInfo) {
|
||||||
|
|
||||||
|
// don't collide entities with unknown IDs,
|
||||||
|
if (!entity->isKnownID()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// HALTING_* params are determined using expected acceleration of gravity over some timescale.
|
// HALTING_* params are determined using expected acceleration of gravity over some timescale.
|
||||||
// This is a HACK for entities that bounce in a 1.0 gravitational field and should eventually be made more universal.
|
// This is a HACK for entities that bounce in a 1.0 gravitational field and should eventually be made more universal.
|
||||||
const float HALTING_ENTITY_PERIOD = 0.0167f; // ~1/60th of a second
|
const float HALTING_ENTITY_PERIOD = 0.0167f; // ~1/60th of a second
|
||||||
|
|
Loading…
Reference in a new issue