aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/graph
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-04-08 18:08:56 +0200
committerSven Gothel <[email protected]>2011-04-08 18:08:56 +0200
commit547724c6790db5888bf803ec7e79b5eaa8cc1d87 (patch)
tree6d41675a8aafe6f7d2dec28ade0813f749388cc2 /src/jogl/classes/jogamp/graph
parentba47ef11171a8da45c718c89d1e962287b504e36 (diff)
parentf628fc29468b7a6b821b5a47dd93224730222dc4 (diff)
Merge remote-tracking branch 'rsantina/graph' into graph
Diffstat (limited to 'src/jogl/classes/jogamp/graph')
-rw-r--r--src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PES2.java4
-rw-r--r--src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java25
-rw-r--r--src/jogl/classes/jogamp/graph/curve/text/GlyphString.java5
3 files changed, 29 insertions, 5 deletions
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PES2.java b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PES2.java
index 17962a297..81d9d1858 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PES2.java
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PES2.java
@@ -354,4 +354,8 @@ public class VBORegion2PES2 implements Region {
public void setFlipped(boolean flipped) {
this.flipped = flipped;
}
+
+ public AABBox getBounds(){
+ return box;
+ }
}
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java
index 80bf00428..0d68be8ce 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java
@@ -34,6 +34,7 @@ import javax.media.opengl.GL2ES2;
import javax.media.opengl.GLContext;
import com.jogamp.graph.curve.Region;
+import com.jogamp.graph.geom.AABBox;
import com.jogamp.graph.geom.Vertex;
import com.jogamp.graph.geom.Triangle;
import com.jogamp.opengl.util.GLArrayDataServer;
@@ -53,11 +54,14 @@ public class VBORegionSPES2 implements Region {
private boolean flipped = false;
private boolean dirty = false;
+ private AABBox box = null;
+
public VBORegionSPES2(GLContext context){
this.context =context;
}
public void update(){
+ box = new AABBox();
GL2ES2 gl = context.getGL().getGL2ES2();
destroy(gl);
@@ -96,13 +100,21 @@ public class VBORegionSPES2 implements Region {
vertices.size(), GL.GL_STATIC_DRAW, GL.GL_ARRAY_BUFFER);
verticeAttr.setLocation(Region.VERTEX_ATTR_IDX);
for(Vertex v:vertices){
- verticeAttr.putf(v.getX());
+
if(flipped){
- verticeAttr.putf(-1*v.getY());
- } else {
- verticeAttr.putf(v.getY());
+ verticeAttr.putf(v.getX());
+ verticeAttr.putf(-1*v.getY());
+ verticeAttr.putf(v.getZ());
+
+ box.resize(v.getX(),-1*v.getY(),v.getZ());
+ }
+ else{
+ verticeAttr.putf(v.getX());
+ verticeAttr.putf(v.getY());
+ verticeAttr.putf(v.getZ());
+
+ box.resize(v.getX(),v.getY(),v.getZ());
}
- verticeAttr.putf(v.getZ());
}
verticeAttr.seal(gl, true);
@@ -187,4 +199,7 @@ public class VBORegionSPES2 implements Region {
public void setFlipped(boolean flipped) {
this.flipped = flipped;
}
+ public AABBox getBounds(){
+ return box;
+ }
}
diff --git a/src/jogl/classes/jogamp/graph/curve/text/GlyphString.java b/src/jogl/classes/jogamp/graph/curve/text/GlyphString.java
index 808e3a415..7c7bb816f 100644
--- a/src/jogl/classes/jogamp/graph/curve/text/GlyphString.java
+++ b/src/jogl/classes/jogamp/graph/curve/text/GlyphString.java
@@ -29,6 +29,7 @@ package jogamp.graph.curve.text;
import java.util.ArrayList;
+import com.jogamp.graph.geom.AABBox;
import com.jogamp.graph.geom.Vertex;
import com.jogamp.graph.geom.Triangle;
import com.jogamp.graph.geom.opengl.SVertex;
@@ -160,4 +161,8 @@ public class GlyphString {
public void destroy(){
region.destroy();
}
+
+ public AABBox getBounds(){
+ return region.getBounds();
+ }
}