diff options
author | Sven Gothel <[email protected]> | 2014-03-06 23:30:03 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2014-03-06 23:30:03 +0100 |
commit | 68eb9f1ea136428b64fe9246865fbabb8c82f6ac (patch) | |
tree | 5d454b1fffd751c3299711e13fab5d9c61122d1d /src/jogl/classes/com/jogamp/opengl/math/FloatUtil.java | |
parent | 0799ac2fd303c86b09194cfcdad916cf1f94c96d (diff) |
Bug 801: AffineTransform: Remove Serializable, make methods final; FloatUtil: Add DEBUG and description about Row-Major and Column-Major Order. AABBOX: Use FloatUtil.DEBUG for mapToWindow(..)
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/math/FloatUtil.java')
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/math/FloatUtil.java | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/math/FloatUtil.java b/src/jogl/classes/com/jogamp/opengl/math/FloatUtil.java index 191a83241..d2976357d 100644 --- a/src/jogl/classes/com/jogamp/opengl/math/FloatUtil.java +++ b/src/jogl/classes/com/jogamp/opengl/math/FloatUtil.java @@ -29,23 +29,39 @@ package com.jogamp.opengl.math; import java.nio.FloatBuffer; +import jogamp.opengl.Debug; + import com.jogamp.common.os.Platform; /** * Basic Float math utility functions. * <p> * Implementation assumes linear matrix layout in column-major order - * matching OpenGL's implementation. + * matching OpenGL's implementation, translation matrix example: + * <pre> + Row-Major Order: + 1 0 0 x + 0 1 0 y + 0 0 1 z + 0 0 0 1 + * </pre> + * <pre> + Column-Major Order: + 1 0 0 0 + 0 1 0 0 + 0 0 1 0 + x y z 1 + * </pre> * </p> * <p> * Derived from ProjectFloat.java - Created 11-jan-2004 * </p> * - * @author Erik Duijs - * @author Kenneth Russell - * @author Sven Gothel + * @author Erik Duijs, Kenneth Russell, et al. */ public class FloatUtil { + public static final boolean DEBUG = Debug.debug("Math"); + private static final float[] IDENTITY_MATRIX = new float[] { 1.0f, 0.0f, 0.0f, 0.0f, @@ -558,7 +574,7 @@ public class FloatUtil { public static final float PI = 3.14159265358979323846f; - public static float abs(float a) { return (float) java.lang.Math.abs(a); } + public static float abs(float a) { return java.lang.Math.abs(a); } public static float pow(float a, float b) { return (float) java.lang.Math.pow(a, b); } |