public final class Fixture extends Object
Modifier and Type | Method and Description |
---|---|
float |
computeDistance(Vec2 p,
int childIndex,
Vec2 normalOut)
Compute the distance from this fixture.
|
boolean |
containsPoint(Vec2 p)
Test a point for containment in this fixture.
|
AABB |
getAABB(int childIndex)
This AABB may be enlarged and/or stale.
|
Body |
getBody() |
float |
getDensity() |
Filter |
getFilterData() |
float |
getFriction() |
void |
getMassData(MassData massData)
Get the mass data for this fixture.
|
float |
getRestitution() |
Shape |
getShape()
You can modify the child shape, however you should not change the number
of vertices because this will crash some collision caching mechanisms.
|
ShapeType |
getType() |
Object |
getUserData()
The same as in the fixture definition, unless explicitly changed.
|
boolean |
isSensor() |
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)
This will NOT change the friction of existing contacts.
|
void |
setRestitution(float restitution)
This will NOT change the restitution of existing contacts.
|
void |
setSensor(boolean sensor)
Set if this fixture is a sensor.
|
void |
setUserData(Object data)
Set the user data.
|
public Body getBody()
public Shape getShape()
public ShapeType getType()
public Filter getFilterData()
public void setFilterData(Filter filter)
filter
- filterpublic Object getUserData()
public void setUserData(Object data)
data
- user datapublic float getDensity()
public void setDensity(float density)
public float getFriction()
public void setFriction(float friction)
public float getRestitution()
public void setRestitution(float restitution)
public boolean isSensor()
public void setSensor(boolean sensor)
public void refilter()
public boolean containsPoint(Vec2 p)
p
- a point in world coordinatespublic boolean raycast(RayCastOutput output, RayCastInput input, int childIndex)
output
- the ray-cast resultsinput
- the ray-cast input parameterspublic void getMassData(MassData massData)
public AABB getAABB(int childIndex)
Copyright © 2018. All rights reserved.