|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jbox2d.dynamics.Fixture
public class Fixture
A fixture is used to attach a shape to a body for collision detection. A fixture inherits its transform from its parent. Fixtures hold additional non-geometric data such as friction, collision filters, etc. Fixtures are created via Body::CreateFixture.
Field Summary | |
---|---|
Body |
m_body
|
float |
m_density
|
Filter |
m_filter
|
float |
m_friction
|
boolean |
m_isSensor
|
Fixture |
m_next
|
FixtureProxy[] |
m_proxies
|
int |
m_proxyCount
|
float |
m_restitution
|
Shape |
m_shape
|
Object |
m_userData
|
Constructor Summary | |
---|---|
Fixture()
|
Method Summary | |
---|---|
void |
create(Body body,
FixtureDef def)
|
void |
createProxies(BroadPhase broadPhase,
Transform xf)
|
void |
destroy()
|
void |
destroyProxies(BroadPhase broadPhase)
Internal method |
void |
dump(int bodyIndex)
Dump this fixture to the log file. |
AABB |
getAABB(int childIndex)
Get the fixture's AABB. |
Body |
getBody()
Get the parent body of this fixture. |
float |
getDensity()
|
Filter |
getFilterData()
Get the contact filtering data. |
float |
getFriction()
Get the coefficient of friction. |
void |
getMassData(MassData massData)
Get the mass data for this fixture. |
Fixture |
getNext()
Get the next fixture in the parent body's fixture list. |
float |
getRestitution()
Get the coefficient of restitution. |
Shape |
getShape()
Get the child shape. |
ShapeType |
getType()
Get the type of the child shape. |
Object |
getUserData()
Get the user data that was assigned in the fixture definition. |
boolean |
isSensor()
Is this fixture a sensor (non-solid)? |
boolean |
raycast(RayCastOutput output,
RayCastInput input,
int childIndex)
Cast a ray against this shape. |
void |
refilter()
Call this if you want to establish collision that was previously disabled by ContactFilter::ShouldCollide. |
void |
setDensity(float density)
|
void |
setFilterData(Filter filter)
Set the contact filtering data. |
void |
setFriction(float friction)
Set the coefficient of friction. |
void |
setRestitution(float restitution)
Set the coefficient of restitution. |
void |
setSensor(boolean sensor)
Set if this fixture is a sensor. |
void |
setUserData(Object data)
Set the user data. |
protected void |
synchronize(BroadPhase broadPhase,
Transform transform1,
Transform transform2)
Internal method |
boolean |
testPoint(Vec2 p)
Test a point for containment in this fixture. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public float m_density
public Fixture m_next
public Body m_body
public Shape m_shape
public float m_friction
public float m_restitution
public FixtureProxy[] m_proxies
public int m_proxyCount
public final Filter m_filter
public boolean m_isSensor
public Object m_userData
Constructor Detail |
---|
public Fixture()
Method Detail |
---|
public ShapeType getType()
public Shape getShape()
public boolean isSensor()
public void setSensor(boolean sensor)
sensor
- public void setFilterData(Filter filter)
filter
- public Filter getFilterData()
public void refilter()
public Body getBody()
public Fixture getNext()
public void setDensity(float density)
public float getDensity()
public Object getUserData()
public void setUserData(Object data)
data
- public boolean testPoint(Vec2 p)
p
- a point in world coordinates.
public boolean raycast(RayCastOutput output, RayCastInput input, int childIndex)
output
- the ray-cast results.input
- the ray-cast input parameters.output
- input
- public void getMassData(MassData massData)
public float getFriction()
public void setFriction(float friction)
friction
- public float getRestitution()
public void setRestitution(float restitution)
restitution
- public AABB getAABB(int childIndex)
public void dump(int bodyIndex)
bodyIndex
- public void create(Body body, FixtureDef def)
public void destroy()
public void createProxies(BroadPhase broadPhase, Transform xf)
public void destroyProxies(BroadPhase broadPhase)
broadPhase
- protected void synchronize(BroadPhase broadPhase, Transform transform1, Transform transform2)
broadPhase
- xf1
- xf2
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |