Minor adjustments

This commit is contained in:
barnold1953 2014-07-08 17:15:11 -07:00
parent 87ad87e10f
commit f8fdd2d11f
2 changed files with 7 additions and 6 deletions

View file

@ -490,7 +490,7 @@ void OculusManager::renderLaserPointer() {
glm::vec3 OculusManager::getLaserPointerTipPosition(const PalmData* palm) {
#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;
#endif
return glm::vec3(0.0f);

View file

@ -274,7 +274,6 @@ QPoint ApplicationOverlay::getOculusPalmClickLocation(PalmData *palm) const {
const int widgetWidth = glWidget->width();
const int widgetHeight = glWidget->height();
glm::vec3 tip = OculusManager::getLaserPointerTipPosition(palm);
glm::vec3 eyePos = myAvatar->getHead()->calculateAverageEyePosition();
glm::quat orientation = glm::inverse(myAvatar->getOrientation());
@ -285,9 +284,11 @@ QPoint ApplicationOverlay::getOculusPalmClickLocation(PalmData *palm) const {
float t;
//Find intersection of crosshair ray
if (raySphereIntersect(dir, tipPos, 1, &t)){
glm::vec3 collisionPos = tipPos + dir * t;
//We back the ray up by dir to ensure that it will not start inside the UI.
glm::vec3 adjustedPos = tipPos - dir;
//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 v = 1.0 - (asin(collisionPos.y) / (_textureFov)+0.5f);
@ -682,7 +683,7 @@ void ApplicationOverlay::renderControllerPointersOculus() {
float t;
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 right = glm::vec3(1.0, 0.0, 0.0) * size;