Table of Contents

Class b2Shape

Namespace
Gym.Box2D
Assembly
Gym.Environments.dll

A collision shape, the geometry a b2Fixture carries. Shapes hold no body: a fixture clones the shape it is created from, so changing a shape object afterwards changes nothing in the world.

public abstract class b2Shape
Inheritance
b2Shape
Derived
Inherited Members
Extension Methods

Remarks

Box2D's shape kinds outside this port (chains) are left out because no Gymnasium environment uses them; the internal abstract members keep users from deriving their own shapes, which the contact factory could not collide.

Reference: Box2D/Collision/Shapes/b2Shape.h.

Properties

ChildCount

The number of child primitives (pybox2d's childCount; 1 for every shape here).

public int ChildCount { get; }

Property Value

int

Radius

The radius (pybox2d's radius): a circle's, or the polygon and edge skin, b2_polygonRadius.

public float Radius { get; set; }

Property Value

float

Type

The shape kind (pybox2d's type).

public b2ShapeType Type { get; }

Property Value

b2ShapeType