|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.threerings.tudey.shape.Shape
com.threerings.tudey.shape.Compound
public class Compound
A compound shape.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.threerings.tudey.shape.Shape |
|---|
Shape.IntersectionType |
| Constructor Summary | |
|---|---|
Compound(int scount)
Creates an uninitialized compound. |
|
Compound(Shape... shapes)
Creates a compound containing the supplied shapes (which will be referenced, not copied). |
|
| Method Summary | |
|---|---|
ShapeConfig |
createConfig()
Creates a config corresponding to this shape. |
void |
draw(boolean outline)
Draws this shape in immediate mode. |
Shape |
expand(float amount,
Shape result)
Expands this shape, placing the result in the provided object if possible. |
Vector2f |
getCenter(Vector2f result)
Retrieves the center of the shape and places it in the supplied vector. |
boolean |
getIntersection(Ray2D ray,
Vector2f result)
Finds the intersection of a ray with this shape and places it in the supplied vector (if it exists). |
Shape.IntersectionType |
getIntersectionType(Rect rect)
Checks whether the intersector intersects the specified rect. |
void |
getNearestPoint(Vector2f point,
Vector2f result)
Fins the nearest point of this element to the supplied point and places it in the supplied vector. |
Vector2f |
getPenetration(Capsule capsule,
Vector2f result)
Finds the penetration of the specified capsule into this shape. |
Vector2f |
getPenetration(Circle circle,
Vector2f result)
Finds the penetration of the specified circle into this shape. |
Vector2f |
getPenetration(Compound compound,
Vector2f result)
Finds the penetration of the specified compound into this shape. |
Vector2f |
getPenetration(Point point,
Vector2f result)
Finds the penetration of the specified point into this shape. |
Vector2f |
getPenetration(Polygon polygon,
Vector2f result)
Finds the penetration of the specified polygon into this shape. |
Vector2f |
getPenetration(Segment segment,
Vector2f result)
Finds the penetration of the specified segment into this shape. |
Vector2f |
getPenetration(Shape shape,
Vector2f result)
Finds the penetration of the specified shape into this one, assuming that they intersect. |
Shape |
getShape(int idx)
Returns a reference to the indexed shape. |
int |
getShapeCount()
Returns the number of shapes in this compound. |
Shape[] |
getShapes()
Returns a reference to the array of shapes. |
boolean |
intersects(Capsule capsule)
Checks for an intersection with this shape and the specified capsule. |
boolean |
intersects(Circle circle)
Checks for an intersection with this shape and the specified circle. |
boolean |
intersects(Compound compound)
Checks for an intersection with this shape and the specified compound. |
boolean |
intersects(Point point)
Checks for an intersection with this shape and the specified point. |
boolean |
intersects(Polygon polygon)
Checks for an intersection with this shape and the specified polygon. |
boolean |
intersects(Segment segment)
Checks for an intersection with this shape and the specified segment. |
boolean |
intersects(Shape shape)
Determines whether this shape intersects the specified shape. |
boolean |
intersects(SpaceElement element)
Determines whether this shape intersects the specified element. |
Shape |
sweep(Vector2f translation,
Shape result)
Computes the shape created by sweeping this shape along the specified translation vector, placing the result in the provided object if possible. |
String |
toString()
|
Shape |
transform(Transform2D transform,
Shape result)
Transforms this shape, placing the result in the provided object if possible. |
void |
updateBounds()
Updates the bounds of the shape. |
| Methods inherited from class com.threerings.tudey.shape.Shape |
|---|
expand, expandLocal, getBounds, getCenter, getPenetration, getPerimeterPath, intersects, sweep, transform, transformLocal |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Compound(Shape... shapes)
public Compound(int scount)
| Method Detail |
|---|
public int getShapeCount()
public Shape getShape(int idx)
public Shape[] getShapes()
public void updateBounds()
Shape
updateBounds in class Shapepublic Vector2f getCenter(Vector2f result)
Shape
getCenter in class Shape
public Shape transform(Transform2D transform,
Shape result)
Shape
transform in class Shape
public Shape expand(float amount,
Shape result)
Shape
expand in class Shape
public Shape sweep(Vector2f translation,
Shape result)
Shape
sweep in class Shape
public boolean getIntersection(Ray2D ray,
Vector2f result)
Shape
getIntersection in class Shape
public void getNearestPoint(Vector2f point,
Vector2f result)
Shape
getNearestPoint in class Shapepublic Shape.IntersectionType getIntersectionType(Rect rect)
Shape
getIntersectionType in class Shapepublic boolean intersects(SpaceElement element)
ShapeSpaceElement.intersects(com.threerings.tudey.shape.Point).
intersects in class Shapepublic boolean intersects(Shape shape)
Shape
intersects in class Shapepublic boolean intersects(Point point)
Shape
intersects in class Shapepublic boolean intersects(Segment segment)
Shape
intersects in class Shapepublic boolean intersects(Circle circle)
Shape
intersects in class Shapepublic boolean intersects(Capsule capsule)
Shape
intersects in class Shapepublic boolean intersects(Polygon polygon)
Shape
intersects in class Shapepublic boolean intersects(Compound compound)
Shape
intersects in class Shape
public Vector2f getPenetration(Shape shape,
Vector2f result)
Shape
getPenetration in class Shape
public Vector2f getPenetration(Point point,
Vector2f result)
Shape
getPenetration in class Shape
public Vector2f getPenetration(Segment segment,
Vector2f result)
Shape
getPenetration in class Shape
public Vector2f getPenetration(Circle circle,
Vector2f result)
Shape
getPenetration in class Shape
public Vector2f getPenetration(Capsule capsule,
Vector2f result)
Shape
getPenetration in class Shape
public Vector2f getPenetration(Polygon polygon,
Vector2f result)
Shape
getPenetration in class Shape
public Vector2f getPenetration(Compound compound,
Vector2f result)
Shape
getPenetration in class Shapepublic void draw(boolean outline)
Shape
draw in class Shapeoutline - if true, draw the outline of the shape; otherwise, the solid form.public ShapeConfig createConfig()
Shape
createConfig in class Shapepublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||