public final class Octree<T> extends java.lang.Object implements IBoundable
| Modifier and Type | Method and Description |
|---|---|
static <T> Octree<T> |
create(IBounds<?> region,
int level) |
void |
createChilds()
Create all childs of this Octree
|
Octree<T> |
find(long id) |
IBounds<?> |
getBounds() |
Octree<T> |
getChild(int index) |
T |
getData() |
int |
getDepth() |
long |
getId() |
int |
getLevel() |
int |
getMaxNumChilds() |
Octree<T> |
getParent() |
Octree<T> |
getRoot() |
IVolume<?> |
getVolume(int bvOptions) |
boolean |
isCulled() |
boolean |
isLeaf() |
boolean |
isRoot() |
boolean |
isVisible() |
java.util.Iterator<Octree<T>> |
iterator(OctreeIteratorType type,
OctreeFilter<T> filter) |
Octree<T> |
neighbor(Vec3i sides,
boolean create)
Find the neighbor of this Octree
|
void |
setCulled(boolean culled) |
void |
setData(T data) |
void |
setVisible(boolean visible) |
java.lang.String |
toString() |
void |
traverse(OctreeVisitor<T> visitor) |
void |
traversePreOrder(OctreeVisitor<T> visitor) |
Octree<T> |
visit(Box region)
Visit the
Octree englobing the specified region. |
Octree<T> |
visit(Vec3 position)
Visit the
Octree englobing the specified position. |
public java.lang.String toString()
toString in class java.lang.Objectpublic void createChilds()
public Octree<T> visit(Vec3 position)
position - 3d position visitedOctree containing the 3D pointpublic Octree<T> visit(Box region)
position - 3d position visitedOctree containing the 3D pointpublic void traverse(OctreeVisitor<T> visitor)
public void traversePreOrder(OctreeVisitor<T> visitor)
public java.util.Iterator<Octree<T>> iterator(OctreeIteratorType type, OctreeFilter<T> filter)
public Octree<T> neighbor(Vec3i sides, boolean create)
sides - sides direction:
-1: left
0: same side
1: rightpublic IVolume<?> getVolume(int bvOptions)
getVolume in interface IBoundablebvOptions - bounding volume options.BoundingBox or BoundingSphere depending on options.VolumeOptions,
Box,
Sphere,
Cylinder,
Capsulepublic IBounds<?> getBounds()
public boolean isRoot()
public boolean isLeaf()
public long getId()
public int getLevel()
public int getDepth()
public int getMaxNumChilds()
public boolean isVisible()
public void setVisible(boolean visible)
public boolean isCulled()
public void setCulled(boolean culled)
public T getData()
public void setData(T data)
Bonzai Engine 1.4.1-20200831 - A Java OpenGL engine and tools for Windows/Mac/Linux/Android
Copyright © 2007-2019 Jérôme Jouvie bonzaiengine.com contact@bonzaiengine.com