Options
All
  • Public
  • Public/Protected
  • All
Menu

A line in space between two given vertices.

Hierarchy

  • b2Segment

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

p1

p1: b2Vec2

The starting point.

p2

p2: b2Vec2

The ending point.

Methods

Extend

  • 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

  • ExtendBackward(aabb: b2AABB): void
  • See Extend, this works on the ending point.

    Parameters

    • aabb: b2AABB

      AABB to extend/clip the ending point.

    Returns void

ExtendForward

  • ExtendForward(aabb: b2AABB): void
  • See Extend, this works on the starting point.

    Parameters

    • aabb: b2AABB

      AABB to extend/clip the starting point.

    Returns void

TestSegment

  • 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