mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 15:50:37 +02:00
remove the optimization for upperId == lowerId. Doesn't work in zaru
tunnels.
This commit is contained in:
parent
1e1dd3a633
commit
1068a4a9bd
1 changed files with 20 additions and 21 deletions
|
@ -2340,8 +2340,7 @@ bool MyAvatar::requiresSafeLanding(const glm::vec3& positionIn, glm::vec3& bette
|
|||
auto delta = glm::distance(upperIntersection, lowerIntersection);
|
||||
if (delta > (2 * halfHeight)) {
|
||||
// There is room for us to fit in that clearing. If there wasn't, physics would oscilate us between the objects above and below.
|
||||
if (upperId != lowerId) { // An optimization over what follows: the simplest case of not being inside an entity.
|
||||
// We're going to iterate upwards through successive roofIntersections, testing to see if we're contained within the top surface of some entity.
|
||||
// We're now going to iterate upwards through successive upperIntersections, testing to see if we're contained within the top surface of some entity.
|
||||
// There will be one of two outcomes:
|
||||
// a) We're not contained, so we have enough room and our position is good.
|
||||
// b) We are contained, so we'll bail out of this but try again at a position above the containing entity.
|
||||
|
@ -2356,6 +2355,7 @@ bool MyAvatar::requiresSafeLanding(const glm::vec3& positionIn, glm::vec3& bette
|
|||
// This new intersection is the top surface of an entity that we have not yet seen, which means we're contained within it.
|
||||
// We could break here and recurse from the top of the original ceiling, but since we've already done the work to find the top
|
||||
// of the enclosing entity, let's put our feet at upperIntersection and start over.
|
||||
qDebug() << "FIXME inside above:" << upperId << " below:" << lowerId;
|
||||
return mustMove();
|
||||
}
|
||||
// We found a new bottom surface, which we're not interested in.
|
||||
|
@ -2363,9 +2363,8 @@ bool MyAvatar::requiresSafeLanding(const glm::vec3& positionIn, glm::vec3& bette
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//qDebug() << "FIXME need to compute safe landing for" << capsuleCenter << " based on " << upperIntersection << "@" << upperId << " and " << lowerIntersection << "@" << lowerId;
|
||||
qDebug() << "FIXME need to compute safe landing for" << capsuleCenter << " based on " << (isDown(upperNormal) ? "down " : "up ") << upperIntersection << "@" << upperId << " and " << (isUp(lowerNormal) ? "up " : "down ") << lowerIntersection << "@" << lowerId;
|
||||
const float big = (float)TREE_SCALE;
|
||||
const auto skyHigh = up * big;
|
||||
auto fromAbove = capsuleCenter + skyHigh;
|
||||
|
|
Loading…
Reference in a new issue