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.
More...
|
AfterCollisionEventHandler | AfterCollision |
| Fires after two shapes has collided and are solved. This gives you a chance to get the impact force. More...
|
|
BeforeCollisionEventHandler | BeforeCollision |
| Fires when two fixtures are close to each other. Due to how the broadphase works, this can be quite inaccurate as shapes are approximated using AABBs. More...
|
|
OnCollisionEventHandler | OnCollision |
| Fires when two shapes collide and a contact is created between them. Note that the first fixture argument is always the fixture that the delegate is subscribed to. More...
|
|
OnSeparationEventHandler | OnSeparation |
| Fires when two shapes separate and a contact is removed between them. Note: This can in some cases be called multiple times, as a fixture can have multiple contacts. Note The first fixture argument is always the fixture that the delegate is subscribed to. More...
|
|
object | Tag |
| Set the user data. Use this to store your application specific data. More...
|
|
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.
◆ CloneOnto()
Clones the fixture onto the specified body.
- Parameters
-
body | The body you wish to clone the fixture onto. |
- Returns
- The cloned fixture.
◆ GetAABB()
void GetAABB |
( |
out AABB |
aabb, |
|
|
int |
childIndex |
|
) |
| |
Get the fixture's AABB. This AABB may be enlarge and/or stale. If you need a more accurate AABB, compute it using the Shape and the body transform.
- Parameters
-
aabb | The aabb. |
childIndex | Index of the child. |
◆ RayCast()
Cast a ray against this Shape.
- Parameters
-
output | The ray-cast results. |
input | The ray-cast input parameters. |
childIndex | Index of the child. |
- Returns
◆ TestPoint()
bool TestPoint |
( |
ref Vector2 |
point | ) |
|
Test a point for containment in this fixture.
- Parameters
-
point | A point in world coordinates. |
- Returns
◆ AfterCollision
AfterCollisionEventHandler AfterCollision |
Fires after two shapes has collided and are solved. This gives you a chance to get the impact force.
◆ BeforeCollision
BeforeCollisionEventHandler BeforeCollision |
Fires when two fixtures are close to each other. Due to how the broadphase works, this can be quite inaccurate as shapes are approximated using AABBs.
◆ OnCollision
OnCollisionEventHandler OnCollision |
Fires when two shapes collide and a contact is created between them. Note that the first fixture argument is always the fixture that the delegate is subscribed to.
◆ OnSeparation
OnSeparationEventHandler OnSeparation |
Fires when two shapes separate and a contact is removed between them. Note: This can in some cases be called multiple times, as a fixture can have multiple contacts. Note The first fixture argument is always the fixture that the delegate is subscribed to.
◆ Tag
Set the user data. Use this to store your application specific data.
The user data.
◆ Body
Get the parent body of this fixture. This is null if the fixture is not attached.
The body.
◆ CollidesWith
Defaults to Category.All
The collision mask bits. This states the categories that this fixture would accept for collision.
◆ CollisionCategories
Category CollisionCategories |
|
getset |
The collision categories this fixture is a part of.
Defaults to Category.Cat1
◆ CollisionGroup
Defaults to 0
Collision groups allow a certain group of objects to never collide (negative) or always collide (positive). Zero means no collision group. Non-zero group filtering always wins against the mask bits.
◆ Friction
Set the coefficient of friction. This will not change the friction of existing contacts.
The friction.
◆ IsSensor
Gets or sets a value indicating whether this fixture is a sensor.
true
if this instance is a sensor; otherwise, false
.
◆ Restitution
Set the coefficient of restitution. This will not change the restitution of existing contacts.
The restitution.
◆ Shape
Get the child Shape.
The shape.
The documentation for this class was generated from the following file:
- Physics2D/Dynamics/Fixture.cs