mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-05 06:20:03 +02:00
get transform once rather than 3 times
This commit is contained in:
parent
bddff3341a
commit
182829e64c
1 changed files with 5 additions and 2 deletions
|
@ -190,7 +190,7 @@ bool Image3DOverlay::findRayIntersection(const glm::vec3& origin, const glm::vec
|
|||
float& distance, BoxFace& face, glm::vec3& surfaceNormal) {
|
||||
if (_texture && _texture->isLoaded()) {
|
||||
// Make sure position and rotation is updated.
|
||||
Transform transform;
|
||||
Transform transform = getTransform();
|
||||
applyTransformTo(transform, true);
|
||||
setTransform(transform);
|
||||
|
||||
|
@ -202,7 +202,10 @@ bool Image3DOverlay::findRayIntersection(const glm::vec3& origin, const glm::vec
|
|||
glm::vec2 dimensions = _dimensions * glm::vec2(width / maxSize, height / maxSize);
|
||||
|
||||
// FIXME - face and surfaceNormal not being set
|
||||
return findRayRectangleIntersection(origin, direction, getRotation(), getPosition(), dimensions, distance);
|
||||
return findRayRectangleIntersection(origin, direction,
|
||||
transform.getRotation(),
|
||||
transform.getTranslation(),
|
||||
dimensions, distance);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue