diff options
author | Sven Gothel <[email protected]> | 2011-04-08 18:08:56 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-04-08 18:08:56 +0200 |
commit | 547724c6790db5888bf803ec7e79b5eaa8cc1d87 (patch) | |
tree | 6d41675a8aafe6f7d2dec28ade0813f749388cc2 /src/jogl/classes/jogamp/graph/curve | |
parent | ba47ef11171a8da45c718c89d1e962287b504e36 (diff) | |
parent | f628fc29468b7a6b821b5a47dd93224730222dc4 (diff) |
Merge remote-tracking branch 'rsantina/graph' into graph
Diffstat (limited to 'src/jogl/classes/jogamp/graph/curve')
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(); + } } |