|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.tudey.space.Space
public abstract class Space
Base class for spaces.
| Field Summary | |
|---|---|
protected boolean |
_disposed
Set when we've been disposed. |
protected Vector2f |
_result
Result vector for intersection testing. |
| Constructor Summary | |
|---|---|
Space()
|
|
| Method Summary | ||
|---|---|---|
void |
add(SpaceElement element)
Adds an element to this space. |
|
protected abstract void |
addToSpatial(SpaceElement element)
Adds an element to the space's spatial data structure. |
|
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 |
dispose()
Flags this space as having been disposed. |
|
abstract void |
getElements(Rect bounds,
Collection<SpaceElement> results)
Retrieves all space elements whose bounds intersect the provided region. |
|
protected static void |
getIntersecting(ArrayList<SpaceElement> elements,
Shape shape,
com.google.common.base.Predicate<? super SpaceElement> filter,
Collection<SpaceElement> results)
Adds all elements from the provided list that intersect the given shape to the specified results collection. |
|
protected static
|
getIntersecting(ArrayList<T> objects,
Rect bounds,
Collection<T> results)
Adds all objects from the provided list that intersect the given bounds to the specified results list. |
|
void |
getIntersecting(Shape shape,
Collection<SpaceElement> results)
Retrieves all space elements that intersect the provided shape. |
|
abstract void |
getIntersecting(Shape shape,
com.google.common.base.Predicate<? super SpaceElement> filter,
Collection<SpaceElement> results)
Retrieves all space elements that intersect the provided shape. |
|
protected SpaceElement |
getIntersection(ArrayList<SpaceElement> elements,
Ray2D ray,
Vector2f location,
com.google.common.base.Predicate<? super SpaceElement> filter)
Searches for an intersection with the supplied elements. |
|
SpaceElement |
getIntersection(Ray2D ray,
Vector2f location)
Checks for an intersection between the provided ray and the contents of the space. |
|
abstract 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. |
|
void |
remove(SpaceElement element)
Removes an element from the space. |
|
protected abstract void |
removeFromSpatial(SpaceElement element)
Removes an element from the space's spatial data structure. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected boolean _disposed
protected Vector2f _result
| Constructor Detail |
|---|
public Space()
| Method Detail |
|---|
public void add(SpaceElement element)
public void remove(SpaceElement element)
public SpaceElement getIntersection(Ray2D ray,
Vector2f location)
location - a vector to populate with the location of the intersection, if any.
null for
none.
public abstract SpaceElement getIntersection(Ray2D ray,
Vector2f location,
com.google.common.base.Predicate<? super SpaceElement> filter)
filter - a predicate to use in filtering the results of the test.location - a vector to populate with the location of the intersection, if any.
null for
none.
public void getIntersecting(Shape shape,
Collection<SpaceElement> results)
results - a collection to hold the results of the search.
public abstract void getIntersecting(Shape shape,
com.google.common.base.Predicate<? super SpaceElement> filter,
Collection<SpaceElement> results)
results - a collection to hold the results of the search.
public abstract void getElements(Rect bounds,
Collection<SpaceElement> results)
results - a list to hold the results of the search.public void boundsWillChange(SpaceElement element)
boundsDidChange(SpaceElement) when the change has been effected.
public void boundsDidChange(SpaceElement element)
public void dispose()
protected abstract void addToSpatial(SpaceElement element)
protected abstract void removeFromSpatial(SpaceElement element)
protected SpaceElement getIntersection(ArrayList<SpaceElement> elements,
Ray2D ray,
Vector2f location,
com.google.common.base.Predicate<? super SpaceElement> filter)
protected static void getIntersecting(ArrayList<SpaceElement> elements,
Shape shape,
com.google.common.base.Predicate<? super SpaceElement> filter,
Collection<SpaceElement> results)
protected static <T extends SpaceObject> void getIntersecting(ArrayList<T> objects,
Rect bounds,
Collection<T> results)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||