mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 18:42:58 +02:00
temporarily disable the model aligned box picking
This commit is contained in:
parent
c3b87504d9
commit
8a4955d75b
1 changed files with 25 additions and 12 deletions
|
@ -193,6 +193,11 @@ bool ModelTreeElement::findDetailedRayIntersection(const glm::vec3& origin, cons
|
||||||
// if it's in our AABOX for our rotated extents, then check to see if it's in our non-AABox
|
// if it's in our AABOX for our rotated extents, then check to see if it's in our non-AABox
|
||||||
if (rotatedExtentsBox.findRayIntersection(origin, direction, localDistance, localFace)) {
|
if (rotatedExtentsBox.findRayIntersection(origin, direction, localDistance, localFace)) {
|
||||||
|
|
||||||
|
// This is experimental code that doesn't quite work, so I'm disabling it by default, but
|
||||||
|
// leaving it in because I need to work on it and fix it to work properly.
|
||||||
|
bool pickAgainstModelAlignedBox = false;
|
||||||
|
|
||||||
|
if (pickAgainstModelAlignedBox) {
|
||||||
// extents is the model relative, scaled, centered extents of the model
|
// extents is the model relative, scaled, centered extents of the model
|
||||||
glm::mat4 rotation = glm::mat4_cast(model.getModelRotation());
|
glm::mat4 rotation = glm::mat4_cast(model.getModelRotation());
|
||||||
glm::mat4 translation = glm::translate(model.getPosition());
|
glm::mat4 translation = glm::translate(model.getPosition());
|
||||||
|
@ -214,6 +219,14 @@ bool ModelTreeElement::findDetailedRayIntersection(const glm::vec3& origin, cons
|
||||||
somethingIntersected = true;
|
somethingIntersected = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if (localDistance < distance) {
|
||||||
|
distance = localDistance;
|
||||||
|
face = localFace;
|
||||||
|
*intersectedObject = (void*)(&model);
|
||||||
|
somethingIntersected = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (localDistance < distance) {
|
} else if (localDistance < distance) {
|
||||||
distance = localDistance;
|
distance = localDistance;
|
||||||
|
|
Loading…
Reference in a new issue