JOGL v2.6.0-rc-20250712
JOGL, High-Performance Graphics Binding for Java™ (public API).
Button.java
Go to the documentation of this file.
1/**
2 * Copyright 2010-2023 JogAmp Community. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without modification, are
5 * permitted provided that the following conditions are met:
6 *
7 * 1. Redistributions of source code must retain the above copyright notice, this list of
8 * conditions and the following disclaimer.
9 *
10 * 2. Redistributions in binary form must reproduce the above copyright notice, this list
11 * of conditions and the following disclaimer in the documentation and/or other materials
12 * provided with the distribution.
13 *
14 * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
15 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
16 * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
21 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
22 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 *
24 * The views and conclusions contained in the software and documentation are those of the
25 * authors and should not be interpreted as representing official policies, either expressed
26 * or implied, of JogAmp Community.
27 */
28package com.jogamp.graph.ui.shapes;
29
30import com.jogamp.opengl.GL2ES2;
31import com.jogamp.opengl.GLProfile;
32import com.jogamp.graph.curve.OutlineShape;
33import com.jogamp.graph.curve.Region;
34import com.jogamp.graph.curve.opengl.GLRegion;
35import com.jogamp.graph.curve.opengl.RegionRenderer;
36import com.jogamp.graph.curve.opengl.TextRegionUtil;
37import com.jogamp.graph.font.Font;
38import com.jogamp.graph.ui.GraphShape;
39import com.jogamp.graph.ui.Scene;
40import com.jogamp.graph.ui.Shape;
41import com.jogamp.math.FloatUtil;
42import com.jogamp.math.Vec2f;
43import com.jogamp.math.Vec3f;
44import com.jogamp.math.Vec4f;
45import com.jogamp.math.geom.AABBox;
46import com.jogamp.math.geom.plane.AffineTransform;
47import com.jogamp.opengl.util.texture.TextureSequence;
48
49import jogamp.graph.ui.shapes.Label0;
50
51/**
52 * A GraphUI text labeled {@link BaseButton} {@link GraphShape}
53 * <p>
54 * GraphUI is GPU based and resolution independent.
55 * </p>
56 * <p>
57 * This button is rendered with a round oval shape.
58 * To render it rectangular, {@link #setCorner(float)} to zero.
59 * </p>
60 */
61public class Button extends BaseButton {
62 /** {@value} */
63 public static final float DEFAULT_SPACING_X = 0.20f;
64 /** {@value} */
65 public static final float DEFAULT_SPACING_Y = 0.46f;
66
67 /**
68 * Default {@link #setLabelZOffset(float) Z-axis offset},
69 * using the smallest resolvable Z separation rounded value {@value} at 16-bits depth buffer, -1 z-distance and 0.1 z-near,
70 * used to separate the {@link BaseButton} from the {@link Label}.
71 * <p>
72 * {@link FloatUtil#getZBufferEpsilon(int, float, float)}
73 * <pre>
74 * 1.5256461E-4 = 16 zBits, -0.2 zDist, 0.1 zNear
75 * 6.1033297E-6 = 16 zBits, -1.0 zDist, 0.1 zNear
76 * </pre>
77 * </p>
78 */
79 public static final float DEFAULT_LABEL_ZOFFSET = 0.000153f; // 0.00015256461 = 16 zBits, -1 zDist, 0.1 zNear, i.e. FloatUtil.getZBufferEpsilon(16, -1f, 0.1f)
80 private float labelZOffset;
81
82 private final Label0 labelOff, labelOn;
83 private volatile Label0 labelNow;
84 private final Vec2f spacing = new Vec2f(DEFAULT_SPACING_X, DEFAULT_SPACING_Y);
85 private final Vec2f fixedLabelSize = new Vec2f(0, 0);
86
87 /**
88 * Create a text labeled button Graph based {@link GLRegion} UI {@link Shape}.
89 * <p>
90 * Sets the {@link #setLabelZOffset(float) Z-axis offset} to
91 * a default smallest resolvable Z separation rounded value {@code 0.000153} at 16-bits depth buffer, -1 z-distance and 0.1 z-near,
92 * used to separate the {@link BaseButton} from the {@link Label}.
93 * </p>
94 * @param renderModes Graph's {@link Region} render modes, see {@link GLRegion#create(GLProfile, int, TextureSequence) create(..)}.
95 * @param labelFont {@link Font} for the label
96 * @param labelText the label text
97 * @param width width of the button
98 * @param height height of the button
99 * @see #Button(int, Font, CharSequence, float, float, float)
100 */
101 public Button(final int renderModes, final Font labelFont, final CharSequence labelText,
102 final float width, final float height) {
103 this(renderModes, labelFont, labelText, null, width, height, DEFAULT_LABEL_ZOFFSET);
104 }
105
106 /**
107 * Create a text labeled button Graph based {@link GLRegion} UI {@link Shape}.
108 * @param renderModes Graph's {@link Region} render modes, see {@link GLRegion#create(GLProfile, int, TextureSequence) create(..)}.
109 * @param labelFont {@link Font} for the label
110 * @param labelText the label text
111 * @param width width of the button
112 * @param height height of the button
113 * @param zOffset the Z-axis offset, used to separate the {@link BaseButton} from the {@link Label}
114 * @see FloatUtil#getZBufferEpsilon(int, float, float)
115 */
116 public Button(final int renderModes, final Font labelFont, final CharSequence labelText,
117 final float width, final float height, final float zOffset) {
118 this(renderModes, labelFont, labelText, null, width, height, zOffset);
119 }
120
121 /**
122 * Create a text labeled button Graph based {@link GLRegion} UI {@link Shape}.
123 * <p>
124 * If {@code labelTextOn} is not {@code null}, constructor enables {@link #setToggleable(boolean) toggle-able} mode
125 * to automatically switch the labels depending on {@link #isToggleOn()}.
126 * </p>
127 * @param renderModes Graph's {@link Region} render modes, see {@link GLRegion#create(GLProfile, int, TextureSequence) create(..)}.
128 * @param labelFont {@link Font} for the label
129 * @param labelTextOff the label text of the toggle-off state (current at creation), see {@link #isToggleOn()}
130 * @param labelTextOn optional label text of the toggle-on state, see {@link #isToggleOn()}. If not {@code null}, enables {@link #setToggleable(boolean) toggle-able} mode.
131 * @param width width of the button
132 * @param height height of the button
133 * @param zOffset the Z-axis offset, used to separate the {@link BaseButton} from the {@link Label}
134 * @see FloatUtil#getZBufferEpsilon(int, float, float)
135 */
136 public Button(final int renderModes, final Font labelFont, final CharSequence labelTextOff, final CharSequence labelTextOn,
137 final float width, final float height, final float zOffset) {
139 this.labelZOffset = zOffset;
140 this.labelOff = new Label0(labelFont, labelTextOff, new Vec4f( 1.66f, 1.66f, 1.66f, 1.0f )); // 0.60 * 1.66 ~= 1.0
141 this.labelNow = this.labelOff;
142 if( null != labelTextOn ) {
143 this.labelOn = new Label0(labelFont, labelTextOn, new Vec4f( 1.66f, 1.66f, 1.66f, 1.0f )); // 0.60 * 1.66 ~= 1.0
144 this.setToggleable(true);
145 } else {
146 this.labelOn = null;
147 }
148 }
149
150 @Override
151 protected void toggleNotify(final boolean on) {
152 if( null != labelOn ) {
153 if( on ) {
154 labelNow = labelOn;
155 } else {
156 labelNow = labelOff;
157 }
159 }
160 }
161
162 /** Returns the label {@link Font}. */
163 public Font getFont() { return labelNow.getFont(); }
164
165 /** Returns the text of the current label. */
166 public CharSequence getText() { return labelNow.getText(); }
167
168 @Override
169 public void draw(final GL2ES2 gl, final RegionRenderer renderer) {
170 // No need to setup an poly offset for z-fighting, using one region now
171 // Setup poly offset for z-fighting
172 // gl.glEnable(GL.GL_POLYGON_OFFSET_FILL);
173 // gl.glPolygonOffset(0f, 1f);
174 super.draw(gl, renderer);
175 // gl.glDisable(GL.GL_POLYGON_OFFSET_FILL);
176 }
177
178 @Override
179 protected void addShapeToRegion(final GLProfile glp, final GL2ES2 gl) {
180 final AffineTransform tempT1 = new AffineTransform();
181 final AffineTransform tempT2 = new AffineTransform();
182 final AffineTransform tempT3 = new AffineTransform();
183
184 final OutlineShape shape = createBaseShape( FloatUtil.isZero(labelZOffset) ? 0f : -labelZOffset );
185 box.resize(shape.getBounds());
187
188 // Sum Region buffer size of base-shape + text
189 final int[/*2*/] vertIndexCount = Region.countOutlineShape(shape, new int[2]);
190 TextRegionUtil.countStringRegion(labelNow.getFont(), labelNow.getText(), vertIndexCount);
191 resetGLRegion(glp, gl, null, vertIndexCount[0], vertIndexCount[1]);
192
193 region.addOutlineShape(shape, null, rgbaColor);
194
195 // Precompute text-box size .. guessing pixelSize
196 final AABBox lbox0_em = labelNow.getFont().getGlyphBounds(labelNow.getText(), tempT1, tempT2);
197 final float lw = box.getWidth() * ( 1f - spacing.x() ) ;
198 final float lsx = lw / Math.max(fixedLabelSize.x(), lbox0_em.getWidth());
199 final float lh = box.getHeight() * ( 1f - spacing.y() ) ;
200 final float lsy = lh / Math.max(fixedLabelSize.y(), lbox0_em.getHeight());
201 final float lScale = lsx < lsy ? lsx : lsy;
202
203 // Setting left-corner transform using text-box in font em-size [0..1]
204 final AABBox lbox0_s = new AABBox(lbox0_em).scale2(lScale);
205 // Center text .. (share same center w/ button)
206 final Vec3f lctr = lbox0_s.getCenter();
207 final Vec3f ctr = box.getCenter();
208 final Vec2f ltxy = new Vec2f(ctr.x() - lctr.x(), ctr.y() - lctr.y() );
209
210 if( DEBUG_DRAW ) {
211 System.err.println("Button: dim "+width+" x "+height+", spacing "+spacing+", fixedLabelSize "+fixedLabelSize);
212 System.err.println("Button: text0_em "+lbox0_em+" em, "+labelNow.getText());
213 System.err.println("Button: shape "+box);
214 System.err.println("Button: text-space "+lw+" x "+lh);
215 System.err.println("Button: lscale "+lsx+" x "+lsy+" -> "+lScale);
216 System.err.printf ("Button: text0_s %s%n", lbox0_s);
217 System.err.printf ("Button: ltxy %s, %f / %f%n", ltxy, ltxy.x() * lScale, ltxy.y() * lScale);
218 final float x0 = ( box.getWidth() - lbox0_s.getWidth() ) * 0.5f;
219 final float y0 = ( box.getHeight() - lbox0_s.getHeight() ) * 0.5f;
220 final AABBox lbox3 = new AABBox(new Vec3f(x0, y0, 0), new Vec3f(x0 + lbox0_s.getWidth(), y0 + lbox0_s.getHeight(), 0));
221 addRectangle(region, this.oshapeSharpness, lbox3, null, 0.0001f, new Vec4f(0, 0, 0, 1));
222 System.err.printf("Button.X: lbox3 %s%n", lbox3);
223 }
224
225 final AABBox lbox2 = labelNow.addShapeToRegion(lScale, region, ltxy, tempT1, tempT2, tempT3);
226 box.resize(lbox2);
227 if( DEBUG_DRAW ) {
228 System.err.printf("Button.X: lbox2 %s%n", lbox2);
229 System.err.printf("Button.X: shape %s%n", box);
230 }
231 }
232
233 public float getLabelZOffset() { return labelZOffset; }
234
235 /**
236 * Set the Z-axis offset to the given value,
237 * used to separate the {@link BaseButton} from the {@link Label}.
238 * @param v the zoffset
239 * @return this instance for chaining
240 * @see FloatUtil#getZBufferEpsilon(int, float, float)
241 */
242 public Button setLabelZOffset(final float v) {
243 labelZOffset = v;
245 return this;
246 }
247
248 /**
249 * Set the Z-axis offset to the smallest resolvable Z separation at the given range,
250 * used to separate the {@link BaseButton} from the {@link Label}.
251 * @param zBits number of bits of Z precision, i.e. z-buffer depth
252 * @param zDist distance from the eye to the object
253 * @param zNear distance from eye to near clip plane
254 * @return this instance for chaining
255 * @see FloatUtil#getZBufferEpsilon(int, float, float)
256 * @see Scene#getZEpsilon(int, com.jogamp.graph.ui.Scene.PMVMatrixSetup)
257 */
258 public Button setLabelZOffset(final int zBits, final float zDist, final float zNear) {
259 return setLabelZOffset( FloatUtil.getZBufferEpsilon(zBits, zDist, zNear) );
260 }
261
262 /** Returns the current fixed label font size, see {@Link #setFixedLabelSize(Vec2f)} and {@link #setSpacing(Vec2f, Vec2f)}. */
263 public final Vec2f getFixedLabelSize() { return fixedLabelSize; }
264
265 /**
266 * Sets fixed label font size clipped to range [0 .. 1], defaults to {@code 0, 0}.
267 * <p>
268 * Use {@code w=0, h=1} when using single symbols from fixed sized symbol fonts!
269 * Use {@link #setSpacing(Vec2f, Vec2f)} to also set spacing.
270 * </p>
271 * <p>
272 * The fixed label font size is used as the denominator when scaling.{@code max(fixedLabelSize, fontLabelSize)},
273 * hence reasonable values are either {@code 1} to enable using the given font-size
274 * for the axis or {@code 0} to scale up/down the font to match the button box less spacing for the axis.
275 * </p>
276 * @see #setSpacing(Vec2f, Vec2f)
277 * @see #setSpacing(Vec2f)
278 */
279 public final Button setFixedLabelSize(final float w, final float h) {
280 fixedLabelSize.set(
281 Math.max(0f, Math.min(1f, w)),
282 Math.max(0f, Math.min(1f, h)) );
284 return this;
285 }
286 public final Button setFixedLabelSize(final Vec2f v) {
287 return setFixedLabelSize(v.x(), v.y());
288 }
289
290 /** Returns the current spacing size, see {@Link #setSpacing(Vec2f)} and {@link #setSpacing(Vec2f, Vec2f)}. */
291 public final Vec2f getSpacing() { return spacing; }
292
293 /**
294 * Sets spacing in percent of text label, clipped to range [0 .. 1].
295 * @param spacingX spacing in percent on X, default is {@link #DEFAULT_SPACING_X}
296 * @param spacingY spacing in percent on Y, default is {@link #DEFAULT_SPACING_Y}
297 * @see #setSpacing(Vec2f)
298 * @see #setSpacing(Vec2f, Vec2f)
299 */
300 public final Button setSpacing(final float spacingX, final float spacingY) {
301 spacing.set(
302 Math.max(0f, Math.min(1f, spacingX)),
303 Math.max(0f, Math.min(1f, spacingY)) );
305 return this;
306 }
307 /**
308 * Sets spacing in percent of text label, clipped to range [0 .. 1].
309 * @param spacingX spacing in percent on X, default is {@link #DEFAULT_SPACING_X}
310 * @param spacingY spacing in percent on Y, default is {@link #DEFAULT_SPACING_Y}
311 * @see #setSpacing(Vec2f, Vec2f)
312 */
313 public final Button setSpacing(final Vec2f spacing) {
314 return setSpacing(spacing.x(), spacing.y());
315 }
316 /**
317 * Sets spacing {@link #setSpacing(Vec2f)} and fixed label font size {@link #setFixedLabelSize(Vec2f)} for convenience.
318 * @see #setSpacing(Vec2f)
319 * @see #setFixedLabelSize(Vec2f)
320 */
321 public final Button setSpacing(final Vec2f spacing, final Vec2f fixedLabelSize) {
322 setSpacing(spacing.x(), spacing.y());
323 setFixedLabelSize(fixedLabelSize.x(), fixedLabelSize.y());
324 return this;
325 }
326
327 /** Returns the label color. */
328 public final Vec4f getLabelColor() {
329 return labelNow.getColor();
330 }
331
332 /** Sets the label color, consider using alpha 1 */
333 public final Button setLabelColor(final Vec4f c) {
334 labelOff.setColor(c);
335 if( null != labelOn ) {
336 labelOn.setColor(c);
337 }
339 return this;
340 }
341
342 /** Sets the label color, consider using alpha 1 */
343 public final Button setLabelColor(final float r, final float g, final float b, final float a) {
344 labelOff.setColor(r, g, b, a);
345 if( null != labelOn ) {
346 labelOn.setColor(r, g, b, a);
347 }
349 return this;
350 }
351
352 /** Sets the label font. */
353 public final Button setFont(final Font labelFont) {
354 if( !labelOff.getFont().equals(labelFont) ) {
355 labelOff.setFont(labelFont);
357 }
358 if( null != labelOn ) {
359 if( !labelOn.getFont().equals(labelFont) ) {
360 labelOn.setFont(labelFont);
362 }
363 }
364 return this;
365 }
366
367 /** Sets the current label text. */
368 public final Button setText(final CharSequence labelText) {
369 if( !labelNow.getText().equals(labelText) ) {
370 labelNow.setText(labelText);
372 }
373 return this;
374 }
375
376 /** Sets the current label text. */
377 public final Button setText(final Font labelFont, final CharSequence labelText) {
378 if( !labelNow.getText().equals(labelText) || !labelNow.getFont().equals(labelFont) ) {
379 labelNow.setFont(labelFont);
380 labelNow.setText(labelText);
382 }
383 return this;
384 }
385
386 @Override
387 public String getSubString() {
388 final String onS = null != labelOn ? ( labelOn + (labelNow == labelOn ? "*" : "" ) + ", " ) : "";
389 final String offS = labelOff + (labelNow == labelOff ? "*" : "" ) + ", ";
390 final String flsS = fixedLabelSize.isZero() ? "" : "fixedLabelSize["+fixedLabelSize+"], ";
391 return super.getSubString()+", "+ offS + onS + "spacing["+spacing+"], "+flsS+"zOff "+labelZOffset;
392 }
393}
A Generic shape objects which is defined by a list of Outlines.
Abstract Outline shape representation define the method an OutlineShape(s) is bound and rendered.
Definition: Region.java:62
final void addOutlineShape(final OutlineShape shape, final AffineTransform t, final Vec4f rgbaColor)
Add the given OutlineShape to this region with the given optional AffineTransform.
Definition: Region.java:616
static final int COLORCHANNEL_RENDERING_BIT
Rendering-Mode bit for Region to optionally enable a color-channel per vertex.
Definition: Region.java:148
static final int[] countOutlineShape(final OutlineShape shape, final int[] vertIndexCount)
Count required number of vertices and indices adding to given int[2] vertIndexCount array.
Definition: Region.java:572
Text Type Rendering Utility Class adding the Font.Glyphs OutlineShape to a GLRegion.
static int[] countStringRegion(final Font font, final CharSequence str, final int[] vertIndexCount)
Count required number of vertices and indices adding to given int[2] vertIndexCount array.
final void resetGLRegion(final GLProfile glp, final GL2ES2 gl, final TextureSequence colorTexSeq, int vertexCount, int indexCount)
Reset the GLRegion and reserving its buffers to have a free capacity for vertexCount and indexCount e...
static void addRectangle(final Region region, final float sharpness, final AABBox box, final Padding padding, final float borderThickness, final Vec4f color)
Shape setColor(final float r, final float g, final float b, final float a)
Set base color.
Definition: Shape.java:1389
static final boolean DEBUG_DRAW
Definition: Shape.java:238
final void markShapeDirty()
Marks the shape dirty, causing next draw() to recreate the Graph shape and reset the region.
Definition: Shape.java:688
final Vec4f rgbaColor
Default base-color w/o color channel, will be modulated w/ pressed- and toggle color.
Definition: Shape.java:261
final Shape setRotationPivot(final float px, final float py, final float pz)
Set unscaled rotation origin, aka pivot.
Definition: Shape.java:620
final Shape setToggleable(final boolean toggleable)
Set this shape toggleable, default is off.
Definition: Shape.java:1573
An abstract GraphUI filled base button GraphShape, usually used as a backdrop or base shape for more ...
Definition: BaseButton.java:50
OutlineShape createBaseShape(final float zOffset)
A GraphUI text labeled BaseButton GraphShape.
Definition: Button.java:61
Font getFont()
Returns the label Font.
Definition: Button.java:163
final Vec4f getLabelColor()
Returns the label color.
Definition: Button.java:328
final Button setText(final CharSequence labelText)
Sets the current label text.
Definition: Button.java:368
Button(final int renderModes, final Font labelFont, final CharSequence labelTextOff, final CharSequence labelTextOn, final float width, final float height, final float zOffset)
Create a text labeled button Graph based GLRegion UI Shape.
Definition: Button.java:136
final Button setLabelColor(final Vec4f c)
Sets the label color, consider using alpha 1.
Definition: Button.java:333
void toggleNotify(final boolean on)
Definition: Button.java:151
final Button setSpacing(final float spacingX, final float spacingY)
Sets spacing in percent of text label, clipped to range [0 .
Definition: Button.java:300
final Vec2f getFixedLabelSize()
Returns the current fixed label font size, see {@Link setFixedLabelSize(Vec2f)} and setSpacing(Vec2f,...
Definition: Button.java:263
void draw(final GL2ES2 gl, final RegionRenderer renderer)
Renders the shape.
Definition: Button.java:169
CharSequence getText()
Returns the text of the current label.
Definition: Button.java:166
final Button setSpacing(final Vec2f spacing)
Sets spacing in percent of text label, clipped to range [0 .
Definition: Button.java:313
final Button setFixedLabelSize(final Vec2f v)
Definition: Button.java:286
final Vec2f getSpacing()
Returns the current spacing size, see {@Link setSpacing(Vec2f)} and setSpacing(Vec2f,...
Definition: Button.java:291
final Button setText(final Font labelFont, final CharSequence labelText)
Sets the current label text.
Definition: Button.java:377
final Button setSpacing(final Vec2f spacing, final Vec2f fixedLabelSize)
Sets spacing setSpacing(Vec2f) and fixed label font size setFixedLabelSize(Vec2f) for convenience.
Definition: Button.java:321
Button setLabelZOffset(final float v)
Set the Z-axis offset to the given value, used to separate the BaseButton from the Label.
Definition: Button.java:242
Button(final int renderModes, final Font labelFont, final CharSequence labelText, final float width, final float height, final float zOffset)
Create a text labeled button Graph based GLRegion UI Shape.
Definition: Button.java:116
static final float DEFAULT_SPACING_X
{@value}
Definition: Button.java:63
final Button setFont(final Font labelFont)
Sets the label font.
Definition: Button.java:353
final Button setFixedLabelSize(final float w, final float h)
Sets fixed label font size clipped to range [0 .
Definition: Button.java:279
void addShapeToRegion(final GLProfile glp, final GL2ES2 gl)
Definition: Button.java:179
Button setLabelZOffset(final int zBits, final float zDist, final float zNear)
Set the Z-axis offset to the smallest resolvable Z separation at the given range, used to separate th...
Definition: Button.java:258
static final float DEFAULT_LABEL_ZOFFSET
Default Z-axis offset, using the smallest resolvable Z separation rounded value {@value} at 16-bits d...
Definition: Button.java:79
final Button setLabelColor(final float r, final float g, final float b, final float a)
Sets the label color, consider using alpha 1.
Definition: Button.java:343
static final float DEFAULT_SPACING_Y
{@value}
Definition: Button.java:65
Button(final int renderModes, final Font labelFont, final CharSequence labelText, final float width, final float height)
Create a text labeled button Graph based GLRegion UI Shape.
Definition: Button.java:101
Basic Float math utility functions.
Definition: FloatUtil.java:83
static float getZBufferEpsilon(final int zBits, final float z, final float zNear)
Returns resolution of Z buffer of given parameter, see Love Your Z-Buffer.
static boolean isZero(final float a, final float epsilon)
Returns true if value is zero, i.e.
2D Vector based upon two float components.
Definition: Vec2f.java:37
boolean isZero()
Return true if all components are zero, i.e.
Definition: Vec2f.java:243
void set(final Vec2f o)
this = o, returns this.
Definition: Vec2f.java:73
3D Vector based upon three float components.
Definition: Vec3f.java:37
4D Vector based upon four float components.
Definition: Vec4f.java:37
Axis Aligned Bounding Box.
Definition: AABBox.java:54
final AABBox scale2(final float s)
Scale this AABBox by a constant, recomputing center.
Definition: AABBox.java:791
final float getWidth()
Definition: AABBox.java:879
final float getHeight()
Definition: AABBox.java:883
final AABBox resize(final AABBox newBox)
Resize the AABBox to encapsulate another AABox.
Definition: AABBox.java:274
final Vec3f getCenter()
Returns computed center of this AABBox of getLow() and getHigh().
Definition: AABBox.java:737
Specifies the the OpenGL profile.
Definition: GLProfile.java:77
Interface wrapper for font implementation.
Definition: Font.java:60