Options
All
  • Public
  • Public/Protected
  • All
Menu

A line in space between two given vertices.

Hierarchy

  • b2Segment

Index

Constructors

Properties

p1: b2Vec2

The starting point.

p2: b2Vec2

The ending point.

Methods

  • Extends or clips the segment so that it's ends lie on the boundary of the AABB.

    Parameters

    • aabb: b2AABB

      AABB to extend/clip the segement.

    Returns void

  • ExtendBackward(aabb: b2AABB): void
  • ExtendForward(aabb: b2AABB): void
  • TestSegment(lambda: number[], normal: b2Vec2, segment: b2Segment, maxLambda: number): boolean
  • Ray cast against this segment with another segment.

    Parameters

    • lambda: number[]

      returns the hit fraction. You can use this to compute the contact point * p = (1 - lambda) * segment.p1 + lambda * segment.p2 * @normal Normal at the contact point. If there is no intersection, the normal is not set.

    • normal: b2Vec2
    • segment: b2Segment

      Defines the begining and end point of the ray cast.

    • maxLambda: number

      a number typically in the range [0,1].

    Returns boolean

    True if there is an intersection, otherwise false.

Generated using TypeDoc