Class b2Fixture
A shape attached to a body, with its density, friction, restitution and filter. Created by b2Body, never directly; destroying its body destroys it.
public class b2Fixture
- Inheritance
-
b2Fixture
- Inherited Members
- Extension Methods
Remarks
Reference: Box2D/Dynamics/b2Fixture.cpp.
Properties
Body
The body (pybox2d's body).
public b2Body Body { get; }
Property Value
Density
The density (pybox2d's density); the body's mass changes only at its next ResetMassData.
public float Density { get; set; }
Property Value
Exceptions
- AssertionError
Thrown by the setter for a negative or non-finite density.
FilterData
The filter (pybox2d's filterData); setting it flags the fixture's contacts for re-filtering.
public b2Filter FilterData { get; set; }
Property Value
Friction
The friction (pybox2d's friction); existing contacts keep their mixed friction.
public float Friction { get; set; }
Property Value
Restitution
The restitution (pybox2d's restitution); existing contacts keep their mixed restitution.
public float Restitution { get; set; }
Property Value
Sensor
Whether the fixture is a sensor (pybox2d's sensor); changing it wakes the body.
public bool Sensor { get; set; }
Property Value
Shape
The fixture's own shape (pybox2d's shape): a clone of the definition's, so changing it changes the fixture.
public b2Shape Shape { get; }
Property Value
Type
The shape kind (pybox2d's type).
public b2ShapeType Type { get; }
Property Value
UserData
The user data (pybox2d's userData).
public object? UserData { get; set; }
Property Value
Methods
TestPoint(b2Vec2)
Whether a world point lies inside the fixture (pybox2d's TestPoint); never true for an edge.
public bool TestPoint(b2Vec2 p)
Parameters
pb2Vec2The point.
Returns
- bool
True when inside.