diff options
Diffstat (limited to 'src/jake2/util/Math3D.java')
-rw-r--r-- | src/jake2/util/Math3D.java | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/jake2/util/Math3D.java b/src/jake2/util/Math3D.java index a434a05..fcdeaee 100644 --- a/src/jake2/util/Math3D.java +++ b/src/jake2/util/Math3D.java @@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // Created on 09.12.2003 by RST. -// $Id: Math3D.java,v 1.4 2004-07-08 20:56:54 hzi Exp $ +// $Id: Math3D.java,v 1.3 2004-07-08 20:24:31 hzi Exp $ package jake2.util; @@ -459,14 +459,13 @@ public class Math3D extends Lib { float angle; float sr, sp, sy, cr, cp, cy; - cr = 2.0f * piratio; - angle = (float) (angles[Defines.YAW] * (cr)); + angle = (float) (angles[Defines.YAW] * (2.0f * piratio)); sy = (float) Math.sin(angle); cy = (float) Math.cos(angle); - angle = (float) (angles[Defines.PITCH] * (cr)); + angle = (float) (angles[Defines.PITCH] * (2.0f * piratio)); sp = (float) Math.sin(angle); cp = (float) Math.cos(angle); - angle = (float) (angles[Defines.ROLL] * (cr)); + angle = (float) (angles[Defines.ROLL] * (2.0f * piratio)); sr = (float) Math.sin(angle); cr = (float) Math.cos(angle); @@ -476,9 +475,9 @@ public class Math3D extends Lib { forward[2] = -sp; } if (right != null) { - right[0] = (-sr * sp * cy + cr * sy); - right[1] = (-sr * sp * sy + -cr * cy); - right[2] = -sr * cp; + right[0] = (-1 * sr * sp * cy + -1 * cr * -sy); + right[1] = (-1 * sr * sp * sy + -1 * cr * cy); + right[2] = -1 * sr * cp; } if (up != null) { up[0] = (cr * sp * cy + -sr * -sy); |