Table of Contents

Class b2Fixture

Namespace
Gym.Box2D
Assembly
Gym.Environments.dll

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

Properties

Body

The body (pybox2d's body).

public b2Body Body { get; }

Property Value

b2Body

Density

The density (pybox2d's density); the body's mass changes only at its next ResetMassData.

public float Density { get; set; }

Property Value

float

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

b2Filter

Friction

The friction (pybox2d's friction); existing contacts keep their mixed friction.

public float Friction { get; set; }

Property Value

float

Restitution

The restitution (pybox2d's restitution); existing contacts keep their mixed restitution.

public float Restitution { get; set; }

Property Value

float

Sensor

Whether the fixture is a sensor (pybox2d's sensor); changing it wakes the body.

public bool Sensor { get; set; }

Property Value

bool

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

b2Shape

Type

The shape kind (pybox2d's type).

public b2ShapeType Type { get; }

Property Value

b2ShapeType

UserData

The user data (pybox2d's userData).

public object? UserData { get; set; }

Property Value

object

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

p b2Vec2

The point.

Returns

bool

True when inside.