mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 18:23:54 +02:00
Comments
This commit is contained in:
parent
d2b0cdbac3
commit
90d4e7bae9
2 changed files with 8 additions and 1 deletions
|
@ -39,7 +39,7 @@ static const float MOUSE_PITCH_RANGE = 1.0f * PI;
|
|||
static const float MOUSE_YAW_RANGE = 0.5f * TWO_PI;
|
||||
|
||||
|
||||
// Return a point's coordinates on a sphere from pitch and yaw
|
||||
// Return a point's cartesian coordinates on a sphere from pitch and yaw
|
||||
glm::vec3 getPoint(float yaw, float pitch) {
|
||||
return glm::vec3(glm::cos(-pitch) * (-glm::sin(yaw)),
|
||||
glm::sin(-pitch),
|
||||
|
|
|
@ -34,6 +34,13 @@ public:
|
|||
QPoint getPalmClickLocation(const PalmData *palm) const;
|
||||
bool calculateRayUICollisionPoint(const glm::vec3& position, const glm::vec3& direction, glm::vec3& result) const;
|
||||
|
||||
// Converter from one frame of reference to another.
|
||||
// Frame of reference:
|
||||
// Screen: Position on the screen (x,y)
|
||||
// Spherical: Pitch and yaw that gives the position on the sphere we project on (yaw,pitch)
|
||||
// Overlay: Position on the overlay (x,y)
|
||||
// (x,y) in Overlay are similar than (x,y) in Screen except they can be outside of the bound of te screen.
|
||||
// This allows for picking outside of the screen projection in 3D.
|
||||
glm::vec2 screenToSpherical(glm::vec2 screenPos) const;
|
||||
glm::vec2 sphericalToScreen(glm::vec2 sphericalPos) const;
|
||||
glm::vec2 sphericalToOverlay(glm::vec2 sphericalPos) const;
|
||||
|
|
Loading…
Reference in a new issue