public abstract class Shape extends Object
| Modifier and Type | Method and Description |
|---|---|
abstract Shape |
clone() |
abstract void |
computeAABB(AABB aabb,
Transform xf,
int childIndex)
Given a transform, compute the associated axis aligned bounding box for a child shape.
|
abstract float |
computeDistanceToOut(Transform xf,
Vec2 p,
int childIndex,
Vec2 normalOut)
Compute the distance from the current shape to the specified point.
|
abstract void |
computeMass(MassData massData,
float density)
Compute the mass properties of this shape using its dimensions and density.
|
abstract int |
getChildCount() |
float |
getRadius()
The radius of the underlying shape.
|
ShapeType |
getType()
Get the type of this shape.
|
abstract boolean |
raycast(RayCastOutput output,
RayCastInput input,
Transform transform,
int childIndex)
Cast a ray against a child shape.
|
void |
setRadius(float radius)
Sets the radius of the underlying shape.
|
abstract boolean |
testPoint(Transform xf,
Vec2 p)
Test a point for containment in this shape.
|
public Shape(ShapeType type, float radius)
public ShapeType getType()
public float getRadius()
public void setRadius(float radius)
radius - shape radiuspublic abstract int getChildCount()
public abstract boolean testPoint(Transform xf, Vec2 p)
xf - the shape world transform.p - a point in world coordinates.public abstract boolean raycast(RayCastOutput output, RayCastInput input, Transform transform, int childIndex)
output - the ray-cast results.input - the ray-cast input parameters.transform - the transform to be applied to the shape.childIndex - the child shape indexpublic abstract void computeAABB(AABB aabb, Transform xf, int childIndex)
aabb - returns the axis aligned boxxf - the world transform of the shapechildIndex - the child shape indexpublic abstract void computeMass(MassData massData, float density)
massData - returns the mass data for this shape.density - the density in kilograms per meter squared.public abstract float computeDistanceToOut(Transform xf, Vec2 p, int childIndex, Vec2 normalOut)
xf - the shape world transform.p - a point in world coordinates.normalOut - returns the direction in which the distance increases.Copyright © 2018. All rights reserved.