|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcrystalspace.jbind.impl.csNativeObject
crystalspace.jbind.impl.csgeom.box.csBox3
A bounding box in 3D space. In order to operate correctly, this bounding box assumes that all values entered or compared against lie within the range (-CS_BOUNDINGBOX_MAXVALUE, CS_BOUNDINGBOX_MAXVALUE). It is not recommended to use points outside of this range.
Field Summary |
Fields inherited from class crystalspace.jbind.impl.csNativeObject |
ImplFactory, nPointer |
Constructor Summary | |
csBox3()
Initialize this box to empty. |
|
csBox3(csVector3 v)
Initialize this box with one point. |
|
csBox3(csVector3 v1,
csVector3 v2)
Initialize this box with two points. |
|
csBox3(float x1,
float y1,
float z1,
float x2,
float y2,
float z2)
Initialize this box with the given values. |
|
csBox3(iPointer nPointer)
|
Method Summary | |
csBox3 |
add(csBox3 box)
Compute the union of two bounding boxes. |
static csBox3 |
add(csBox3 box1,
csBox3 box2)
Compute the union of two bounding boxes. |
static csBox3 |
add(csBox3 box,
csVector3 point)
Compute the union of a bounding box and a point. |
csBox3 |
add(csVector3 point)
Compute the union of a point with this bounding box. |
void |
addBoundingVertex(csVector3 v)
Add a new vertex and recalculate the bounding box. |
void |
addBoundingVertex(float x,
float y,
float z)
Add a new vertex and recalculate the bounding box. |
void |
addBoundingVertexSmart(csVector3 v)
Add a new vertex and recalculate the bounding box. |
void |
addBoundingVertexSmart(float x,
float y,
float z)
Add a new vertex and recalculate the bounding box. |
int |
adjacent(csBox3 other)
Test if this box is adjacent to the other one. |
boolean |
adjacentX(csBox3 other)
Test if this box is adjacent to the other on the X side. |
boolean |
adjacentY(csBox3 other)
Test if this box is adjacent to the other on the Y side. |
boolean |
adjacentZ(csBox3 other)
Test if this box is adjacent to the other on the Z side. |
boolean |
between(csBox3 box1,
csBox3 box2)
Test if this box is between two others. |
int |
calculatePointSegment(csVector3 pos)
Assume that 3D space is divided into 27 areas. |
boolean |
contains(csBox3 box)
Test if this box contains the other box. |
boolean |
empty()
Test if this box is empty. |
static boolean |
equals(csBox3 box1,
csBox3 box2)
Tests if two bounding boxes are equal. |
csVector3 |
getCenter()
Get the center of this box. |
void |
getConvexOutline(csVector3 pos,
csVector3Array array)
Get a convex outline (not a polygon unless projected to 2D) for for this box as seen from the given position. |
void |
getConvexOutline(csVector3 pos,
csVector3Array array,
boolean bVisible)
Get a convex outline (not a polygon unless projected to 2D) for for this box as seen from the given position. |
csVector3 |
getCorner(int corner)
Return every corner of this bounding box from 0 to 7. |
csSegment3 |
getEdge(int edge)
Return every edge (segment) of this bounding box from 0 to 23 (use one of the CS_BOX_EDGE_Xyz_xyz etc. indices). |
void |
getEdge(int edge,
csSegment3 e)
Return every edge (segment) of this bounding box from 0 to 23 (use one of the CS_BOX_EDGE_Xyz_xyz etc. indices). |
int[] |
getEdgeInfo()
Given an edge index (CS_BOX_EDGE_Xyz_xyz etc.) return the two vertices (index CS_BOX_CORNER_xyz etc.) and left/right faces (CS_BOX_SIDE_x etc.). |
csNativeByteArray |
getFaceEdges(int face)
Given a face index (CS_BOX_SIDE_x etc.) return the four edges oriented clockwise around this face (CS_BOX_EDGE_Xyz_xyz etc.). |
csBox2 |
getSide(int side)
Get a side of this box as a 2D box. |
int |
getVisibleSides(csVector3 pos,
csNativeIntArray visible_sides)
Fill the array (which should be three long at least) with all visible sides (CS_BOX_SIDE_x etc. defines) as seen from the given point. |
static boolean |
greater(csBox3 box1,
csBox3 box2)
Tests if box1 is a superset of box2. |
boolean |
in(csVector3 v)
Test if the given coordinate is in this box. |
boolean |
in(float x,
float y,
float z)
Test if the given coordinate is in this box. |
protected boolean |
isNativePointerValidSafe(long nPointer)
|
static boolean |
less(csBox3 box1,
csBox3 box2)
Tests if box1 is a subset of box2. |
static boolean |
less(csVector3 point,
csBox3 box)
Tests if a point is contained in a box. |
void |
manhattanDistance(csBox3 other,
csVector3 dist)
Calculate the minimum manhattan distance between this box and another one. |
csVector3 |
max()
Get the 3d vector of maximum (x, y, z) values. |
float |
max(int idx)
Get Max component for 0 (x), 1 (y), or 2 (z). |
float |
maxX()
Get the maximum X value of the box. |
float |
maxY()
Get the maximum Y value of the box. |
float |
maxZ()
Get the maximum Z value of the box. |
csVector3 |
min()
Get the 3d vector of minimum (x, y, z) values. |
float |
min(int idx)
Get Min component for 0 (x), 1 (y), or 2 (z). |
float |
minX()
Get the minimum X value of the box. |
float |
minY()
Get the minimum Y value of the box. |
float |
minZ()
Get the minimum Z value of the box. |
csBox3 |
mul(csBox3 box)
Compute the intersection of two bounding boxes. |
static csBox3 |
mul(csBox3 box1,
csBox3 box2)
Compute the intersection of two bounding boxes. |
protected void |
nDelete(long pointer)
|
static boolean |
nEquals(csBox3 box1,
csBox3 box2)
Tests if two bounding boxes are unequal. |
static int |
otherSide(int side)
Static function to get the 'other' side (i.e. |
boolean |
overlap(csBox3 box)
Test if this box overlaps with the given box. |
boolean |
projectBox(csTransform trans,
float fov,
float sx,
float sy,
csBox2 sbox,
float min_z,
float max_z)
Project this box to a 2D bounding box given the view point transformation and also the field-of-view and shift values (for perspective projection). |
boolean |
projectBoxAndOutline(csTransform trans,
float fov,
float sx,
float sy,
csBox2 sbox,
csPoly2D poly,
float min_z,
float max_z)
Project this box to the 2D outline given the view point transformation and also the field-of-view and shift values (for perspective correction). |
boolean |
projectOutline(csTransform trans,
float fov,
float sx,
float sy,
csPoly2D poly,
float min_z,
float max_z)
Project this box to the 2D outline given the view point transformation and also the field-of-view and shift values (for perspective correction). |
void |
set(csVector3 bmin,
csVector3 bmax)
Sets the bounds of the box with the given values. |
void |
set(float x1,
float y1,
float z1,
float x2,
float y2,
float z2)
Sets the bounds of the box with the given values. |
void |
setCenter(csVector3 c)
Set the center of this box. |
void |
setMax(int idx,
float val)
Set Max component for 0 (x), 1 (y), or 2 (z). |
void |
setMin(int idx,
float val)
Set Min component for 0 (x), 1 (y), or 2 (z). |
void |
setSize(csVector3 s)
Set the size of the box but keep the center intact. |
float |
squaredOriginDist()
Calculate the squared distance between (0,0,0) and the box This routine is extremely efficient. |
float |
squaredOriginMaxDist()
Calculate the squared distance between (0,0,0) and the point on the box which is furthest away from (0,0,0). |
void |
startBoundingBox()
Initialize this box to empty. |
void |
startBoundingBox(csVector3 v)
Initialize this box to one vertex. |
boolean |
testIntersect(csBox3 box)
Test if the two boxes have an intersection. |
Methods inherited from class crystalspace.jbind.impl.csNativeObject |
changePointer, equals, finalize, getPointer, getPointer, getPointerArray, hashCode, isMemoryOwner, isNativePointerValid, newNativeObject, setMemoryOwner, toString |
Methods inherited from class java.lang.Object |
clone, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public csBox3(iPointer nPointer)
nPointer
- public csBox3()
public csBox3(csVector3 v)
v
- public csBox3(csVector3 v1, csVector3 v2)
v1
- v2
- public csBox3(float x1, float y1, float z1, float x2, float y2, float z2)
x1
- y1
- z1
- x2
- y2
- z2
- Method Detail |
protected void nDelete(long pointer)
nDelete
in class csNativeObject
csNativeObject.nDelete(long)
protected boolean isNativePointerValidSafe(long nPointer)
isNativePointerValidSafe
in class csNativeObject
crystalspace.jbind.impl.csNativeObject#isNativePointerValidSafe()
public final void addBoundingVertex(csVector3 v)
v
- public final void addBoundingVertex(float x, float y, float z)
x
- y
- z
- public final void addBoundingVertexSmart(csVector3 v)
v
- public final void addBoundingVertexSmart(float x, float y, float z)
x
- y
- z
- public final int adjacent(csBox3 other)
other
-
public final boolean adjacentX(csBox3 other)
other
-
public final boolean adjacentY(csBox3 other)
other
-
public final boolean adjacentZ(csBox3 other)
other
-
public final boolean between(csBox3 box1, csBox3 box2)
box1
- box2
-
public final int calculatePointSegment(csVector3 pos)
pos
-
public final boolean contains(csBox3 box)
box
-
public final boolean empty()
public final csVector3 getCenter()
public final void getConvexOutline(csVector3 pos, csVector3Array array)
pos
- array
- public final void getConvexOutline(csVector3 pos, csVector3Array array, boolean bVisible)
pos
- array
- bVisible
- public final csVector3 getCorner(int corner)
corner
-
public final void getEdge(int edge, csSegment3 e)
edge
- e
- public final csSegment3 getEdge(int edge)
public final int[] getEdgeInfo()
public csNativeByteArray getFaceEdges(int face)
face
-
public final csBox2 getSide(int side)
side
-
public final int getVisibleSides(csVector3 pos, csNativeIntArray visible_sides)
pos
- visible_sides
-
public final boolean in(csVector3 v)
v
-
public final boolean in(float x, float y, float z)
x
- y
- z
-
public final void manhattanDistance(csBox3 other, csVector3 dist)
other
- dist
- public final csVector3 max()
public final float max(int idx)
idx
-
public final float maxX()
public final float maxY()
public final float maxZ()
public final csVector3 min()
public final float min(int idx)
idx
-
public final float minX()
public final float minY()
public final float minZ()
public final csBox3 mul(csBox3 box)
box
-
public final csBox3 add(csVector3 point)
point
-
public final csBox3 add(csBox3 box)
box
-
public static final int otherSide(int side)
side
-
public final boolean overlap(csBox3 box)
box
-
public final boolean projectBox(csTransform trans, float fov, float sx, float sy, csBox2 sbox, float min_z, float max_z)
trans
- fov
- sx
- sy
- sbox
- min_z
- max_z
-
public final boolean projectBoxAndOutline(csTransform trans, float fov, float sx, float sy, csBox2 sbox, csPoly2D poly, float min_z, float max_z)
trans
- fov
- sx
- sy
- sbox
- poly
- min_z
- max_z
-
public final boolean projectOutline(csTransform trans, float fov, float sx, float sy, csPoly2D poly, float min_z, float max_z)
trans
- fov
- sx
- sy
- poly
- min_z
- max_z
-
public final void set(float x1, float y1, float z1, float x2, float y2, float z2)
x1
- y1
- z1
- x2
- y2
- z2
- public final void set(csVector3 bmin, csVector3 bmax)
bmin
- bmax
- public final void setCenter(csVector3 c)
c
- public final void setMax(int idx, float val)
idx
- val
- public final void setMin(int idx, float val)
idx
- val
- public final void setSize(csVector3 s)
s
- public final float squaredOriginDist()
public final float squaredOriginMaxDist()
public final void startBoundingBox(csVector3 v)
v
- public final void startBoundingBox()
public final boolean testIntersect(csBox3 box)
box
-
public static final csBox3 mul(csBox3 box1, csBox3 box2)
box1
- box2
-
public static final boolean nEquals(csBox3 box1, csBox3 box2)
box1
- box2
-
public static final csBox3 add(csBox3 box, csVector3 point)
box
- point
-
public static final csBox3 add(csBox3 box1, csBox3 box2)
box1
- box2
-
public static final boolean less(csVector3 point, csBox3 box)
point
- box
-
public static final boolean less(csBox3 box1, csBox3 box2)
box1
- box2
-
public static final boolean equals(csBox3 box1, csBox3 box2)
box1
- box2
-
public static final boolean greater(csBox3 box1, csBox3 box2)
box1
- box2
-
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |