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
| Modifier and Type | Field and Description |
|---|---|
| private final float[] | |
| private static final boolean | |
| private final float[] | |
| private final float[] |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | AABBox(final float
min x-coordinate lx, final float min y-coordnate ly, final float min z-coordinate lz, final float max x-coordinate hx, final float max y-coordinate hy, final float max z-coordinate hz)Create an AABBox specifying the coordinates of the low and high |
| public | AABBox(final float[]
min xyz-coordinates low, final float[] max xyz-coordinates high)Create a AABBox defining the low and high |
| Modifier and Type | Method and Description |
|---|---|
| private final void | |
| public final boolean | Returns: true if x belong to (low.x, high.x) and y belong to (low.y, high.y)x-axis coordinate value x, final float y-axis coordinate value y)Check if the x & y coordinates are bounded/contained by this AABBox |
| public final boolean | Returns: true if x belong to (low.x, high.x) and y belong to (low.y, high.y) and z belong to (low.z, high.z)x-axis coordinate value x, final float y-axis coordinate value y, final float z-axis coordinate value z)Check if the xyz coordinates are bounded/contained by this AABBox. |
| public final AABBox | |
| public final boolean | equals(final Object
the reference object with which to compare. obj)Overrides java. |
| public final float[] | |
| public final float | |
| public final float | |
| public final float[] | |
| public final float[] | |
| public final float | |
| public final float | |
| public final float | |
| public final float | |
| public final float | |
| public final float | |
| public final float[] | Returns: float[3] result of intersection coordinates, or null if none existsvec3 result, final Ray ray, final float epsilon, final boolean if true, method assumes an intersection, i.e. by pre-checking via assumeIntersection, final float[] intersectsRay(Ray).
In this case method will not validate a possible non-intersection and just computes
coordinates.temp vec3 tmp1V3, final float[] temp vec3 tmp2V3, final float[] temp vec3 tmp3V3)Return intersection of a |
| public final float | Returns: a float representing the size of the AABBoxGet the size of this AABBox where the size is represented by the length of the vector between low and high. |
| public final float | |
| public final int | |
| public final boolean | Returns: true if this AABBox might have a common region with this 2D regionlower left x-coord x, final float lower left y-coord y, final float width w, final float hight h)Check if there is a common region between this AABBox and the passed 2D region irrespective of z range |
| public final boolean | |
| public AABBox | mapToWindow(final AABBox result, final float[]
P x Mv matrix mat4PMv, final int[] view, final boolean useCenterZ, final float[] 3 component vector for temp storage vec3Tmp0, final float[] 4 component vector for temp storage vec4Tmp1, final float[] 4 component vector for temp storage vec4Tmp2)Assume this bounding box as being in object space and compute the window bounding box. |
| public final AABBox | Returns: this AABBox for chainingresets this box to the inverse low/high, allowing the next |
| public final AABBox | |
| public final AABBox | Returns: this AABBox for chainingAABBox to be encapsulated in newBox, final AffineTransform the t, final float[] AffineTransform applied on newBox on the flytemp float[3] storage tmpV3)Resize the AABBox to encapsulate another AABox, which will be transformed on the fly first. |
| public final AABBox | Returns: this AABBox for chainingx-axis coordinate value x, final float y-axis coordinate value y, final float z-axis coordinate value z)Resize the AABBox to encapsulate the passed xyz-coordinates. |
| public final AABBox | Returns: this AABBox for chainingxyz-axis coordinate values xyz, final int of the array offset)Resize the AABBox to encapsulate the passed xyz-coordinates. |
| public final AABBox | Returns: this AABBox for chainingxyz-axis coordinate values xyz)Resize the AABBox to encapsulate the passed xyz-coordinates. |
| public final AABBox | Returns: this AABBox for chainingthe quat)Quaternion used for rotationRotate this AABBox by a float[3] vector |
| public final AABBox | Returns: this AABBox for chaininga constant float value size, final float[] caller provided temporary 3-component vector tmpV3)Scale this AABBox by a constant |
| private final void | |
| private final void | |
| public final AABBox | Returns: this AABBox for chainingmin xyz-coordinates low, final float[] max xyz-coordinates high)Set size of the AABBox specifying the coordinates of the low and high. |
| public final AABBox | Returns: this AABBox for chainingmin x-coordinate lx, final float min y-coordnate ly, final float min z-coordinate lz, final float max x-coordinate hx, final float max y-coordinate hy, final float max z-coordinate hz)Set size of the AABBox specifying the coordinates of the low and high. |
| public final String | |
| public final AABBox | Returns: this AABBox for chainingthe float[3] translation vector t)Translate this AABBox by a float[3] vector |
| center | back to summary |
|---|---|
| private final float[] center | |
| DEBUG | back to summary |
|---|---|
| private static final boolean DEBUG | |
| high | back to summary |
|---|---|
| private final float[] high | |
| low | back to summary |
|---|---|
| private final float[] low | |
| AABBox | back to summary |
|---|---|
| public AABBox() Create an Axis Aligned bounding box (AABBox) where the low and and high MAX float Values. | |
| AABBox | back to summary |
|---|---|
| public AABBox(final AABBox src) Create an AABBox copying all values from the given one
| |
| AABBox | back to summary |
|---|---|
| public 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
| |
| AABBox | back to summary |
|---|---|
| public AABBox(final float[] low, final float[] high) Create a AABBox defining the low and high
| |
| computeCenter | back to summary |
|---|---|
| private final void computeCenter() | |
| contains | back to summary |
|---|---|
| public final boolean contains(final float x, final float y) Check if the x & y coordinates are bounded/contained by this AABBox
| |
| contains | back to summary |
|---|---|
| public final boolean contains(final float x, final float y, final float z) Check if the xyz coordinates are bounded/contained by this AABBox.
| |
| copy | back to summary |
|---|---|
| public final AABBox copy(final AABBox src) Copy given AABBox 'src' values to this AABBox. | |
| equals | back to summary |
|---|---|
| public final boolean equals(final Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| getCenter | back to summary |
|---|---|
| public final float[] getCenter() Get the Center of this AABBox
| |
| getDepth | back to summary |
|---|---|
| public final float getDepth() | |
| getHeight | back to summary |
|---|---|
| public final float getHeight() | |
| getHigh | back to summary |
|---|---|
| public final float[] getHigh() Get the max xyz-coordinates
| |
| getLow | back to summary |
|---|---|
| public final float[] getLow() Get the min xyz-coordinates
| |
| getMaxX | back to summary |
|---|---|
| public final float getMaxX() | |
| getMaxY | back to summary |
|---|---|
| public final float getMaxY() | |
| getMaxZ | back to summary |
|---|---|
| public final float getMaxZ() | |
| getMinX | back to summary |
|---|---|
| public final float getMinX() | |
| getMinY | back to summary |
|---|---|
| public final float getMinY() | |
| getMinZ | back to summary |
|---|---|
| public final float getMinZ() | |
| getRayIntersection | back to summary |
|---|---|
| public final float[] getRayIntersection(final float[] result, final Ray ray, final float epsilon, final boolean assumeIntersection, final float[] tmp1V3, final float[] tmp2V3, final float[] tmp3V3) Return intersection of a
Method is based on the requirements:
Report bugs: [email protected] (original author) [1] http://www.codercorner.com/RayAABB.cpp [2] http://tog.acm.org/resources/GraphicsGems/gems/RayBox.c
| |
| getSize | back to summary |
|---|---|
| public final float getSize() Get the size of this AABBox where the size is represented by the length of the vector between low and high.
| |
| getWidth | back to summary |
|---|---|
| public final float getWidth() | |
| hashCode | back to summary |
|---|---|
| public final int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| intersects2DRegion | back to summary |
|---|---|
| public 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
| |
| intersectsRay | back to summary |
|---|---|
| public final boolean intersectsRay(final Ray ray) Check if 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 | |
| mapToWindow | back to summary |
|---|---|
| public AABBox mapToWindow(final AABBox result, final float[] mat4PMv, final int[] view, final boolean useCenterZ, final float[] vec3Tmp0, final float[] vec4Tmp1, final float[] vec4Tmp2) Assume this bounding box as being in object space and compute the window bounding box.
If [2] ------ [4] | | | | [1] ------ [3]
| |
| reset | back to summary |
|---|---|
| public final AABBox reset() resets this box to the inverse low/high, allowing the next
| |
| resize | back to summary |
|---|---|
| public final AABBox resize(final AABBox newBox) Resize the AABBox to encapsulate another AABox | |
| resize | back to summary |
|---|---|
| public final AABBox resize(final AABBox newBox, final AffineTransform t, final float[] tmpV3) Resize the AABBox to encapsulate another AABox, which will be transformed on the fly first.
| |
| resize | back to summary |
|---|---|
| public final AABBox resize(final float x, final float y, final float z) Resize the AABBox to encapsulate the passed xyz-coordinates.
| |
| resize | back to summary |
|---|---|
| public final AABBox resize(final float[] xyz, final int offset) Resize the AABBox to encapsulate the passed xyz-coordinates.
| |
| resize | back to summary |
|---|---|
| public final AABBox resize(final float[] xyz) Resize the AABBox to encapsulate the passed xyz-coordinates.
| |
| rotate | back to summary |
|---|---|
| public final AABBox rotate(final Quaternion quat) Rotate this AABBox by a float[3] vector
| |
| scale | back to summary |
|---|---|
| public final AABBox scale(final float size, final float[] tmpV3) Scale this AABBox by a constant
| |
| setHigh | back to summary |
|---|---|
| private final void setHigh(final float hx, final float hy, final float hz) | |
| setLow | back to summary |
|---|---|
| private final void setLow(final float lx, final float ly, final float lz) | |
| setSize | back to summary |
|---|---|
| public final AABBox setSize(final float[] low, final float[] high) Set size of the AABBox specifying the coordinates of the low and high.
| |
| setSize | back to summary |
|---|---|
| public 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.
| |
| toString | back to summary |
|---|---|
| public final String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| translate | back to summary |
|---|---|
| public final AABBox translate(final float[] t) Translate this AABBox by a float[3] vector
| |