|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.tudey.shape.Shape
public abstract class Shape
A Tudey shape.
| Nested Class Summary | |
|---|---|
static class |
Shape.IntersectionType
Intersection types indicating that the shape does not intersect, intersects, or fully contains, respectively, the parameter. |
| Field Summary | |
|---|---|
protected Rect |
_bounds
The bounds of the shape. |
protected static float |
CIRCLE_INCREMENT
The increment angle between circle segments. |
protected static int |
CIRCLE_SEGMENTS
The number of segments to use when we render circles. |
| Constructor Summary | |
|---|---|
Shape()
|
|
| Method Summary | |
|---|---|
abstract ShapeConfig |
createConfig()
Creates a config corresponding to this shape. |
abstract void |
draw(boolean outline)
Draws this shape in immediate mode. |
Shape |
expand(float amount)
Expands this shape by the specified amount. |
abstract Shape |
expand(float amount,
Shape result)
Expands this shape, placing the result in the provided object if possible. |
Shape |
expandLocal(float amount)
Expands this shape in-place by the specified amount. |
Rect |
getBounds()
Returns a reference to the bounds of the shape. |
Vector2f |
getCenter()
Retrieves the center of the shape. |
abstract Vector2f |
getCenter(Vector2f result)
Retrieves the center of the shape and places it in the supplied vector. |
abstract 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). |
abstract Shape.IntersectionType |
getIntersectionType(Rect rect)
Checks whether the intersector intersects the specified rect. |
protected static Vector2f |
getMinMinkowskyDifference(Vector2f[] A,
Vector2f[] B,
float radius,
Vector2f minDistance)
Calculates the minimum distance to the origin for the A polygon edges in the convex hull of the Minkowski difference of the A and B polygons. |
abstract void |
getNearestPoint(Vector2f point,
Vector2f result)
Fins the nearest point of this element to the supplied point and places it in the supplied vector. |
protected static void |
getOutsideLinePenetration(Vector2f start,
Vector2f end,
float radius,
Vector2f point,
Vector2f result)
|
abstract Vector2f |
getPenetration(Capsule capsule,
Vector2f result)
Finds the penetration of the specified capsule into this shape. |
abstract Vector2f |
getPenetration(Circle circle,
Vector2f result)
Finds the penetration of the specified circle into this shape. |
abstract Vector2f |
getPenetration(Compound compound,
Vector2f result)
Finds the penetration of the specified compound into this shape. |
Vector2f |
getPenetration(None none,
Vector2f result)
Shapes never penetrate none. |
abstract Vector2f |
getPenetration(Point point,
Vector2f result)
Finds the penetration of the specified point into this shape. |
abstract Vector2f |
getPenetration(Polygon polygon,
Vector2f result)
Finds the penetration of the specified polygon into this shape. |
abstract Vector2f |
getPenetration(Segment segment,
Vector2f result)
Finds the penetration of the specified segment into this shape. |
abstract Vector2f |
getPenetration(Shape shape,
Vector2f result)
Finds the penetration of the specified shape into this one, assuming that they intersect. |
Vector2f[] |
getPerimeterPath()
Returns a perimeter path for this shape. |
abstract boolean |
intersects(Capsule capsule)
Checks for an intersection with this shape and the specified capsule. |
abstract boolean |
intersects(Circle circle)
Checks for an intersection with this shape and the specified circle. |
abstract boolean |
intersects(Compound compound)
Checks for an intersection with this shape and the specified compound. |
boolean |
intersects(None none)
Shapes can never intserct none. |
abstract boolean |
intersects(Point point)
Checks for an intersection with this shape and the specified point. |
abstract boolean |
intersects(Polygon polygon)
Checks for an intersection with this shape and the specified polygon. |
abstract boolean |
intersects(Segment segment)
Checks for an intersection with this shape and the specified segment. |
abstract boolean |
intersects(Shape shape)
Determines whether this shape intersects the specified shape. |
abstract boolean |
intersects(SpaceElement element)
Determines whether this shape intersects the specified element. |
protected static boolean |
intersects(Vector2f center,
float radius,
Vector2f start,
Vector2f end)
Determines whether the line segment from start to end intersects
the circle with the given center and radius. |
protected static boolean |
intersects(Vector2f start,
Vector2f end,
float radius,
Vector2f origin,
Vector2f terminus)
Determines whether the capsule from start to end with the
specified radius intersects the line segment with the supplied origin and terminus. |
protected static void |
nearestPointOnSegment(Vector2f start,
Vector2f end,
Vector2f point,
Vector2f result)
Finds the nearest point on the line segment from start to end to
a point point and stores it in result. |
Shape |
sweep(Vector2f translation)
Computes the shape created by sweeping this shape along the specified translation vector. |
abstract 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. |
Shape |
transform(Transform2D transform)
Transforms this shape. |
abstract Shape |
transform(Transform2D transform,
Shape result)
Transforms this shape, placing the result in the provided object if possible. |
Shape |
transformLocal(Transform2D transform)
Transforms this shape in-place. |
abstract void |
updateBounds()
Updates the bounds of the shape. |
protected static Vector2f |
updateClosest(Vector2f origin,
Vector2f result,
Vector2f closest)
Updates the value of the closest point and returns a new result vector reference. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Rect _bounds
protected static final int CIRCLE_SEGMENTS
protected static final float CIRCLE_INCREMENT
| Constructor Detail |
|---|
public Shape()
| Method Detail |
|---|
public Rect getBounds()
public abstract void updateBounds()
public Vector2f getCenter()
public abstract Vector2f getCenter(Vector2f result)
public Shape transformLocal(Transform2D transform)
public Shape transform(Transform2D transform)
public abstract Shape transform(Transform2D transform,
Shape result)
public Shape expandLocal(float amount)
public Shape expand(float amount)
public abstract Shape expand(float amount,
Shape result)
public Shape sweep(Vector2f translation)
public abstract Shape sweep(Vector2f translation,
Shape result)
public Vector2f[] getPerimeterPath()
public abstract boolean getIntersection(Ray2D ray,
Vector2f result)
public abstract void getNearestPoint(Vector2f point,
Vector2f result)
public abstract Shape.IntersectionType getIntersectionType(Rect rect)
public abstract boolean intersects(SpaceElement element)
SpaceElement.intersects(com.threerings.tudey.shape.Point).
public abstract boolean intersects(Shape shape)
public abstract boolean intersects(Point point)
public abstract boolean intersects(Segment segment)
public abstract boolean intersects(Circle circle)
public abstract boolean intersects(Capsule capsule)
public abstract boolean intersects(Polygon polygon)
public abstract boolean intersects(Compound compound)
public boolean intersects(None none)
public abstract Vector2f getPenetration(Shape shape,
Vector2f result)
public abstract Vector2f getPenetration(Point point,
Vector2f result)
public abstract Vector2f getPenetration(Segment segment,
Vector2f result)
public abstract Vector2f getPenetration(Circle circle,
Vector2f result)
public abstract Vector2f getPenetration(Capsule capsule,
Vector2f result)
public abstract Vector2f getPenetration(Polygon polygon,
Vector2f result)
public abstract Vector2f getPenetration(Compound compound,
Vector2f result)
public Vector2f getPenetration(None none,
Vector2f result)
public abstract void draw(boolean outline)
outline - if true, draw the outline of the shape; otherwise, the solid form.public abstract ShapeConfig createConfig()
protected static Vector2f updateClosest(Vector2f origin,
Vector2f result,
Vector2f closest)
protected static boolean intersects(Vector2f start,
Vector2f end,
float radius,
Vector2f origin,
Vector2f terminus)
start to end with the
specified radius intersects the line segment with the supplied origin and terminus.
protected static boolean intersects(Vector2f center,
float radius,
Vector2f start,
Vector2f end)
start to end intersects
the circle with the given center and radius.
protected static void nearestPointOnSegment(Vector2f start,
Vector2f end,
Vector2f point,
Vector2f result)
start to end to
a point point and stores it in result.
protected static void getOutsideLinePenetration(Vector2f start,
Vector2f end,
float radius,
Vector2f point,
Vector2f result)
protected static Vector2f getMinMinkowskyDifference(Vector2f[] A,
Vector2f[] B,
float radius,
Vector2f minDistance)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||