|
||||||||||
| 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.Capsule
public class Capsule
A capsule.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.threerings.tudey.shape.Shape |
|---|
Shape.IntersectionType |
| Field Summary | |
|---|---|
float |
radius
The radius of the capsule. |
| Constructor Summary | |
|---|---|
Capsule()
Creates an uninitialized capsule. |
|
Capsule(Vector2f start,
Vector2f end,
float radius)
Creates a capsule with the supplied center and radius. |
|
| Method Summary | |
|---|---|
boolean |
contains(float x,
float y)
Checks whether the capsule contains the specified point. |
boolean |
contains(Vector2f pt)
Checks whether the capsule contains the specified point. |
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. |
Vector2f |
getEnd()
Returns a reference to the end vertex. |
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. |
Vector2f |
getStart()
Returns a reference to the start vertex. |
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 |
| Field Detail |
|---|
public float radius
| Constructor Detail |
|---|
public Capsule(Vector2f start,
Vector2f end,
float radius)
public Capsule()
| Method Detail |
|---|
public Vector2f getStart()
public Vector2f getEnd()
public boolean contains(Vector2f pt)
public boolean contains(float x,
float y)
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 | |||||||||