diff options
author | Sven Gothel <[email protected]> | 2011-05-06 14:39:17 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-05-06 14:39:17 +0200 |
commit | d75835796900cac602f7e5789601ffba0a27efe2 (patch) | |
tree | 4331f4fa053f2f2ea02eee4c1974d7ea71689be0 /src/jogl/classes/com/jogamp/graph/math | |
parent | 59aa8737528743b83cf56b804c9d713bc325c97c (diff) |
Graph: More std. functionality (equals, clone) / Better in-place transformation (cubic -> quadratic)
Impl. more of John Pritchard <[email protected]> proposal
https://github.com/syntelos/jogl/commit/05a7ec92d30e1e688b1eb7cc317cad83a0e8fd60
+++
More std. functionality (equals, deep clone) of AABBox, Vertex, Outline and OutlineShape.
Simplify Vertex:
- Remove 2 component constructor
- Add on-curve in Vertex.Factory / Constructor
- Adding equals(Object)
- Remove Comparable/compareTo, since we only can make an equals statement
Outline/OutlineShape: Handle dirty flag for boundary (new set/remove operation)
OutlineShape: Better in-place transformation (cubic -> quadratic)
Diffstat (limited to 'src/jogl/classes/com/jogamp/graph/math')
-rwxr-xr-x | src/jogl/classes/com/jogamp/graph/math/VectorUtil.java | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/jogl/classes/com/jogamp/graph/math/VectorUtil.java b/src/jogl/classes/com/jogamp/graph/math/VectorUtil.java index 7cbb742e5..afab69f79 100755 --- a/src/jogl/classes/com/jogamp/graph/math/VectorUtil.java +++ b/src/jogl/classes/com/jogamp/graph/math/VectorUtil.java @@ -197,9 +197,22 @@ public class VectorUtil { */
public static boolean checkEquality(float[] v1, float[] v2)
{
- if(Float.compare(v1[0], v2[0]) == 0
- && Float.compare(v1[1] , v2[1]) == 0
- && Float.compare(v1[2], v2[2]) == 0 )
+ if(Float.compare(v1[0], v2[0]) == 0 &&
+ Float.compare(v1[1], v2[1]) == 0 &&
+ Float.compare(v1[2], v2[2]) == 0 )
+ return true;
+ return false;
+ }
+
+ /**Check equality of 2 vec2 vectors
+ * @param v1 vertex 1
+ * @param v2 vertex 2
+ * @return
+ */
+ public static boolean checkEqualityVec2(float[] v1, float[] v2)
+ {
+ if(Float.compare(v1[0], v2[0]) == 0 &&
+ Float.compare(v1[1], v2[1]) == 0)
return true;
return false;
}
|