|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jbox2d.collision.shapes.Shape
org.jbox2d.collision.shapes.EdgeShape
public class EdgeShape
An edge shape. Create using Body.createShape(ShapeDef)
with an EdgeChainDef
,
not the constructor here.
Body.createShape(ShapeDef)
,
EdgeChainDef
Field Summary |
---|
Fields inherited from class org.jbox2d.collision.shapes.Shape |
---|
m_body, m_density, m_filter, m_friction, m_isSensor, m_next, m_proxyId, m_restitution, m_sweepRadius, m_type, m_userData, uid |
Constructor Summary | |
---|---|
EdgeShape(Vec2 v1,
Vec2 v2,
ShapeDef def)
Don't use this. |
Method Summary | |
---|---|
void |
computeAABB(AABB aabb,
XForm transform)
Given a transform, compute the associated axis aligned bounding box for this shape. |
void |
computeMass(MassData massData)
Compute the mass properties of this shape using its dimensions and density. |
void |
computeSweptAABB(AABB aabb,
XForm transform1,
XForm transform2)
Given two transforms, compute the associated swept axis aligned bounding box for this shape. |
boolean |
corner1IsConvex()
|
boolean |
corner2IsConvex()
|
Vec2 |
getCoreVertex1()
"Core" vertex with TOI slop for b2Distance functions |
Vec2 |
getCoreVertex2()
"Core" vertex with TOI slop for b2Distance functions |
Vec2 |
getCorner1Vector()
|
Vec2 |
getCorner2Vector()
|
Vec2 |
getDirectionVector()
Parallel unit vector, pointing from vertex1 to vertex2 |
void |
getFirstVertexToOut(XForm xf,
Vec2 out)
|
float |
getLength()
Linear distance from vertex1 to vertex2 |
EdgeShape |
getNextEdge()
Get the next edge in the chain. |
Vec2 |
getNormalVector()
Perpendecular unit vector point, pointing from the solid side to the empty side. |
EdgeShape |
getPrevEdge()
Get the previous edge in the chain. |
Vec2 |
getVertex1()
Local position of vertex in parent body |
Vec2 |
getVertex2()
Local position of vertex in parent body |
void |
setNextEdge(EdgeShape edge,
Vec2 core,
Vec2 cornerDir,
boolean convex)
|
void |
setPrevEdge(EdgeShape edge,
Vec2 core,
Vec2 cornerDir,
boolean convex)
|
void |
support(Vec2 dest,
XForm xf,
Vec2 d)
|
boolean |
testPoint(XForm transform,
Vec2 p)
Test a point for containment in this shape. |
void |
updateSweepRadius(Vec2 center)
Internal |
Methods inherited from class org.jbox2d.collision.shapes.Shape |
---|
create, createProxy, destroy, destroyProxy, destructor, getBody, getFilterData, getFriction, getNext, getRestitution, getSweepRadius, getType, getUserData, isSensor, refilterProxy, setFilterData, setFriction, setRestitution, setUserData, synchronize |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EdgeShape(Vec2 v1, Vec2 v2, ShapeDef def)
Body.createShape(ShapeDef)
with an
EdgeChainDef
, not the constructor here.
v1
- v2
- def
- Body.createShape(ShapeDef)
,
EdgeChainDef
Method Detail |
---|
public void updateSweepRadius(Vec2 center)
Shape
updateSweepRadius
in class Shape
Shape.updateSweepRadius(Vec2)
public boolean testPoint(XForm transform, Vec2 p)
Shape
testPoint
in class Shape
transform
- the shape world transform.p
- a point in world coordinates.
Shape.testPoint(XForm, Vec2)
public void computeAABB(AABB aabb, XForm transform)
Shape
computeAABB
in class Shape
aabb
- returns the axis aligned box.transform
- the world transform of the shape.Shape.computeAABB(AABB, XForm)
public void computeSweptAABB(AABB aabb, XForm transform1, XForm transform2)
Shape
computeSweptAABB
in class Shape
aabb
- returns the axis aligned box. (return parameter)transform1
- the starting shape world transform.transform2
- the ending shape world transform.Shape.computeSweptAABB(AABB, XForm, XForm)
public void computeMass(MassData massData)
Shape
computeMass
in class Shape
massData
- returns the mass data for this shape. (return parameter)Shape.computeMass(MassData)
public void support(Vec2 dest, XForm xf, Vec2 d)
support
in interface SupportsGenericDistance
SupportsGenericDistance.support(Vec2, XForm, Vec2)
public void setPrevEdge(EdgeShape edge, Vec2 core, Vec2 cornerDir, boolean convex)
public void setNextEdge(EdgeShape edge, Vec2 core, Vec2 cornerDir, boolean convex)
public float getLength()
public Vec2 getVertex1()
public Vec2 getVertex2()
public Vec2 getCoreVertex1()
public Vec2 getCoreVertex2()
public Vec2 getNormalVector()
public Vec2 getDirectionVector()
public Vec2 getCorner1Vector()
public Vec2 getCorner2Vector()
public EdgeShape getNextEdge()
public EdgeShape getPrevEdge()
public void getFirstVertexToOut(XForm xf, Vec2 out)
getFirstVertexToOut
in interface SupportsGenericDistance
SupportsGenericDistance.getFirstVertexToOut(XForm, Vec2)
public boolean corner1IsConvex()
public boolean corner2IsConvex()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |