Options
All
  • Public
  • Public/Protected
  • All
Menu

Class EdgeArea

Hierarchy

  • EdgeArea

Implements

Index

Constructors

constructor

Properties

begin

begin: Vector

body

body: Body

end

end: Vector

pos

pos: Vector

Methods

Private _getBodyPos

  • Returns Vector

Private _getTransformedBegin

  • _getTransformedBegin(): Vector
  • Returns Vector

Private _getTransformedEnd

  • _getTransformedEnd(): Vector
  • Returns Vector

collide

contains

  • contains(point: Vector): boolean
  • Tests if a point is contained in this collision area

    Parameters

    Returns boolean

debugDraw

  • debugDraw(ctx: CanvasRenderingContext2D, color?: Color): void
  • Parameters

    • ctx: CanvasRenderingContext2D
    • Default value color: Color = Color.Red.clone()

    Returns void

getAxes

getBounds

getCenter

  • Get the center of the collision area in world coordinates

    Returns Vector

getFurthestPoint

getLength

  • getLength(): number
  • Returns the length of the line segment in pixels

    Returns number

getMomentOfInertia

  • getMomentOfInertia(): number

getSlope

  • Returns the slope of the line in the form of a vector

    Returns Vector

project

rayCast

  • Return the point on the border of the collision area that intersects with a ray (if any).

    Parameters

    • ray: Ray
    • Default value max: number = Infinity

    Returns Vector

recalc

  • recalc(): void
  • Recalculates internal caches and values

    Returns void