Package org.jbox2d.collision.shapes
Class EdgeShape
java.lang.Object
org.jbox2d.collision.shapes.Shape
org.jbox2d.collision.shapes.EdgeShape
A line segment (edge) shape. These can be connected in chains or loops to
other edge shapes. The connectivity information is used to ensure correct
contact normals.
- Author:
- Daniel Murphy
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()voidcomputeAABB(AABB aabb, Transform xf, int childIndex) Given a transform, compute the associated axis aligned bounding box for a child shape.floatcomputeDistanceToOut(Transform xf, Vec2 p, int childIndex, Vec2 normalOut) Compute the distance from the current shape to the specified point.voidcomputeMass(MassData massData, float density) Compute the mass properties of this shape using its dimensions and density.intGet the number of child primitivesbooleanraycast(RayCastOutput output, RayCastInput input, Transform xf, int childIndex) Cast a ray against a child shape.voidbooleanTest a point for containment in this shape.
-
Field Details
-
vertex1
edge vertex 1 -
vertex2
edge vertex 2 -
vertex0
optional adjacent vertex 1. Used for smooth collision -
vertex3
optional adjacent vertex 2. Used for smooth collision -
hasVertex0
public boolean hasVertex0 -
hasVertex3
public boolean hasVertex3
-
-
Constructor Details
-
EdgeShape
public EdgeShape()
-
-
Method Details
-
getChildCount
public int getChildCount()Description copied from class:ShapeGet the number of child primitives- Specified by:
getChildCountin classShape
-
set
-
testPoint
Description copied from class:ShapeTest a point for containment in this shape. This only works for convex shapes. -
computeDistanceToOut
Description copied from class:ShapeCompute the distance from the current shape to the specified point. This only works for convex shapes.- Specified by:
computeDistanceToOutin classShape- Parameters:
xf- The shape world transform.p- A point in world coordinates.normalOut- Returns the direction in which the distance increases.- Returns:
- distance returns the distance from the current shape.
-
raycast
Description copied from class:ShapeCast a ray against a child shape. -
computeAABB
Description copied from class:ShapeGiven a transform, compute the associated axis aligned bounding box for a child shape.- Specified by:
computeAABBin classShape- Parameters:
aabb- Returns the axis aligned box.xf- The world transform of the shape.
-
computeMass
Description copied from class:ShapeCompute the mass properties of this shape using its dimensions and density. The inertia tensor is computed about the local origin.- Specified by:
computeMassin classShape- Parameters:
massData- Returns the mass data for this shape.density- The density in kilograms per meter squared.
-
clone
-