public final class OcTree
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static boolean |
COLLISION_DONT_USE
Don't use this octree to speed up collision detection
|
static boolean |
COLLISION_USE
Use this octree to speed up collision detection
|
static int |
MODE_NORMAL
Builds the octree in the "normal" way
|
static int |
MODE_OPTIMIZED
Tries to build a more optimized octree.
|
static boolean |
RENDERING_DONT_USE
Don't use this octree to speed up rendering
|
static boolean |
RENDERING_USE
Use this octree to speed up rendering
|
Constructor and Description |
---|
OcTree() |
OcTree(Mesh mesh,
int maxPoly,
int mode)
Builds a new octree from an Object3D.
|
OcTree(Mesh mesh,
int maxPoly,
int maxDepth,
int mode)
Builds a new octree from an Object3D.
|
OcTree(Object3D obj,
int maxPoly,
int mode)
Builds a new octree from an Object3D.
|
OcTree(Object3D obj,
int maxPoly,
int maxDepth,
int mode)
Builds a new octree from an Object3D.
|
Modifier and Type | Method and Description |
---|---|
boolean |
getCollisionUse()
Gets the collision detection setting for this octree.
|
java.util.ArrayList<com.threed.jpct.OcTreeNode> |
getFilledLeafs() |
float |
getRadiusMultiplier()
Returns the current radius multiplier for this octree.
|
boolean |
getRenderingUse()
Gets the rendering usage setting for this octree.
|
boolean |
isOfOrderZero()
If the root-node is the only node in the tree, the tree is of order zero.
|
void |
setCollisionUse(boolean useIt)
Sets the octree to be used for collision detection.
|
void |
setRadiusMultiplier(float mul)
Sets the radius multiplier that will be used for the sphere-polygon
collision detection.
|
void |
setRenderingUse(boolean useIt)
Sets the octree to be used for rendering.
|
public static final int MODE_NORMAL
public static final int MODE_OPTIMIZED
public static final boolean COLLISION_USE
public static final boolean COLLISION_DONT_USE
public static final boolean RENDERING_USE
public static final boolean RENDERING_DONT_USE
public OcTree(Mesh mesh, int maxPoly, int mode)
mesh
- the mesh from which the octree should be constructedmaxPoly
- the maximum number of polygons a single node may contain. The
smaller this number is, the more complex the octree gets. It
depends on the object and its usage which number will be the
best.mode
- the mode that should be used to construct the objectMODE_NORMAL
,
MODE_OPTIMIZED
,
Object3D.setOcTree(com.threed.jpct.OcTree)
public OcTree(Mesh mesh, int maxPoly, int maxDepth, int mode)
mesh
- the mesh from which the octree should be constructedmaxPoly
- the maximum number of polygons a single node may contain. The
smaller this number is, the more complex the octree gets. It
depends on the object and its usage which number will be the
best.maxDepth
- the maximum depth of the tree. The recursion will end at this
depth regardless of the number of polygons in the node.mode
- the mode that should be used to construct the objectMODE_NORMAL
,
MODE_OPTIMIZED
,
Object3D.setOcTree(com.threed.jpct.OcTree)
public OcTree(Object3D obj, int maxPoly, int mode)
obj
- the object from which's mesh the octree should be constructedmaxPoly
- the maximum number of polygons a single node may contain. The
smaller this number is, the more complex the octree gets. It
depends on the object and its usage which number will be the
best.mode
- the mode that should be used to construct the objectMODE_NORMAL
,
MODE_OPTIMIZED
,
Object3D.setOcTree(com.threed.jpct.OcTree)
public OcTree(Object3D obj, int maxPoly, int maxDepth, int mode)
obj
- the object from which's mesh the octree should be constructedmaxPoly
- the maximum number of polygons a single node may contain. The
smaller this number is, the more complex the octree gets. It
depends on the object and its usage which number will be the
best.maxDepth
- the maximum depth of the tree. The recursion will end at this
depth regardless of the number of polygons in the node.mode
- the mode that should be used to construct the objectMODE_NORMAL
,
MODE_OPTIMIZED
,
Object3D.setOcTree(com.threed.jpct.OcTree)
public OcTree()
public java.util.ArrayList<com.threed.jpct.OcTreeNode> getFilledLeafs()
public void setCollisionUse(boolean useIt)
useIt
- use it for collision detection...or not...COLLISION_USE
,
COLLISION_DONT_USE
public void setRenderingUse(boolean useIt)
useIt
- use it for rendering...or not...RENDERING_USE
,
RENDERING_DONT_USE
public boolean getCollisionUse()
COLLISION_USE
,
COLLISION_DONT_USE
public boolean getRenderingUse()
RENDERING_USE
,
RENDERING_DONT_USE
public void setRadiusMultiplier(float mul)
mul
- the multiplierpublic float getRadiusMultiplier()
public boolean isOfOrderZero()