|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttoxi.geom.Vec3D
toxi.geom.AABB
public class AABB
Axis-aligned bounding box with basic intersection features for Ray, AABB and Sphere classes.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class toxi.geom.Vec3D |
---|
Vec3D.Axis |
Field Summary |
---|
Fields inherited from class toxi.geom.Vec3D |
---|
MAX_VALUE, MIN_VALUE, x, X_AXIS, y, Y_AXIS, z, Z_AXIS, ZERO |
Constructor Summary | |
---|---|
AABB()
|
|
AABB(AABB box)
Creates an independent copy of the passed in box |
|
AABB(Vec3D pos,
Vec3D extent)
Creates a new instance from centre point and extent |
Method Summary | |
---|---|
AABB |
copy()
Copy. |
static AABB |
fromMinMax(Vec3D min,
Vec3D max)
Creates a new instance from two vectors specifying opposite corners of the box |
Vec3D |
getExtent()
Returns the current box size as new Vec3D instance (updating this vector will NOT update the box size! Use setExtent(Vec3D) for those
purposes) |
Vec3D |
getMax()
|
Vec3D |
getMin()
|
boolean |
intersectsBox(AABB box)
Checks if the box intersects the passed in one. |
Vec3D |
intersectsRay(Ray3D ray,
float minDist,
float maxDist)
Calculates intersection with the given ray between a certain distance interval. |
boolean |
intersectsSphere(Sphere s)
|
boolean |
intersectsSphere(Vec3D c,
float r)
|
float |
maxX()
Deprecated. |
float |
maxY()
Deprecated. |
float |
maxZ()
Deprecated. |
float |
minX()
Deprecated. |
float |
minY()
Deprecated. |
float |
minZ()
Deprecated. |
AABB |
set(AABB box)
|
Vec3D |
set(float x,
float y,
float z)
Updates the position of the box in space and calls updateBounds() immediately |
AABB |
set(Vec3D v)
Updates the position of the box in space and calls updateBounds() immediately |
AABB |
setExtent(Vec3D extent)
Updates the size of the box and calls updateBounds() immediately |
TriangleMesh |
toMesh()
|
TriangleMesh |
toMesh(java.lang.String name)
|
java.lang.String |
toString()
|
AABB |
updateBounds()
Updates the min/max corner points of the box. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AABB()
public AABB(AABB box)
box
- public AABB(Vec3D pos, Vec3D extent)
pos
- extent
- box dimensions (the box will be double the size in each
direction)Method Detail |
---|
public static final AABB fromMinMax(Vec3D min, Vec3D max)
min
- first corner pointmax
- second corner point
public AABB copy()
Vec3D
copy
in class Vec3D
public final Vec3D getExtent()
setExtent(Vec3D)
for those
purposes)
public final Vec3D getMax()
public final Vec3D getMin()
public boolean intersectsBox(AABB box)
box
- box to check
public Vec3D intersectsRay(Ray3D ray, float minDist, float maxDist)
ray
- incident rayminDist
- maxDist
-
public boolean intersectsSphere(Sphere s)
public boolean intersectsSphere(Vec3D c, float r)
c
- sphere centrer
- sphere radius
@Deprecated public final float maxX()
@Deprecated public final float maxY()
@Deprecated public final float maxZ()
@Deprecated public final float minX()
@Deprecated public final float minY()
@Deprecated public final float minZ()
public AABB set(AABB box)
public Vec3D set(float x, float y, float z)
updateBounds()
immediately
set
in class Vec3D
x
- the xy
- the yz
- the z
Vec3D.set(float, float, float)
public AABB set(Vec3D v)
updateBounds()
immediately
set
in class Vec3D
v
- vector to be copied
Vec3D.set(toxi.geom.Vec3D)
public AABB setExtent(Vec3D extent)
updateBounds()
immediately
extent
- new box size
public TriangleMesh toMesh()
public TriangleMesh toMesh(java.lang.String name)
public java.lang.String toString()
toString
in class Vec3D
public final AABB updateBounds()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |