public class ChainShape extends Shape
| Modifier and Type | Field and Description |
|---|---|
int |
m_count |
Vec2[] |
m_vertices |
| Constructor and Description |
|---|
ChainShape() |
| Modifier and Type | Method and 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.
|
float |
computeDistanceToOut(Transform xf,
Vec2 p,
int childIndex,
Vec2 normalOut)
Compute the distance from the current shape to the specified point.
|
void |
computeMass(MassData massData,
float density)
Compute the mass properties of this shape using its dimensions and density.
|
void |
createChain(Vec2[] vertices,
int count)
Create a chain with isolated end vertices.
|
void |
createLoop(Vec2[] vertices,
int count)
Create a loop.
|
int |
getChildCount() |
void |
getChildEdge(EdgeShape edge,
int index)
Get a child edge.
|
boolean |
raycast(RayCastOutput output,
RayCastInput input,
Transform xf,
int childIndex)
Cast a ray against a child shape.
|
void |
setNextVertex(Vec2 nextVertex)
Establish connectivity to a vertex that follows the last vertex.
|
void |
setPrevVertex(Vec2 prevVertex)
Establish connectivity to a vertex that precedes the first vertex.
|
boolean |
testPoint(Transform xf,
Vec2 p)
Test a point for containment in this shape.
|
public Vec2[] m_vertices
public int m_count
public int getChildCount()
getChildCount in class Shapepublic void getChildEdge(EdgeShape edge, int index)
public float computeDistanceToOut(Transform xf, Vec2 p, int childIndex, Vec2 normalOut)
ShapecomputeDistanceToOut in class Shapexf - the shape world transform.p - a point in world coordinates.normalOut - returns the direction in which the distance increases.public boolean testPoint(Transform xf, Vec2 p)
Shapepublic boolean raycast(RayCastOutput output, RayCastInput input, Transform xf, int childIndex)
Shapepublic void computeAABB(AABB aabb, Transform xf, int childIndex)
ShapecomputeAABB in class Shapeaabb - returns the axis aligned boxxf - the world transform of the shapechildIndex - the child shape indexpublic void computeMass(MassData massData, float density)
ShapecomputeMass in class ShapemassData - returns the mass data for this shape.density - the density in kilograms per meter squared.public void createLoop(Vec2[] vertices, int count)
vertices - an array of vertices, these are copiedcount - the vertex countpublic void createChain(Vec2[] vertices, int count)
vertices - an array of vertices, these are copiedcount - the vertex countpublic void setPrevVertex(Vec2 prevVertex)
prevVertex - public void setNextVertex(Vec2 nextVertex)
nextVertex - Copyright © 2017. All rights reserved.