Package org.jbox2d.collision.shapes
Class EdgeShape
- java.lang.Object
-
- org.jbox2d.collision.shapes.Shape
-
- org.jbox2d.collision.shapes.EdgeShape
-
public class EdgeShape extends Shape
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.
-
-
Constructor Summary
Constructors Constructor Description EdgeShape()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Shape
clone()
void
computeAABB(AABB aabb, Transform xf, int childIndex)
Given a transform, compute the associated axis aligned bounding box for a child shape.void
computeMass(MassData massData, float density)
Compute the mass properties of this shape using its dimensions and density.int
getChildCount()
Get the number of child primitivesboolean
raycast(RayCastOutput output, RayCastInput input, Transform xf, int childIndex)
Cast a ray against a child shape.void
set(Vec2 v1, Vec2 v2)
boolean
testPoint(Transform xf, Vec2 p)
Test a point for containment in this shape.
-
-
-
Field Detail
-
m_vertex1
public final Vec2 m_vertex1
edge vertex 1
-
m_vertex2
public final Vec2 m_vertex2
edge vertex 2
-
m_vertex0
public final Vec2 m_vertex0
optional adjacent vertex 1. Used for smooth collision
-
m_vertex3
public final Vec2 m_vertex3
optional adjacent vertex 2. Used for smooth collision
-
m_hasVertex0
public boolean m_hasVertex0
-
m_hasVertex3
public boolean m_hasVertex3
-
normal
private final Vec2 normal
-
-
Method Detail
-
getChildCount
public int getChildCount()
Description copied from class:Shape
Get the number of child primitives- Specified by:
getChildCount
in classShape
- Returns:
-
testPoint
public boolean testPoint(Transform xf, Vec2 p)
Description copied from class:Shape
Test a point for containment in this shape. This only works for convex shapes.
-
raycast
public boolean raycast(RayCastOutput output, RayCastInput input, Transform xf, int childIndex)
Description copied from class:Shape
Cast a ray against a child shape.
-
computeAABB
public void computeAABB(AABB aabb, Transform xf, int childIndex)
Description copied from class:Shape
Given a transform, compute the associated axis aligned bounding box for a child shape.- Specified by:
computeAABB
in classShape
-
computeMass
public void computeMass(MassData massData, float density)
Description copied from class:Shape
Compute the mass properties of this shape using its dimensions and density. The inertia tensor is computed about the local origin.- Specified by:
computeMass
in classShape
- Parameters:
massData
- returns the mass data for this shape.density
- the density in kilograms per meter squared.
-
-