mirror of
https://github.com/overte-org/overte.git
synced 2025-04-29 20:22:40 +02:00
Minor adjustments
This commit is contained in:
parent
87ad87e10f
commit
f8fdd2d11f
2 changed files with 7 additions and 6 deletions
|
@ -490,7 +490,7 @@ void OculusManager::renderLaserPointer() {
|
||||||
|
|
||||||
glm::vec3 OculusManager::getLaserPointerTipPosition(const PalmData* palm) {
|
glm::vec3 OculusManager::getLaserPointerTipPosition(const PalmData* palm) {
|
||||||
#ifdef HAVE_LIBOVR
|
#ifdef HAVE_LIBOVR
|
||||||
const float PALM_TIP_ROD_LENGTH_MULT = 11.0f;
|
const float PALM_TIP_ROD_LENGTH_MULT = 4.0f;
|
||||||
return palm->getPosition() + (palm->getTipPosition() - palm->getPosition()) * PALM_TIP_ROD_LENGTH_MULT;
|
return palm->getPosition() + (palm->getTipPosition() - palm->getPosition()) * PALM_TIP_ROD_LENGTH_MULT;
|
||||||
#endif
|
#endif
|
||||||
return glm::vec3(0.0f);
|
return glm::vec3(0.0f);
|
||||||
|
|
|
@ -274,7 +274,6 @@ QPoint ApplicationOverlay::getOculusPalmClickLocation(PalmData *palm) const {
|
||||||
const int widgetWidth = glWidget->width();
|
const int widgetWidth = glWidget->width();
|
||||||
const int widgetHeight = glWidget->height();
|
const int widgetHeight = glWidget->height();
|
||||||
|
|
||||||
|
|
||||||
glm::vec3 tip = OculusManager::getLaserPointerTipPosition(palm);
|
glm::vec3 tip = OculusManager::getLaserPointerTipPosition(palm);
|
||||||
glm::vec3 eyePos = myAvatar->getHead()->calculateAverageEyePosition();
|
glm::vec3 eyePos = myAvatar->getHead()->calculateAverageEyePosition();
|
||||||
glm::quat orientation = glm::inverse(myAvatar->getOrientation());
|
glm::quat orientation = glm::inverse(myAvatar->getOrientation());
|
||||||
|
@ -285,9 +284,11 @@ QPoint ApplicationOverlay::getOculusPalmClickLocation(PalmData *palm) const {
|
||||||
|
|
||||||
float t;
|
float t;
|
||||||
|
|
||||||
//Find intersection of crosshair ray
|
//We back the ray up by dir to ensure that it will not start inside the UI.
|
||||||
if (raySphereIntersect(dir, tipPos, 1, &t)){
|
glm::vec3 adjustedPos = tipPos - dir;
|
||||||
glm::vec3 collisionPos = tipPos + dir * t;
|
//Find intersection of crosshair ray.
|
||||||
|
if (raySphereIntersect(dir, adjustedPos, 1, &t)){
|
||||||
|
glm::vec3 collisionPos = adjustedPos + dir * t;
|
||||||
|
|
||||||
float u = asin(collisionPos.x) / (_textureFov)+0.5f;
|
float u = asin(collisionPos.x) / (_textureFov)+0.5f;
|
||||||
float v = 1.0 - (asin(collisionPos.y) / (_textureFov)+0.5f);
|
float v = 1.0 - (asin(collisionPos.y) / (_textureFov)+0.5f);
|
||||||
|
@ -682,7 +683,7 @@ void ApplicationOverlay::renderControllerPointersOculus() {
|
||||||
|
|
||||||
float t;
|
float t;
|
||||||
float length = glm::length(eyePos - tip);
|
float length = glm::length(eyePos - tip);
|
||||||
float size = 0.045f * length;
|
float size = 0.03f * length;
|
||||||
|
|
||||||
glm::vec3 up = glm::vec3(0.0, 1.0, 0.0) * size;
|
glm::vec3 up = glm::vec3(0.0, 1.0, 0.0) * size;
|
||||||
glm::vec3 right = glm::vec3(1.0, 0.0, 0.0) * size;
|
glm::vec3 right = glm::vec3(1.0, 0.0, 0.0) * size;
|
||||||
|
|
Loading…
Reference in a new issue