public abstract class Fixture extends Object
Modifier and Type | Method and Description |
---|---|
boolean |
contains(Vec2 p)
Is the point inside this fixture?
|
void |
destroy()
Remove this fixture from the parent body and the world.
|
Body |
getBody()
The body of which this fixture forms a part.
|
float |
getDensity()
The current density of this fixture.
|
boolean |
intersects(Fixture f)
Does this fixture currently overlap a given other fixture.
|
boolean |
intersects(Vec2 centre,
float halfWidth,
float halfHeight)
Does this fixture currently overlap a given axis-aligned rectangle.
|
void |
setDensity(float density)
Set the density of this fixture.
|
public void destroy()
public void setDensity(float density)
density
- the new density (in kg per square metre)public float getDensity()
public Body getBody()
public boolean contains(Vec2 p)
p
- a point in world coordinatespublic boolean intersects(Fixture f)
f
- the other fixturepublic boolean intersects(Vec2 centre, float halfWidth, float halfHeight)
centre
- the centre of the rectangle in world coordinateshalfWidth
- the half width of the rectangle in world unitshalfHeight
- the half height of the rectangle in world units