|
JOGL v2.6.0-rc-20250706
JOGL, High-Performance Graphics Binding for Java (public API).
|
Axis Aligned Bounding Box. More...
Public Member Functions | |
| AABBox () | |
Create an Axis Aligned bounding box (AABBox) with the inverse low/high, allowing the next resize(float, float, float) command to hit. More... | |
| AABBox (final AABBox src) | |
| Create an AABBox copying all values from the given one. More... | |
| AABBox (final float lx, final float ly, final float lz, final float hx, final float hy, final float hz) | |
| Create an AABBox specifying the coordinates of the low and high. More... | |
| AABBox (final float[] low, final float[] high) | |
| Create a AABBox defining the low and high. More... | |
| AABBox (final Vec3f low, final Vec3f high) | |
| Create a AABBox defining the low and high. More... | |
| final AABBox | reset () |
Resets this box to the inverse low/high, allowing the next resize(float, float, float) command to hit. More... | |
| final Vec3f | getHigh () |
| Returns the maximum right-top-near (xyz) coordinate. More... | |
| final Vec3f | getLow () |
| Returns the minimum left-bottom-far (xyz) coordinate. More... | |
| final AABBox | copy (final AABBox src) |
| Copy given AABBox 'src' values to this AABBox. More... | |
| final AABBox | setSize (final float[] low, final float[] high) |
| Set size of the AABBox specifying the coordinates of the low and high. More... | |
| final AABBox | setSize (final float lx, final float ly, final float lz, final float hx, final float hy, final float hz) |
| Set size of the AABBox specifying the coordinates of the low and high. More... | |
| final AABBox | setSize (final Vec3f low, final Vec3f high) |
| Set size of the AABBox specifying the coordinates of the low and high. More... | |
| final AABBox | resizeWidth (final float deltaLeft, final float deltaRight) |
| Resize width of this AABBox with explicit left- and right delta values. More... | |
| final AABBox | resizeHeight (final float deltaBottom, final float deltaTop) |
| Resize height of this AABBox with explicit bottom- and top delta values. More... | |
| final AABBox | set (final AABBox o) |
| Assign values of given AABBox to this instance. More... | |
| final AABBox | resize (final AABBox newBox) |
| Resize the AABBox to encapsulate another AABox. More... | |
| final AABBox | resize (final AABBox newBox, final AffineTransform t, final Vec3f tmpV3) |
| Resize the AABBox to encapsulate another AABox, which will be transformed on the fly first. More... | |
| final AABBox | resize (final float x, final float y, final float z) |
| Resize the AABBox to encapsulate the passed xyz-coordinates. More... | |
| final AABBox | resize (final float[] xyz, final int offset) |
| Resize the AABBox to encapsulate the passed xyz-coordinates. More... | |
| final AABBox | resize (final float[] xyz) |
| Resize the AABBox to encapsulate the passed xyz-coordinates. More... | |
| final AABBox | resize (final Vec3f xyz) |
| Resize the AABBox to encapsulate the passed xyz-coordinates. More... | |
| final boolean | contains (final float x, final float y) |
| Returns whether this AABBox contains given 2D point. More... | |
| final boolean | contains (final float x, final float y, final float z) |
| Returns whether this AABBox contains given 3D point. More... | |
| final boolean | intersects (final AABBox o) |
| Returns whether this AABBox intersects (partially contains) given AABBox. More... | |
| final boolean | contains (final AABBox o) |
| Returns whether this AABBox fully contains given AABBox. More... | |
| final boolean | intersects2DRegion (final float x, final float y, final float w, final float h) |
| Check if there is a common region between this AABBox and the passed 2D region irrespective of z range. More... | |
| final boolean | intersectsRay (final Ray ray) |
Check if Ray intersects this bounding box. More... | |
| final Vec3f | getRayIntersection (final Vec3f result, final Ray ray, final float epsilon, final boolean assumeIntersection) |
Return intersection of a Ray with this bounding box, or null if none exist. More... | |
| final float | getSize () |
| Get the size of this AABBox where the size is represented by the length of the vector between low and high. More... | |
| final Vec3f | getCenter () |
Returns computed center of this AABBox of getLow() and getHigh(). More... | |
| final AABBox | scale (final float s) |
| Scale this AABBox by a constant around fixed center. More... | |
| final AABBox | scale (final float sX, final float sY, final float sZ) |
| Scale this AABBox by constants around fixed center. More... | |
| final AABBox | scale2 (final float s) |
| Scale this AABBox by a constant, recomputing center. More... | |
| final AABBox | scale2 (final float sX, final float sY, final float sZ) |
| Scale this AABBox by constants, recomputing center. More... | |
| final AABBox | translate (final float dx, final float dy, final float dz) |
| Translate this AABBox by a float[3] vector. More... | |
| final AABBox | translate (final Vec3f t) |
| Translate this AABBox by a float[3] vector. More... | |
| final AABBox | rotate (final Quaternion quat) |
| Rotate this AABBox by a float[3] vector. More... | |
| final float | getMinX () |
| final float | getMinY () |
| final float | getMinZ () |
| final float | getMaxX () |
| final float | getMaxY () |
| final float | getMaxZ () |
| final float | getWidth () |
| final float | getHeight () |
| final float | getDepth () |
| final float | getVolume () |
| Returns the volume, i.e. More... | |
| final boolean | hasZeroVolume () |
Return true if getVolume() is FloatUtil#isZero(float), considering epsilon. More... | |
| final float | get2DArea () |
| Returns the assumed 2D area, i.e. More... | |
| final boolean | hasZero2DArea () |
Return true if get2DArea() is FloatUtil#isZero(float), considering epsilon. More... | |
| final boolean | equals (final Object obj) |
| final int | hashCode () |
| AABBox | transform (final Matrix4f mat, final AABBox out) |
Transform this box using the given Matrix4f into out @endiliteral. More... | |
| AABBox | mapToWindow (final AABBox result, final Matrix4f mat4PMv, final Recti viewport, final boolean useCenterZ) |
| Assume this bounding box as being in object space and compute the window bounding box. More... | |
| final String | toString () |
Axis Aligned Bounding Box.
Defined by two 3D coordinates (low and high) The low being the the lower left corner of the box, and the high being the upper right corner of the box.
A few references for collision detection, intersections:
http://www.realtimerendering.com/intersections.html http://www.codercorner.com/RayAABB.cpp http://www.siggraph.org/education/materials/HyperGraph/raytrace/rtinter0.htm http://realtimecollisiondetection.net/files/levine_swept_sat.txt
Definition at line 54 of file AABBox.java.
| com.jogamp.math.geom.AABBox.AABBox | ( | ) |
Create an Axis Aligned bounding box (AABBox) with the inverse low/high, allowing the next resize(float, float, float) command to hit.
The dimension, i.e. getWidth() abd getHeight() is Float#isInfinite() thereafter.
Definition at line 71 of file AABBox.java.
| com.jogamp.math.geom.AABBox.AABBox | ( | final AABBox | src | ) |
Create an AABBox copying all values from the given one.
| src | the box value to be used for the new instance |
Definition at line 79 of file AABBox.java.
| com.jogamp.math.geom.AABBox.AABBox | ( | final float | lx, |
| final float | ly, | ||
| final float | lz, | ||
| final float | hx, | ||
| final float | hy, | ||
| final float | hz | ||
| ) |
Create an AABBox specifying the coordinates of the low and high.
| lx | min x-coordinate |
| ly | min y-coordnate |
| lz | min z-coordinate |
| hx | max x-coordinate |
| hy | max y-coordinate |
| hz | max z-coordinate |
Definition at line 93 of file AABBox.java.
| com.jogamp.math.geom.AABBox.AABBox | ( | final float[] | low, |
| final float[] | high | ||
| ) |
Create a AABBox defining the low and high.
| low | min xyz-coordinates |
| high | max xyz-coordinates |
Definition at line 103 of file AABBox.java.
Create a AABBox defining the low and high.
| low | min xyz-coordinates |
| high | max xyz-coordinates |
Definition at line 112 of file AABBox.java.
| final boolean com.jogamp.math.geom.AABBox.contains | ( | final AABBox | o | ) |
Returns whether this AABBox fully contains given AABBox.
Definition at line 444 of file AABBox.java.
| final boolean com.jogamp.math.geom.AABBox.contains | ( | final float | x, |
| final float | y | ||
| ) |
Returns whether this AABBox contains given 2D point.
| x | x-axis coordinate value |
| y | y-axis coordinate value |
Definition at line 408 of file AABBox.java.
| final boolean com.jogamp.math.geom.AABBox.contains | ( | final float | x, |
| final float | y, | ||
| final float | z | ||
| ) |
Returns whether this AABBox contains given 3D point.
| x | x-axis coordinate value |
| y | y-axis coordinate value |
| z | z-axis coordinate value |
Definition at line 419 of file AABBox.java.
| final boolean com.jogamp.math.geom.AABBox.equals | ( | final Object | obj | ) |
Definition at line 912 of file AABBox.java.
| final float com.jogamp.math.geom.AABBox.get2DArea | ( | ) |
Returns the assumed 2D area, i.e.
width * height while assuming low and high lies on same plane.
Definition at line 902 of file AABBox.java.
| final Vec3f com.jogamp.math.geom.AABBox.getCenter | ( | ) |
Returns computed center of this AABBox of getLow() and getHigh().
Definition at line 737 of file AABBox.java.
| final float com.jogamp.math.geom.AABBox.getDepth | ( | ) |
| final float com.jogamp.math.geom.AABBox.getHeight | ( | ) |
| final Vec3f com.jogamp.math.geom.AABBox.getHigh | ( | ) |
Returns the maximum right-top-near (xyz) coordinate.
Definition at line 131 of file AABBox.java.
| final Vec3f com.jogamp.math.geom.AABBox.getLow | ( | ) |
Returns the minimum left-bottom-far (xyz) coordinate.
Definition at line 140 of file AABBox.java.
| final float com.jogamp.math.geom.AABBox.getMaxX | ( | ) |
| final float com.jogamp.math.geom.AABBox.getMaxY | ( | ) |
| final float com.jogamp.math.geom.AABBox.getMaxZ | ( | ) |
| final float com.jogamp.math.geom.AABBox.getMinX | ( | ) |
| final float com.jogamp.math.geom.AABBox.getMinY | ( | ) |
| final float com.jogamp.math.geom.AABBox.getMinZ | ( | ) |
| final Vec3f com.jogamp.math.geom.AABBox.getRayIntersection | ( | final Vec3f | result, |
| final Ray | ray, | ||
| final float | epsilon, | ||
| final boolean | assumeIntersection | ||
| ) |
Return intersection of a Ray with this bounding box, or null if none exist.
Method is based on the requirements:
Report bugs: p.ter.nosp@m.dima.nosp@m.n@cod.nosp@m.erco.nosp@m.rner..nosp@m.com (original author)
[1] http://www.codercorner.com/RayAABB.cpp [2] http://tog.acm.org/resources/GraphicsGems/gems/RayBox.c
| result | vec3 |
| ray | |
| epsilon | |
| assumeIntersection | if true, method assumes an intersection, i.e. by pre-checking via intersectsRay(Ray). In this case method will not validate a possible non-intersection and just computes coordinates. |
Definition at line 563 of file AABBox.java.
| final float com.jogamp.math.geom.AABBox.getSize | ( | ) |
Get the size of this AABBox where the size is represented by the length of the vector between low and high.
Definition at line 732 of file AABBox.java.
| final float com.jogamp.math.geom.AABBox.getVolume | ( | ) |
Returns the volume, i.e.
width * height * depth
Definition at line 892 of file AABBox.java.
| final float com.jogamp.math.geom.AABBox.getWidth | ( | ) |
| final int com.jogamp.math.geom.AABBox.hashCode | ( | ) |
Definition at line 923 of file AABBox.java.
| final boolean com.jogamp.math.geom.AABBox.hasZero2DArea | ( | ) |
Return true if get2DArea() is FloatUtil#isZero(float), considering epsilon.
Definition at line 907 of file AABBox.java.
| final boolean com.jogamp.math.geom.AABBox.hasZeroVolume | ( | ) |
Return true if getVolume() is FloatUtil#isZero(float), considering epsilon.
Definition at line 897 of file AABBox.java.
| final boolean com.jogamp.math.geom.AABBox.intersects | ( | final AABBox | o | ) |
Returns whether this AABBox intersects (partially contains) given AABBox.
Definition at line 426 of file AABBox.java.
| final boolean com.jogamp.math.geom.AABBox.intersects2DRegion | ( | final float | x, |
| final float | y, | ||
| final float | w, | ||
| final float | h | ||
| ) |
Check if there is a common region between this AABBox and the passed 2D region irrespective of z range.
| x | lower left x-coord |
| y | lower left y-coord |
| w | width |
| h | hight |
Definition at line 462 of file AABBox.java.
| final boolean com.jogamp.math.geom.AABBox.intersectsRay | ( | final Ray | ray | ) |
Check if Ray intersects this bounding box.
Versions uses the SAT[1], testing 6 axes. Original code for OBBs from MAGIC. Rewritten for AABBs and reorganized for early exits[2].
[1] SAT = Separating Axis Theorem [2] http://www.codercorner.com/RayAABB.cpp
| ray |
Definition at line 495 of file AABBox.java.
| AABBox com.jogamp.math.geom.AABBox.mapToWindow | ( | final AABBox | result, |
| final Matrix4f | mat4PMv, | ||
| final Recti | viewport, | ||
| final boolean | useCenterZ | ||
| ) |
Assume this bounding box as being in object space and compute the window bounding box.
If useCenterZ is true, only 4 mapObjToWinCoords operations are made on points [1..4] using getCenter()'s z-value. Otherwise 8 mapObjToWinCoords operation on all 8 points are performed.
.z() ------ [4] | | | | .y() ------ [3]
| mat4PMv | [projection] x [modelview] matrix, i.e. P x Mv |
| viewport | viewport rectangle |
| useCenterZ | |
| vec3Tmp0 | 3 component vector for temp storage |
| vec4Tmp1 | 4 component vector for temp storage |
| vec4Tmp2 | 4 component vector for temp storage |
Definition at line 966 of file AABBox.java.
| final AABBox com.jogamp.math.geom.AABBox.reset | ( | ) |
Resets this box to the inverse low/high, allowing the next resize(float, float, float) command to hit.
The dimension, i.e. getWidth() abd getHeight() is Float#isInfinite() thereafter.
Definition at line 123 of file AABBox.java.
Resize the AABBox to encapsulate another AABox.
| newBox | AABBox to be encapsulated in |
Definition at line 274 of file AABBox.java.
| final AABBox com.jogamp.math.geom.AABBox.resize | ( | final AABBox | newBox, |
| final AffineTransform | t, | ||
| final Vec3f | tmpV3 | ||
| ) |
Resize the AABBox to encapsulate another AABox, which will be transformed on the fly first.
| newBox | AABBox to be encapsulated in |
| t | the AffineTransform applied on newBox on the fly |
| tmpV3 | temporary storage |
Definition at line 310 of file AABBox.java.
| final AABBox com.jogamp.math.geom.AABBox.resize | ( | final float | x, |
| final float | y, | ||
| final float | z | ||
| ) |
Resize the AABBox to encapsulate the passed xyz-coordinates.
| x | x-axis coordinate value |
| y | y-axis coordinate value |
| z | z-axis coordinate value |
Definition at line 345 of file AABBox.java.
| final AABBox com.jogamp.math.geom.AABBox.resize | ( | final float[] | xyz | ) |
Resize the AABBox to encapsulate the passed xyz-coordinates.
| xyz | xyz-axis coordinate values |
Definition at line 389 of file AABBox.java.
| final AABBox com.jogamp.math.geom.AABBox.resize | ( | final float[] | xyz, |
| final int | offset | ||
| ) |
Resize the AABBox to encapsulate the passed xyz-coordinates.
| xyz | xyz-axis coordinate values |
| offset | of the array |
Definition at line 379 of file AABBox.java.
Resize the AABBox to encapsulate the passed xyz-coordinates.
| xyz | xyz-axis coordinate values |
Definition at line 399 of file AABBox.java.
| final AABBox com.jogamp.math.geom.AABBox.resizeHeight | ( | final float | deltaBottom, |
| final float | deltaTop | ||
| ) |
Resize height of this AABBox with explicit bottom- and top delta values.
| deltaBottom | positive value will expand height, otherwise shrink height |
| deltaTop | positive value will expand height, otherwise shrink height |
Definition at line 240 of file AABBox.java.
| final AABBox com.jogamp.math.geom.AABBox.resizeWidth | ( | final float | deltaLeft, |
| final float | deltaRight | ||
| ) |
Resize width of this AABBox with explicit left- and right delta values.
| deltaLeft | positive value will expand width, otherwise shrink width |
| deltaRight | positive value will expand width, otherwise shrink width |
Definition at line 218 of file AABBox.java.
| final AABBox com.jogamp.math.geom.AABBox.rotate | ( | final Quaternion | quat | ) |
Rotate this AABBox by a float[3] vector.
| quat | the Quaternion used for rotation |
Definition at line 848 of file AABBox.java.
| final AABBox com.jogamp.math.geom.AABBox.scale | ( | final float | s | ) |
Scale this AABBox by a constant around fixed center.
high and low is recomputed by scaling its distance to fixed center.
| s | scale factor |
Definition at line 750 of file AABBox.java.
| final AABBox com.jogamp.math.geom.AABBox.scale | ( | final float | sX, |
| final float | sY, | ||
| final float | sZ | ||
| ) |
Scale this AABBox by constants around fixed center.
high and low is recomputed by scaling its distance to fixed center.
| sX | horizontal scale factor |
| sY | vertical scale factor |
| sZ | Z-axis scale factor |
Definition at line 771 of file AABBox.java.
| final AABBox com.jogamp.math.geom.AABBox.scale2 | ( | final float | s | ) |
Scale this AABBox by a constant, recomputing center.
high and low is scaled and center recomputed.
| s | scale factor |
Definition at line 791 of file AABBox.java.
| final AABBox com.jogamp.math.geom.AABBox.scale2 | ( | final float | sX, |
| final float | sY, | ||
| final float | sZ | ||
| ) |
Scale this AABBox by constants, recomputing center.
high and low is scaled and center recomputed.
| sX | horizontal scale factor |
| sY | vertical scale factor |
| sZ | Z-axis scale factor |
Definition at line 809 of file AABBox.java.
Assign values of given AABBox to this instance.
| o | source AABBox |
Definition at line 262 of file AABBox.java.
| final AABBox com.jogamp.math.geom.AABBox.setSize | ( | final float | lx, |
| final float | ly, | ||
| final float | lz, | ||
| final float | hx, | ||
| final float | hy, | ||
| final float | hz | ||
| ) |
Set size of the AABBox specifying the coordinates of the low and high.
| lx | min x-coordinate |
| ly | min y-coordnate |
| lz | min z-coordinate |
| hx | max x-coordinate |
| hy | max y-coordinate |
| hz | max z-coordinate |
Definition at line 189 of file AABBox.java.
| final AABBox com.jogamp.math.geom.AABBox.setSize | ( | final float[] | low, |
| final float[] | high | ||
| ) |
Set size of the AABBox specifying the coordinates of the low and high.
| low | min xyz-coordinates |
| high | max xyz-coordinates |
Definition at line 173 of file AABBox.java.
Set size of the AABBox specifying the coordinates of the low and high.
| low | min xyz-coordinates |
| high | max xyz-coordinates |
Definition at line 205 of file AABBox.java.
| final String com.jogamp.math.geom.AABBox.toString | ( | ) |
Definition at line 1008 of file AABBox.java.
| final AABBox com.jogamp.math.geom.AABBox.translate | ( | final float | dx, |
| final float | dy, | ||
| final float | dz | ||
| ) |
Translate this AABBox by a float[3] vector.
| dx | the translation x-component |
| dy | the translation y-component |
| dz | the translation z-component |
| t | the float[3] translation vector |
Definition at line 824 of file AABBox.java.
Translate this AABBox by a float[3] vector.
| t | the float[3] translation vector |
Definition at line 836 of file AABBox.java.