Options
All
  • Public
  • Public/Protected
  • All
Menu

A circle shape.

Hierarchy

Index

Constructors

Properties

e_circleShape: number
e_edgeShape: number
e_hitCollide: number

Return value for TestSegment indicating a hit.

e_missCollide: number

Return value for TestSegment indicating a miss.

e_polygonShape: number
e_shapeTypeCount: number
e_unknownShape: number
startsInsideCollide: number

Return value for TestSegment indicating that the segment starting point, p1, is already inside the shape.

Methods

  • ComputeMass(massData: b2MassData, density: number): void
  • Compute the mass properties of this shape using its dimensions and density. The inertia tensor is computed about the local origin, not the centroid.

    Parameters

    • massData: b2MassData

      Calculate the mass, this argument is out.

    • density: number

    Returns void

  • GetRadius(): number
  • GetType(): number
  • SetLocalPosition(position: b2Vec2): void
  • Set the local position of this circle in its parent body.

    Parameters

    • position: b2Vec2

      The new local position of this circle.

    Returns void

  • SetRadius(radius: number): void
  • Set the radius of the circle.

    Parameters

    • radius: number

      The new radius of the circle.

    Returns void

  • Test a point for containment in this shape. This only works for convex shapes.

    Parameters

    • xf: b2Transform

      Shape world transform.

    • p: b2Vec2

      Point to test against, in world coordinates.

    Returns boolean

    True if the point is in this shape, otherwise false.

  • Test if two shapes overlap with the applied transforms.

    Parameters

    • shape1: b2Shape

      shape to test for overlap with shape2.

    • transform1: b2Transform

      shape1 transform to apply.

    • shape2: b2Shape

      shape to test for overlap with shape1.

    • transform2: b2Transform

      shape2 transform to apply.

    Returns boolean

    True if shape1 and shape2 overlap, otherwise false.

Generated using TypeDoc