|
|||||||||
| 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.SimpleSpace
public class SimpleSpace
A simple, "flat" space implementation.
| Field Summary | |
|---|---|
protected ArrayList<SpaceElement> |
_elements
The list of all space elements. |
| Fields inherited from class com.threerings.tudey.space.Space |
|---|
_disposed, _result |
| Constructor Summary | |
|---|---|
SimpleSpace()
|
|
| Method Summary | |
|---|---|
protected void |
addToSpatial(SpaceElement element)
Adds an element to the space's spatial data structure. |
void |
getElements(Rect bounds,
Collection<SpaceElement> results)
Retrieves all space elements whose bounds intersect the provided region. |
void |
getIntersecting(Shape shape,
com.google.common.base.Predicate<? super SpaceElement> filter,
Collection<SpaceElement> results)
Retrieves all space elements that intersect the provided shape. |
SpaceElement |
getIntersection(Ray2D ray,
Vector2f location,
com.google.common.base.Predicate<? super SpaceElement> filter)
Checks for an intersection between the provided ray and the contents of the space. |
protected void |
removeFromSpatial(SpaceElement element)
Removes an element from the space's spatial data structure. |
| Methods inherited from class com.threerings.tudey.space.Space |
|---|
add, boundsDidChange, boundsWillChange, dispose, getIntersecting, getIntersecting, getIntersecting, getIntersection, getIntersection, remove |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected ArrayList<SpaceElement> _elements
| Constructor Detail |
|---|
public SimpleSpace()
| Method Detail |
|---|
public SpaceElement getIntersection(Ray2D ray,
Vector2f location,
com.google.common.base.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,
com.google.common.base.Predicate<? super SpaceElement> filter,
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.protected void addToSpatial(SpaceElement element)
Space
addToSpatial in class Spaceprotected void removeFromSpatial(SpaceElement element)
Space
removeFromSpatial in class Space
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||