com.threerings.tudey.space
Class SimpleSpace

java.lang.Object
  extended by com.threerings.tudey.space.Space
      extended by com.threerings.tudey.space.SimpleSpace

public class SimpleSpace
extends Space

A simple, "flat" space implementation.


Constructor Summary
SimpleSpace()
           
 
Method Summary
 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, boundsDidChange, boundsWillChange, dispose, getIntersection, remove
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleSpace

public SimpleSpace()
Method Detail

getIntersection

public SpaceElement getIntersection(Ray2D ray,
                                    Vector2f location,
                                    Predicate<? super SpaceElement> filter)
Description copied from class: Space
Checks for an intersection between the provided ray and the contents of the space.

Specified by:
getIntersection in class Space
location - a vector to populate with the location of the intersection, if any.
filter - a predicate to use in filtering the results of the test.
Returns:
a reference to the first element intersected by the ray, or null for none.

getIntersecting

public void getIntersecting(Shape shape,
                            Collection<SpaceElement> results)
Description copied from class: Space
Retrieves all space elements that intersect the provided shape.

Specified by:
getIntersecting in class Space
results - a collection to hold the results of the search.

getElements

public void getElements(Rect bounds,
                        Collection<SpaceElement> results)
Description copied from class: Space
Retrieves all space elements whose bounds intersect the provided region.

Specified by:
getElements in class Space
results - a list to hold the results of the search.


Copyright © 2011. All Rights Reserved.