History

Made it so you can only select in a 180 degree radius with oculus

barnold1953 committed 12 years ago

Commit d044af11 parent b5a9f502 files · +11 −6Browse files

Showing the changes to interface/src/ui/ApplicationOverlay.cpp (1 of 2 files). Show all

Unified · Split

interface/src/ui/ApplicationOverlay.cpp+10−4
@@ -290,12 +290,18 @@ QPoint ApplicationOverlay::getOculusPalmClickLocation(PalmData *palm) const { · 289 unmodified lines
290290 if (raySphereIntersect(dir, adjustedPos, 1, &t)){
291291 glm::vec3 collisionPos = adjustedPos + dir * t;
292292
293− float u = asin(collisionPos.x) / (_textureFov)+0.5f;
294− float v = 1.0 - (asin(collisionPos.y) / (_textureFov)+0.5f);
293+ //If we hit the back hemisphere, mark it as not a collision
294+ if (collisionPos.z > 0) {
295+ rv.setX(INT_MAX);
296+ rv.setY(INT_MAX);
297+ } else {
295298
296− rv.setX(u * glWidget->width());
297− rv.setY(v * glWidget->height());
299+ float u = asin(collisionPos.x) / (_textureFov)+0.5f;
300+ float v = 1.0 - (asin(collisionPos.y) / (_textureFov)+0.5f);
298301
302+ rv.setX(u * glWidget->width());
303+ rv.setY(v * glWidget->height());
304+ }
299305 } else {
300306 //if they did not click on the overlay, just set the coords to INT_MAX
301307 rv.setX(INT_MAX);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t