Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Edge<UserData>

The 'Edge' is line segment. The 'Edge' is described by the two points(start and end).

Type parameters

  • UserData = any

Hierarchy

Index

Constructors

constructor

  • new Edge<UserData>(options?: EdgeOptions, userData?: UserData): Edge<UserData>

Properties

aabb

aabb: AABB = ...

The axis-aligned bounding box of the shape.

area

area: number = 0

The area of the shape.

body

body: undefined | Body<any>

A body to which the shape is attached.

density

density: number = ...

The density of the shape.

end

end: Vertex

The second point of the shape.

filter

filter: Filter = ...

A collision filter of the shape

friction

friction: number

The friction of shape. Must be in range 0...Infinity.

id

id: number = ...

An id of the body

inertia

inertia: number = 0

The moment of inertia of the shape.

isSensor

isSensor: boolean

A flag that indicates whether a body is a sensor. Sensors does not react with other bodies but triggers collision events.

length

length: number = 1

The length of the shape.

mass

mass: number = 0

The mass of the shape.

normal

normal: Vector = ...

The normal of the shape.

position

position: Vector = ...

Current position of the shape.

radius

radius: number

A rounding radius of the shape(radius of circle, radius of capsule, ...).

restitution

restitution: number

The restitution(elasticity) of the shape. Must be in range 0...1. A value of 0 means that the body will not bounce at all. A value of 1 means that the body may bounce with 100% of its kinetic energy.

start

start: Vertex

The first point of the shape.

surfaceVelocity

surfaceVelocity: number

The surface velocity of the shape. Useful for creating conveyor belts.

type

type: number = ...

A type of the shape.

Optional userData

userData: any

A variable that contains user data

Methods

contains

  • contains(point: Vector): boolean

getNormal

getPoint

  • getPoint(index: number): Vertex

project

  • project(vector: Vector): number
  • Returns index of the farthest vertex of convex in the given direction.

    Parameters

    Returns number

    Index of the farthest vertex of convex in the given direction

raycast

raycastRadius

rotate

  • rotate(angle: number): void

set

setDensity

  • setDensity(density: number): void

setMass

  • setMass(mass: number): void

support

translate

  • translate(vector: Vector): void

updateAABB

  • updateAABB(): AABB

updateArea

  • updateArea(): number

updateInertia

  • updateInertia(): number

Generated using TypeDoc