mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 00:17:25 +02:00
move depth filtering closer to source
This commit is contained in:
parent
b5537304a3
commit
aa8e7d27db
2 changed files with 4 additions and 6 deletions
|
@ -1035,11 +1035,6 @@ void EntityTreeRenderer::entityCollisionWithEntity(const EntityItemID& idA, cons
|
||||||
if (!_tree || _shuttingDown) {
|
if (!_tree || _shuttingDown) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Don't respond to small continuous contacts.
|
|
||||||
const float COLLISION_MINUMUM_PENETRATION = 0.002f;
|
|
||||||
if ((collision.type == CONTACT_EVENT_TYPE_CONTINUE) && (glm::length(collision.penetration) < COLLISION_MINUMUM_PENETRATION)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
EntityTreePointer entityTree = std::static_pointer_cast<EntityTree>(_tree);
|
EntityTreePointer entityTree = std::static_pointer_cast<EntityTree>(_tree);
|
||||||
const QUuid& myNodeID = DependencyManager::get<NodeList>()->getSessionUUID();
|
const QUuid& myNodeID = DependencyManager::get<NodeList>()->getSessionUUID();
|
||||||
|
|
|
@ -401,7 +401,10 @@ const CollisionEvents& PhysicsEngine::getCollisionEvents() {
|
||||||
while (contactItr != _contactMap.end()) {
|
while (contactItr != _contactMap.end()) {
|
||||||
ContactInfo& contact = contactItr->second;
|
ContactInfo& contact = contactItr->second;
|
||||||
ContactEventType type = contact.computeType(_numContactFrames);
|
ContactEventType type = contact.computeType(_numContactFrames);
|
||||||
if (type != CONTACT_EVENT_TYPE_CONTINUE || contact.readyForContinue(_numContactFrames)) {
|
const btScalar SIGNIFICANT_DEPTH = -0.002f; // penetrations have negative distance
|
||||||
|
if (type != CONTACT_EVENT_TYPE_CONTINUE ||
|
||||||
|
(contact.distance < SIGNIFICANT_DEPTH &&
|
||||||
|
contact.readyForContinue(_numContactFrames))) {
|
||||||
ObjectMotionState* motionStateA = static_cast<ObjectMotionState*>(contactItr->first._a);
|
ObjectMotionState* motionStateA = static_cast<ObjectMotionState*>(contactItr->first._a);
|
||||||
ObjectMotionState* motionStateB = static_cast<ObjectMotionState*>(contactItr->first._b);
|
ObjectMotionState* motionStateB = static_cast<ObjectMotionState*>(contactItr->first._b);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue