mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01: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 relativeTransform(rotationBetween(Vectors::UP, _mathPick.direction), glm::vec3(1.0f), _mathPick.origin);
|
||||
Transform pickTransform = currentParentTransform.worldTransform(relativeTransform);
|
||||
return PickRay(pickTransform.getTranslation(), pickTransform.getRotation() * Vectors::UP);
|
||||
glm::vec3 origin = currentParentTransform.transform(_mathPick.origin);
|
||||
glm::vec3 direction = currentParentTransform.transformDirection(_mathPick.direction);
|
||||
return PickRay(origin, direction);
|
||||
}
|
||||
|
||||
PickResultPointer RayPick::getEntityIntersection(const PickRay& pick) {
|
||||
|
|
Loading…
Reference in a new issue