summaryrefslogtreecommitdiff
path: root/src/Camera.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/Camera.java')
-rw-r--r--src/Camera.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Camera.java b/src/Camera.java
index d2e4c4f..b519345 100644
--- a/src/Camera.java
+++ b/src/Camera.java
@@ -16,7 +16,7 @@ class Camera {
/** The up vector. */
public Vector up = Vector.Z;
-
+
/** Race track used. */
private RaceTrack track;
@@ -113,7 +113,7 @@ class Camera {
/* look in the direction where the robots walks, namely the tangent
Add the actual robot position to the tangent vector, and calculate
the normal vector based on the resulting vector. This is the up vector. */
- Vector robotPos = track.getPointForLane(focus.getTimePos(),
+ Vector robotPos = track.getPointForLane(focus.getTimePos(),
focus.getLane());
Vector robotTangent = track.getTangent(focus.getTimePos());
Vector totalVector = robotTangent.add(robotPos);
@@ -160,17 +160,17 @@ class Camera {
// trivial: looks from the robot POV.
eye = track.getPointForLane(focus.getTimePos(), focus.getLane());
// robots are two meter, look from head.
- eye.add(new Vector(0, 0, 3f));
+ eye = eye.add(new Vector(0, 0, 2f));
// The question is similar to question 2b of the intermediate test
// http://www.win.tue.nl/~vanwijk/2IV60/2IV60_test_exam_161213_answers.pdf
// C(t) = E(t) + P'(t) (P'(t) is the tangent vector).
Vector robotTangent = track.getTangent(focus.getTimePos());
- Vector robotPos = track.getPointForLane(focus.getTimePos(),
+ Vector robotPos = track.getPointForLane(focus.getTimePos(),
focus.getLane());
-
+
Vector centerPoint = robotPos.add(robotTangent);
-
+
center = new Vector(-centerPoint.y(), centerPoint.x(), 3f);
// trivial: look forward, so up vector points up.