summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Lange <klange@ogunderground.com>2008-02-02 21:02:57 -0500
committerKevin Lange <klange@ogunderground.com>2008-02-02 21:02:57 -0500
commitaced1eef9902ddab3b14aed5f820cb49ca3ab31e (patch)
tree4e9433dbedbe11db8133a95b5096f8ed3b104cef
parentff424128066296021dc446e7ca09e36454e60ac2 (diff)
downloadwiitrack-aced1eef9902ddab3b14aed5f820cb49ca3ab31e.tar.gz
wiitrack-aced1eef9902ddab3b14aed5f820cb49ca3ab31e.tar.bz2
Fix some tracking things
-rw-r--r--wiitrack.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/wiitrack.c b/wiitrack.c
index 33c65ae..28d0f23 100644
--- a/wiitrack.c
+++ b/wiitrack.c
@@ -273,13 +273,13 @@ static void WTLeeTrackPosition (CompScreen *s, float x1, float y1,
float pointDist = (float)sqrt(dx * dx + dy * dy);
float angle = radPerPix * pointDist / 2.0;
// Set the head distance in units of screen size
- wts->head.z = ((float)wiitrackGetBarWidth (s) / 10.0) / (float)tan(angle);
+ wts->head.z = -((float)wiitrackGetBarWidth (s) / 10.0) / (float)tan(angle);
float aX = (x1 + x2) / 2.0f, aY = (y1 + y2) / 2.0f;
// Set the head position horizontally
wts->head.x = (float)sin(radPerPix * (aX - 512.0)) * wts->head.z;
float relAng = (aY - 384.0) * radPerPix;
// Set the head height
- wts->head.y = -0.5f + (float)sin((float)wiitrackGetWiimoteVerticalAngle (s) / 100.0 * relAng) * wts->head.z;
+ wts->head.y = -0.5f + (float)sin((float)wiitrackGetWiimoteVerticalAngle (s) / 100.0 + relAng) * wts->head.z;
// And adjust it to suit our needs
wts->head.y = wts->head.y + (float)wiitrackGetWiimoteAdjust (s) / 100.0;
// And if our Wiimote is above our screen, adjust appropriately