Options
All
  • Public
  • Public/Protected
  • All
Menu

An edge 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

  • Corner1IsConvex(): boolean
  • Determines if the first corner of this edge bends towards the solid side.

    Returns boolean

    True if convex, otherwise false.

  • Corner2IsConvex(): boolean
  • Determines if the second corner of this edge bends towards the solid side.

    Returns boolean

    True if convex, otherwise false.

  • Get a core vertex 1 in local coordinates. These vertices represent a smaller edge that is used for time of impact.

    Returns b2Vec2

    core vertex 1 in local coordinates.

  • Get a core vertex 2 in local coordinates. These vertices represent a smaller edge that is used for time of impact.

    Returns b2Vec2

    core vertex 2 in local coordinates.

  • Returns a unit vector halfway between direction and previous direction.

    Returns b2Vec2

    Halfway unit vector between direction and previous direction.

  • Returns a unit vector halfway between direction and previous direction.

    Returns b2Vec2

    Halfway unit vector between direction and previous direction.

  • GetLength(): number
  • GetType(): number
  • Get the support point in the given world direction with the supplied transform.

    Parameters

    • xf: b2Transform

      Transform to apply.

    • dX: number

      X world direction.

    • dY: number

      Y world direction.

    Returns b2Vec2

    Support point.

  • 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