diff options
author | Jesse Morgan <jesse@jesterpm.net> | 2011-03-08 06:47:23 +0000 |
---|---|---|
committer | Jesse Morgan <jesse@jesterpm.net> | 2011-03-08 06:47:23 +0000 |
commit | ea77597522daca504f092b43b9327a4eccef9957 (patch) | |
tree | 437b01fe2839cdb462342c0b69cc1d228c10db69 | |
parent | 6cd8a65423b94f8f074ee3db4500e98ee8633017 (diff) |
So steve votes we keep this.
-rw-r--r-- | src/tesseract/objects/PhysicalObject.java | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/tesseract/objects/PhysicalObject.java b/src/tesseract/objects/PhysicalObject.java index 43990f4..44df645 100644 --- a/src/tesseract/objects/PhysicalObject.java +++ b/src/tesseract/objects/PhysicalObject.java @@ -134,12 +134,10 @@ public class PhysicalObject extends CollidableObject { * Move the object to the correct side of the new world. */ public void rotateForTransmission(PeerInformation a, PeerInformation b) { - Vector3f velnormal = new Vector3f(velocity); - velnormal.normalize(); - velnormal.negate(); + double angle = Math.PI + Math.atan((b.location.getY() - a.location.getY()) / (b.location.getX() - a.location.getX())); - position.x = velnormal.x * position.x; - position.z = velnormal.z * -position.z; + position.x = (float) (position.x * Math.cos(angle) - position.z * Math.sin(angle)); + position.z = (float) (position.x * Math.sin(angle) + position.z * Math.cos(angle)); } /** |