Skip to Content
defold-typescript
Get startedGuidesAPILibraries
Defold

b2d.shape30 new

Constants for functional shape tables used with b2d.body.create_fixture and returned from b2d.fixture.get_shape.

Functions

b2d.shape.are_contact_events_enabled(2 overloads): booleanN

  • Since Defold 1.13.0

Check if contact events are enabled for a shape.

  1. (shape_id: Opaque<"b2Shape">)

    Parameters

    • shape_id: Opaque<"b2Shape"> — shape handle from a shape info table, or pass body, shape_index
  2. (body: Opaque<"b2Body">, shape_index: number)

    Parameters

    • body: Opaque<"b2Body"> — The body that owns the shape.
    • shape_index: number — The shape's position on that body, in the order b2d.body.get_shapes lists them. ⚠️ 1-based; passed to Defold unchanged.

Returns

  • enabled: boolean — true if contact events are enabled

b2d.shape.are_hit_events_enabled(2 overloads): booleanN

  • Since Defold 1.13.0

Check if hit events are enabled for a shape.

  1. (shape_id: Opaque<"b2Shape">)

    Parameters

    • shape_id: Opaque<"b2Shape"> — shape handle from a shape info table, or pass body, shape_index
  2. (body: Opaque<"b2Body">, shape_index: number)

    Parameters

    • body: Opaque<"b2Body"> — The body that owns the shape.
    • shape_index: number — The shape's position on that body, in the order b2d.body.get_shapes lists them. ⚠️ 1-based; passed to Defold unchanged.

Returns

  • enabled: boolean — true if hit events are enabled

b2d.shape.are_pre_solve_events_enabled(2 overloads): booleanN

  • Since Defold 1.13.0

Check if pre-solve events are enabled for a shape.

  1. (shape_id: Opaque<"b2Shape">)

    Parameters

    • shape_id: Opaque<"b2Shape"> — shape handle from a shape info table, or pass body, shape_index
  2. (body: Opaque<"b2Body">, shape_index: number)

    Parameters

    • body: Opaque<"b2Body"> — The body that owns the shape.
    • shape_index: number — The shape's position on that body, in the order b2d.body.get_shapes lists them. ⚠️ 1-based; passed to Defold unchanged.

Returns

  • enabled: boolean — true if pre-solve events are enabled

b2d.shape.are_sensor_events_enabled(2 overloads): booleanN

  • Since Defold 1.13.0

Check if sensor events are enabled for a shape.

  1. (shape_id: Opaque<"b2Shape">)

    Parameters

    • shape_id: Opaque<"b2Shape"> — shape handle from a shape info table, or pass body, shape_index
  2. (body: Opaque<"b2Body">, shape_index: number)

    Parameters

    • body: Opaque<"b2Body"> — The body that owns the shape.
    • shape_index: number — The shape's position on that body, in the order b2d.body.get_shapes lists them. ⚠️ 1-based; passed to Defold unchanged.

Returns

  • enabled: boolean — true if sensor events are enabled

b2d.shape.enable_contact_events(2 overloads): voidN

  • Since Defold 1.13.0

Enable or disable contact events for a shape.

  1. (shape_id: Opaque<"b2Shape">, enable: boolean)

    Parameters

    • shape_id: Opaque<"b2Shape"> — shape handle from a shape info table, or pass body, shape_index
    • enable: boolean — true to enable contact events
  2. (body: Opaque<"b2Body">, shape_index: number, enable: boolean)

    Parameters

    • body: Opaque<"b2Body"> — The body that owns the shape.
    • shape_index: number — The shape's position on that body, in the order b2d.body.get_shapes lists them. ⚠️ 1-based; passed to Defold unchanged.
    • enable: boolean — true to enable contact events

b2d.shape.enable_hit_events(2 overloads): voidN

  • Since Defold 1.13.0

Enable or disable hit events for a shape.

  1. (shape_id: Opaque<"b2Shape">, enable: boolean)

    Parameters

    • shape_id: Opaque<"b2Shape"> — shape handle from a shape info table, or pass body, shape_index
    • enable: boolean — true to enable hit events
  2. (body: Opaque<"b2Body">, shape_index: number, enable: boolean)

    Parameters

    • body: Opaque<"b2Body"> — The body that owns the shape.
    • shape_index: number — The shape's position on that body, in the order b2d.body.get_shapes lists them. ⚠️ 1-based; passed to Defold unchanged.
    • enable: boolean — true to enable hit events

b2d.shape.enable_pre_solve_events(2 overloads): voidN

  • Since Defold 1.13.0

Enable or disable pre-solve events for a shape.

  1. (shape_id: Opaque<"b2Shape">, enable: boolean)

    Parameters

    • shape_id: Opaque<"b2Shape"> — shape handle from a shape info table, or pass body, shape_index
    • enable: boolean — true to enable pre-solve events
  2. (body: Opaque<"b2Body">, shape_index: number, enable: boolean)

    Parameters

    • body: Opaque<"b2Body"> — The body that owns the shape.
    • shape_index: number — The shape's position on that body, in the order b2d.body.get_shapes lists them. ⚠️ 1-based; passed to Defold unchanged.
    • enable: boolean — true to enable pre-solve events

b2d.shape.enable_sensor_events(2 overloads): voidN

  • Since Defold 1.13.0

Enable or disable sensor events for a shape.

  1. (shape_id: Opaque<"b2Shape">, enable: boolean)

    Parameters

    • shape_id: Opaque<"b2Shape"> — shape handle from a shape info table, or pass body, shape_index
    • enable: boolean — true to enable sensor events
  2. (body: Opaque<"b2Body">, shape_index: number, enable: boolean)

    Parameters

    • body: Opaque<"b2Body"> — The body that owns the shape.
    • shape_index: number — The shape's position on that body, in the order b2d.body.get_shapes lists them. ⚠️ 1-based; passed to Defold unchanged.
    • enable: boolean — true to enable sensor events

b2d.shape.get_body(2 overloads): Opaque<"b2Body">N

  • Since Defold 1.13.0

Get the body owning a shape.

  1. (shape_id: Opaque<"b2Shape">)

    Parameters

    • shape_id: Opaque<"b2Shape"> — shape handle from a shape info table, or pass body, shape_index
  2. (body: Opaque<"b2Body">, shape_index: number)

    Parameters

    • body: Opaque<"b2Body"> — The body that owns the shape.
    • shape_index: number — The shape's position on that body, in the order b2d.body.get_shapes lists them. ⚠️ 1-based; passed to Defold unchanged.

Returns

  • body: Opaque<"b2Body"> — owning body

b2d.shape.get_closest_point(2 overloads): Vector3N

  • Since Defold 1.13.0

Get the closest point on a shape.

  1. (shape_id: Opaque<"b2Shape">, target: Vector3)

    Parameters

    • shape_id: Opaque<"b2Shape"> — shape handle from a shape info table, or pass body, shape_index
    • target: Vector3 — world target point
  2. (body: Opaque<"b2Body">, shape_index: number, target: Vector3)

    Parameters

    • body: Opaque<"b2Body"> — The body that owns the shape.
    • shape_index: number — The shape's position on that body, in the order b2d.body.get_shapes lists them. ⚠️ 1-based; passed to Defold unchanged.
    • target: Vector3 — world target point

Returns

  • point: Vector3 — closest world point on the shape

b2d.shape.get_contact_capacity(2 overloads): numberN

  • Since Defold 1.13.0

Get shape contact capacity.

  1. (shape_id: Opaque<"b2Shape">)

    Parameters

    • shape_id: Opaque<"b2Shape"> — shape handle from a shape info table, or pass body, shape_index
  2. (body: Opaque<"b2Body">, shape_index: number)

    Parameters

    • body: Opaque<"b2Body"> — The body that owns the shape.
    • shape_index: number — The shape's position on that body, in the order b2d.body.get_shapes lists them. ⚠️ 1-based; passed to Defold unchanged.

Returns

  • capacity: number — maximum contact data count

b2d.shape.get_contact_data(2 overloads): b2d.ContactData[]N

  • Since Defold 1.13.0

Get touching contact data for a shape.

  1. (shape_id: Opaque<"b2Shape">)

    Parameters

    • shape_id: Opaque<"b2Shape"> — shape handle from a shape info table, or pass body, shape_index
  2. (body: Opaque<"b2Body">, shape_index: number)

    Parameters

    • body: Opaque<"b2Body"> — The body that owns the shape.
    • shape_index: number — The shape's position on that body, in the order b2d.body.get_shapes lists them. ⚠️ 1-based; passed to Defold unchanged.

Returns

b2d.shape.get_mass_data(2 overloads): b2d.MassDataN

  • Since Defold 1.13.0

Get mass data for a shape.

  1. (shape_id: Opaque<"b2Shape">)

    Parameters

    • shape_id: Opaque<"b2Shape"> — shape handle from a shape info table, or pass body, shape_index
  2. (body: Opaque<"b2Body">, shape_index: number)

    Parameters

    • body: Opaque<"b2Body"> — The body that owns the shape.
    • shape_index: number — The shape's position on that body, in the order b2d.body.get_shapes lists them. ⚠️ 1-based; passed to Defold unchanged.

Returns

b2d.shape.get_material(2 overloads): numberN

  • Since Defold 1.13.0

Get shape material id.

  1. (shape_id: Opaque<"b2Shape">)

    Parameters

    • shape_id: Opaque<"b2Shape"> — shape handle from a shape info table, or pass body, shape_index
  2. (body: Opaque<"b2Body">, shape_index: number)

    Parameters

    • body: Opaque<"b2Body"> — The body that owns the shape.
    • shape_index: number — The shape's position on that body, in the order b2d.body.get_shapes lists them. ⚠️ 1-based; passed to Defold unchanged.

Returns

  • material: number — shape material id

b2d.shape.get_sensor_capacity(2 overloads): numberN

  • Since Defold 1.13.0

Get sensor overlap capacity.

  1. (shape_id: Opaque<"b2Shape">)

    Parameters

    • shape_id: Opaque<"b2Shape"> — shape handle from a shape info table, or pass body, shape_index
  2. (body: Opaque<"b2Body">, shape_index: number)

    Parameters

    • body: Opaque<"b2Body"> — The body that owns the shape.
    • shape_index: number — The shape's position on that body, in the order b2d.body.get_shapes lists them. ⚠️ 1-based; passed to Defold unchanged.

Returns

  • capacity: number — maximum sensor overlap count

b2d.shape.get_sensor_overlaps(2 overloads): b2d.ShapeInfo[]N

  • Since Defold 1.13.0

Get sensor overlaps.

  1. (shape_id: Opaque<"b2Shape">)

    Parameters

    • shape_id: Opaque<"b2Shape"> — shape handle from a shape info table, or pass body, shape_index
  2. (body: Opaque<"b2Body">, shape_index: number)

    Parameters

    • body: Opaque<"b2Body"> — The body that owns the shape.
    • shape_index: number — The shape's position on that body, in the order b2d.body.get_shapes lists them. ⚠️ 1-based; passed to Defold unchanged.

Returns

b2d.shape.get_shape(2 overloads): b2d.shape.DefinitionN

  • Since Defold 1.13.0

Get a shape's geometry.

  1. (shape_id: Opaque<"b2Shape">)

    Parameters

    • shape_id: Opaque<"b2Shape"> — shape handle from a shape info table, or pass body, shape_index
  2. (body: Opaque<"b2Body">, shape_index: number)

    Parameters

    • body: Opaque<"b2Body"> — The body that owns the shape.
    • shape_index: number — The shape's position on that body, in the order b2d.body.get_shapes lists them. ⚠️ 1-based; passed to Defold unchanged.

Returns

b2d.shape.get_world(2 overloads): Opaque<"b2World">N

  • Since Defold 1.13.0

Get the world owning a shape.

  1. (shape_id: Opaque<"b2Shape">)

    Parameters

    • shape_id: Opaque<"b2Shape"> — shape handle from a shape info table, or pass body, shape_index
  2. (body: Opaque<"b2Body">, shape_index: number)

    Parameters

    • body: Opaque<"b2Body"> — The body that owns the shape.
    • shape_index: number — The shape's position on that body, in the order b2d.body.get_shapes lists them. ⚠️ 1-based; passed to Defold unchanged.

Returns

  • world: Opaque<"b2World"> — owning world

b2d.shape.is_valid(2 overloads): booleanN

  • Since Defold 1.13.0

Validate a shape handle.

  1. (shape_id: Opaque<"b2Shape">)

    Parameters

    • shape_id: Opaque<"b2Shape"> — shape handle from a shape info table, or pass body, shape_index
  2. (body: Opaque<"b2Body">, shape_index: number)

    Parameters

    • body: Opaque<"b2Body"> — The body that owns the shape.
    • shape_index: number — The shape's position on that body, in the order b2d.body.get_shapes lists them. ⚠️ 1-based; passed to Defold unchanged.

Returns

  • valid: boolean — true if the shape handle still refers to a live Box2D shape

b2d.shape.ray_cast(2 overloads): b2d.ShapeCastOutput | undefinedN

  • Since Defold 1.13.0

Ray cast a shape directly.

  1. (shape_id: Opaque<"b2Shape">, origin: Vector3, translation: Vector3, max_fraction?: number)

    Parameters

    • shape_id: Opaque<"b2Shape"> — shape handle from a shape info table, or pass body, shape_index
    • origin: Vector3 — world ray origin
    • translation: Vector3 — world ray translation
    • max_fraction?: number — optional maximum translation fraction, defaults to 1
  2. (body: Opaque<"b2Body">, shape_index: number, origin: Vector3, translation: Vector3, max_fraction?: number)

    Parameters

    • body: Opaque<"b2Body"> — The body that owns the shape.
    • shape_index: number — The shape's position on that body, in the order b2d.body.get_shapes lists them. ⚠️ 1-based; passed to Defold unchanged.
    • origin: Vector3 — world ray origin
    • translation: Vector3 — world ray translation
    • max_fraction?: number — optional maximum translation fraction, defaults to 1

Returns

b2d.shape.set_material(2 overloads): voidN

  • Since Defold 1.13.0

Set shape material id.

  1. (shape_id: Opaque<"b2Shape">, material: number)

    Parameters

    • shape_id: Opaque<"b2Shape"> — shape handle from a shape info table, or pass body, shape_index
    • material: number — shape material id
  2. (body: Opaque<"b2Body">, shape_index: number, material: number)

    Parameters

    • body: Opaque<"b2Body"> — The body that owns the shape.
    • shape_index: number — The shape's position on that body, in the order b2d.body.get_shapes lists them. ⚠️ 1-based; passed to Defold unchanged.
    • material: number — shape material id

b2d.shape.set_shape(2 overloads): voidN

  • Since Defold 1.13.0

This updates the shape geometry using the same table format as b2d.body.create_shape and b2d.shape.get_shape. The body mass is not updated unless update_mass is true.

  1. (shape_id: Opaque<"b2Shape">, definition: { type: typeof b2d.shape.SHAPE_TYPE_POLYGON | typeof b2d.shape.SHAPE_TYPE_BOX; hx: number; hy: number; center?: Vector3; angle?: number } | { type: typeof b2d.shape.SHAPE_TYPE_POLYGON | typeof b2d.shape.SHAPE_TYPE_BOX; vertices: Vector3[] } | { type: typeof b2d.shape.SHAPE_TYPE_CIRCLE; radius: number; center?: Vector3 } | { type: typeof b2d.shape.SHAPE_TYPE_CAPSULE; radius: number; center1: Vector3; center2: Vector3 } | { type: typeof b2d.shape.SHAPE_TYPE_EDGE | typeof b2d.shape.SHAPE_TYPE_SEGMENT; v1: Vector3; v2: Vector3 }, update_mass?: boolean)

    Parameters

    • shape_id: Opaque<"b2Shape"> — shape handle from a shape info table, or pass body, shape_index
    • definition: { type: typeof b2d.shape.SHAPE_TYPE_POLYGON | typeof b2d.shape.SHAPE_TYPE_BOX; hx: number; hy: number; center?: Vector3; angle?: number } | { type: typeof b2d.shape.SHAPE_TYPE_POLYGON | typeof b2d.shape.SHAPE_TYPE_BOX; vertices: Vector3[] } | { type: typeof b2d.shape.SHAPE_TYPE_CIRCLE; radius: number; center?: Vector3 } | { type: typeof b2d.shape.SHAPE_TYPE_CAPSULE; radius: number; center1: Vector3; center2: Vector3 } | { type: typeof b2d.shape.SHAPE_TYPE_EDGE | typeof b2d.shape.SHAPE_TYPE_SEGMENT; v1: Vector3; v2: Vector3 } — shape table with numeric type from b2d.shape.SHAPE_TYPE_*
    • update_mass?: boolean — true to reset body mass from shapes
  2. (body: Opaque<"b2Body">, shape_index: number, definition: { type: typeof b2d.shape.SHAPE_TYPE_POLYGON | typeof b2d.shape.SHAPE_TYPE_BOX; hx: number; hy: number; center?: Vector3; angle?: number } | { type: typeof b2d.shape.SHAPE_TYPE_POLYGON | typeof b2d.shape.SHAPE_TYPE_BOX; vertices: Vector3[] } | { type: typeof b2d.shape.SHAPE_TYPE_CIRCLE; radius: number; center?: Vector3 } | { type: typeof b2d.shape.SHAPE_TYPE_CAPSULE; radius: number; center1: Vector3; center2: Vector3 } | { type: typeof b2d.shape.SHAPE_TYPE_EDGE | typeof b2d.shape.SHAPE_TYPE_SEGMENT; v1: Vector3; v2: Vector3 }, update_mass?: boolean)

    Parameters

    • body: Opaque<"b2Body"> — The body that owns the shape.
    • shape_index: number — The shape's position on that body, in the order b2d.body.get_shapes lists them. ⚠️ 1-based; passed to Defold unchanged.
    • definition: { type: typeof b2d.shape.SHAPE_TYPE_POLYGON | typeof b2d.shape.SHAPE_TYPE_BOX; hx: number; hy: number; center?: Vector3; angle?: number } | { type: typeof b2d.shape.SHAPE_TYPE_POLYGON | typeof b2d.shape.SHAPE_TYPE_BOX; vertices: Vector3[] } | { type: typeof b2d.shape.SHAPE_TYPE_CIRCLE; radius: number; center?: Vector3 } | { type: typeof b2d.shape.SHAPE_TYPE_CAPSULE; radius: number; center1: Vector3; center2: Vector3 } | { type: typeof b2d.shape.SHAPE_TYPE_EDGE | typeof b2d.shape.SHAPE_TYPE_SEGMENT; v1: Vector3; v2: Vector3 } — shape table with numeric type from b2d.shape.SHAPE_TYPE_*
    • update_mass?: boolean — true to reset body mass from shapes
const body = b2d.get_body("#collisionobject");
if (body !== undefined) {
  // Move a circle shape relative to the body origin.
  const circle = b2d.shape.get_shape(body, 1);
  const radius = "radius" in circle ? circle.radius : undefined;
  b2d.shape.set_shape(body, 1, { type: b2d.shape.SHAPE_TYPE_CIRCLE, radius: radius ?? 16, center: vmath.vector3(24, 0, 0) }, true);

  // Replace a segment shape's local endpoints.
  b2d.shape.set_shape(body, 2, {
    type: b2d.shape.SHAPE_TYPE_SEGMENT,
    v1: vmath.vector3(-32, 0, 0),
    v2: vmath.vector3(32, 0, 0),
  });

  // Update a box shape using the polygon box convenience format.
  b2d.shape.set_shape(
    body,
    3,
    {
      type: b2d.shape.SHAPE_TYPE_BOX,
      hx: 16,
      hy: 8,
      center: vmath.vector3(0, 20, 0),
      angle: math.rad(30),
    },
    true,
  );
}
local body = b2d.get_body("#collisionobject")

-- Move a circle shape relative to the body origin.
local circle = b2d.shape.get_shape(body, 1)
circle.center = vmath.vector3(24, 0, 0)
b2d.shape.set_shape(body, 1, circle, true)

-- Replace a segment shape's local endpoints.
b2d.shape.set_shape(body, 2, {
    type = b2d.shape.SHAPE_TYPE_SEGMENT,
    v1 = vmath.vector3(-32, 0, 0),
    v2 = vmath.vector3( 32, 0, 0),
})

-- Update a box shape using the polygon box convenience format.
b2d.shape.set_shape(body, 3, {
    type = b2d.shape.SHAPE_TYPE_BOX,
    hx = 16,
    hy = 8,
    center = vmath.vector3(0, 20, 0),
    angle = math.rad(30),
}, true)

Constants

b2d.shape.SHAPE_TYPE_BOX: number & { readonly __brand: "b2d.shape.SHAPE_TYPE_BOX" }N

  • Since Defold 1.13.0

Box shape type alias. Uses the polygon enum value, but indicates the hx/hy box convenience format.

b2d.shape.SHAPE_TYPE_CAPSULE: number & { readonly __brand: "b2d.shape.SHAPE_TYPE_CAPSULE" }N

  • Since Defold 1.13.0

Capsule shape type.

b2d.shape.SHAPE_TYPE_CHAIN: number & { readonly __brand: "b2d.shape.SHAPE_TYPE_CHAIN" }N

  • Since Defold 1.13.0

Chain shape type.

b2d.shape.SHAPE_TYPE_CIRCLE: number & { readonly __brand: "b2d.shape.SHAPE_TYPE_CIRCLE" }N

  • Since Defold 1.13.0

Circle shape type.

b2d.shape.SHAPE_TYPE_EDGE: number & { readonly __brand: "b2d.shape.SHAPE_TYPE_EDGE" }N

  • Since Defold 1.13.0

Edge shape type alias. Compatibility alias for b2d.shape.SHAPE_TYPE_SEGMENT.

b2d.shape.SHAPE_TYPE_GRID: number & { readonly __brand: "b2d.shape.SHAPE_TYPE_GRID" }N

  • Since Defold 1.13.0

Grid shape type.

b2d.shape.SHAPE_TYPE_POLYGON: number & { readonly __brand: "b2d.shape.SHAPE_TYPE_POLYGON" }N

  • Since Defold 1.13.0

Polygon shape type.

b2d.shape.SHAPE_TYPE_SEGMENT: number & { readonly __brand: "b2d.shape.SHAPE_TYPE_SEGMENT" }N

  • Since Defold 1.13.0

Segment shape type.

Types

type b2d.shape.B2Shape = Opaque<"b2Shape">

type b2d.shape.Definition = { type: b2d.shape.ShapeType; radius: number; center?: Vector3 } | { type: b2d.shape.ShapeType; radius: number; center1: Vector3; center2: Vector3 } | { type: b2d.shape.ShapeType; v1: Vector3; v2: Vector3; v0?: Vector3; v3?: Vector3 } | { type: b2d.shape.ShapeType; hx: number; hy: number; center?: Vector3; angle?: number } | { type: b2d.shape.ShapeType; vertices: Vector3[]; loop?: boolean; prev_vertex?: Vector3; next_vertex?: Vector3 }

type b2d.shape.ShapeType = typeof b2d.shape.SHAPE_TYPE_BOX | typeof b2d.shape.SHAPE_TYPE_CAPSULE | typeof b2d.shape.SHAPE_TYPE_CHAIN | typeof b2d.shape.SHAPE_TYPE_CIRCLE | typeof b2d.shape.SHAPE_TYPE_EDGE | typeof b2d.shape.SHAPE_TYPE_GRID | typeof b2d.shape.SHAPE_TYPE_POLYGON | typeof b2d.shape.SHAPE_TYPE_SEGMENT

On this page

Functionsb2d.shape.are_contact_events_enabled(2 overloads): booleanNb2d.shape.are_hit_events_enabled(2 overloads): booleanNb2d.shape.are_pre_solve_events_enabled(2 overloads): booleanNb2d.shape.are_sensor_events_enabled(2 overloads): booleanNb2d.shape.enable_contact_events(2 overloads): voidNb2d.shape.enable_hit_events(2 overloads): voidNb2d.shape.enable_pre_solve_events(2 overloads): voidNb2d.shape.enable_sensor_events(2 overloads): voidNb2d.shape.get_body(2 overloads): Opaque<"b2Body">Nb2d.shape.get_closest_point(2 overloads): Vector3Nb2d.shape.get_contact_capacity(2 overloads): numberNb2d.shape.get_contact_data(2 overloads): b2d.ContactData[]Nb2d.shape.get_mass_data(2 overloads): b2d.MassDataNb2d.shape.get_material(2 overloads): numberNb2d.shape.get_sensor_capacity(2 overloads): numberNb2d.shape.get_sensor_overlaps(2 overloads): b2d.ShapeInfo[]Nb2d.shape.get_shape(2 overloads): b2d.shape.DefinitionNb2d.shape.get_world(2 overloads): Opaque<"b2World">Nb2d.shape.is_valid(2 overloads): booleanNb2d.shape.ray_cast(2 overloads): b2d.ShapeCastOutput | undefinedNb2d.shape.set_material(2 overloads): voidNb2d.shape.set_shape(2 overloads): voidNConstantsb2d.shape.SHAPE_TYPE_BOX: number & { readonly __brand: "b2d.shape.SHAPE_TYPE_BOX" }Nb2d.shape.SHAPE_TYPE_CAPSULE: number & { readonly __brand: "b2d.shape.SHAPE_TYPE_CAPSULE" }Nb2d.shape.SHAPE_TYPE_CHAIN: number & { readonly __brand: "b2d.shape.SHAPE_TYPE_CHAIN" }Nb2d.shape.SHAPE_TYPE_CIRCLE: number & { readonly __brand: "b2d.shape.SHAPE_TYPE_CIRCLE" }Nb2d.shape.SHAPE_TYPE_EDGE: number & { readonly __brand: "b2d.shape.SHAPE_TYPE_EDGE" }Nb2d.shape.SHAPE_TYPE_GRID: number & { readonly __brand: "b2d.shape.SHAPE_TYPE_GRID" }Nb2d.shape.SHAPE_TYPE_POLYGON: number & { readonly __brand: "b2d.shape.SHAPE_TYPE_POLYGON" }Nb2d.shape.SHAPE_TYPE_SEGMENT: number & { readonly __brand: "b2d.shape.SHAPE_TYPE_SEGMENT" }NTypestype b2d.shape.B2Shape = Opaque<"b2Shape">type b2d.shape.Definition = { type: b2d.shape.ShapeType; radius: number; center?: Vector3 } | { type: b2d.shape.ShapeType; radius: number; center1: Vector3; center2: Vector3 } | { type: b2d.shape.ShapeType; v1: Vector3; v2: Vector3; v0?: Vector3; v3?: Vector3 } | { type: b2d.shape.ShapeType; hx: number; hy: number; center?: Vector3; angle?: number } | { type: b2d.shape.ShapeType; vertices: Vector3[]; loop?: boolean; prev_vertex?: Vector3; next_vertex?: Vector3 }type b2d.shape.ShapeType = typeof b2d.shape.SHAPE_TYPE_BOX | typeof b2d.shape.SHAPE_TYPE_CAPSULE | typeof b2d.shape.SHAPE_TYPE_CHAIN | typeof b2d.shape.SHAPE_TYPE_CIRCLE | typeof b2d.shape.SHAPE_TYPE_EDGE | typeof b2d.shape.SHAPE_TYPE_GRID | typeof b2d.shape.SHAPE_TYPE_POLYGON | typeof b2d.shape.SHAPE_TYPE_SEGMENT