|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.threerings.tudey.space.Space
com.threerings.tudey.space.HashSpace
public class HashSpace
A space that uses a hybrid spatial hashing/quadtree scheme to store elements.
| Constructor Summary | |
|---|---|
HashSpace(float granularity,
int levels)
Creates a new hash space. |
|
| Method Summary | |
|---|---|
void |
boundsDidChange(SpaceElement element)
Notes that the specified space element's bounds have changed. |
void |
boundsWillChange(SpaceElement element)
Notes that the specified space element's bounds are about to change. |
void |
getElements(Rect bounds,
Collection<SpaceElement> results)
Retrieves all space elements whose bounds intersect the provided region. |
void |
getIntersecting(Shape shape,
Collection<SpaceElement> results)
Retrieves all space elements that intersect the provided shape. |
SpaceElement |
getIntersection(Ray2D ray,
Vector2f location,
Predicate<? super SpaceElement> filter)
Checks for an intersection between the provided ray and the contents of the space. |
| Methods inherited from class com.threerings.tudey.space.Space |
|---|
add, dispose, getIntersection, remove |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HashSpace(float granularity,
int levels)
granularity - the size of the top-level cells.levels - the (maximum) number of quadtree levels.| Method Detail |
|---|
public SpaceElement getIntersection(Ray2D ray,
Vector2f location,
Predicate<? super SpaceElement> filter)
Space
getIntersection in class Spacelocation - a vector to populate with the location of the intersection, if any.filter - a predicate to use in filtering the results of the test.
null for
none.
public void getIntersecting(Shape shape,
Collection<SpaceElement> results)
Space
getIntersecting in class Spaceresults - a collection to hold the results of the search.
public void getElements(Rect bounds,
Collection<SpaceElement> results)
Space
getElements in class Spaceresults - a list to hold the results of the search.public void boundsWillChange(SpaceElement element)
SpaceSpace.boundsDidChange(SpaceElement) when the change has been effected.
boundsWillChange in class Spacepublic void boundsDidChange(SpaceElement element)
Space
boundsDidChange in class Space
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||