An edge shape.

Hierarchy (View Summary)

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

  • 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

  • Determines if the first corner of this edge bends towards the solid side.

    Returns boolean

    True if convex, otherwise false.

  • 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.

  • Get the distance from vertex1 to vertex2.

    Returns number

    Distance from vertex1 to vertex2.

  • 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.