mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 07:37:20 +02:00
Simplify PickRay calculations in RayPick::getMathematicalPick
This commit is contained in:
parent
9e0d35e40d
commit
bfa270375a
1 changed files with 3 additions and 3 deletions
|
@ -21,9 +21,9 @@ PickRay RayPick::getMathematicalPick() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
Transform currentParentTransform = parentTransform->getTransform();
|
Transform currentParentTransform = parentTransform->getTransform();
|
||||||
Transform relativeTransform(rotationBetween(Vectors::UP, _mathPick.direction), glm::vec3(1.0f), _mathPick.origin);
|
glm::vec3 origin = currentParentTransform.transform(_mathPick.origin);
|
||||||
Transform pickTransform = currentParentTransform.worldTransform(relativeTransform);
|
glm::vec3 direction = currentParentTransform.transformDirection(_mathPick.direction);
|
||||||
return PickRay(pickTransform.getTranslation(), pickTransform.getRotation() * Vectors::UP);
|
return PickRay(origin, direction);
|
||||||
}
|
}
|
||||||
|
|
||||||
PickResultPointer RayPick::getEntityIntersection(const PickRay& pick) {
|
PickResultPointer RayPick::getEntityIntersection(const PickRay& pick) {
|
||||||
|
|
Loading…
Reference in a new issue