Options
All
  • Public
  • Public/Protected
  • All
Menu

Module common

Index

Variables

Const b2Abs

b2Abs: abs = Math.abs

Const b2Acos

b2Acos: acos = Math.acos

Const b2Asin

b2Asin: asin = Math.asin

Const b2Atan2

b2Atan2: atan2 = Math.atan2

Const b2Cos

b2Cos: cos = Math.cos

Const b2IsValid

b2IsValid: isFinite = isFinite

Const b2Pow

b2Pow: pow = Math.pow

Const b2Sin

b2Sin: sin = Math.sin

Const b2Sqrt

b2Sqrt: sqrt = Math.sqrt

Const b2Vec2_zero

b2Vec2_zero: Readonly<b2Vec2> = new b2Vec2(0, 0)

Const b2_180_over_pi

b2_180_over_pi: number = 180 / b2_pi

Const b2_aabbExtension

b2_aabbExtension: number = 0.1

Const b2_aabbMultiplier

b2_aabbMultiplier: number = 2

Const b2_angularSleepTolerance

b2_angularSleepTolerance: number = 2 / 180 * b2_pi

Const b2_angularSlop

b2_angularSlop: number = 2 / 180 * b2_pi

Const b2_barrierCollisionTime

b2_barrierCollisionTime: number = 2.5

Const b2_baumgarte

b2_baumgarte: number = 0.2

Const b2_branch

b2_branch: string = "master"

Const b2_commit

b2_commit: string = "fbf51801d80fc389d43dc46524520e89043b6faf"

Const b2_epsilon

b2_epsilon: number = 0.00001

Const b2_epsilon_sq

b2_epsilon_sq: number = (b2_epsilon * b2_epsilon)

Const b2_invalidParticleIndex

b2_invalidParticleIndex: number = -1

Const b2_linearSleepTolerance

b2_linearSleepTolerance: number = 0.01

Const b2_linearSlop

b2_linearSlop: number = 0.008

Const b2_maxAngularCorrection

b2_maxAngularCorrection: number = 8 / 180 * b2_pi

Const b2_maxFloat

b2_maxFloat: number = 1e+37

Const b2_maxLinearCorrection

b2_maxLinearCorrection: number = 0.2

Const b2_maxManifoldPoints

b2_maxManifoldPoints: number = 2

Const b2_maxParticleForce

b2_maxParticleForce: number = 0.5

Const b2_maxParticleIndex

b2_maxParticleIndex: number = 2147483647

Const b2_maxParticlePressure

b2_maxParticlePressure: number = 0.25

Const b2_maxPolygonVertices

b2_maxPolygonVertices: number = 8

Const b2_maxRotation

b2_maxRotation: number = 0.5 * b2_pi

Const b2_maxRotationSquared

b2_maxRotationSquared: number = b2_maxRotation * b2_maxRotation

Const b2_maxSubSteps

b2_maxSubSteps: number = 8

Const b2_maxTOIContacts

b2_maxTOIContacts: number = 32

Const b2_maxTranslation

b2_maxTranslation: number = 2

Const b2_maxTranslationSquared

b2_maxTranslationSquared: number = b2_maxTranslation * b2_maxTranslation

Const b2_maxTriadDistance

b2_maxTriadDistance: number = 2

Const b2_maxTriadDistanceSquared

b2_maxTriadDistanceSquared: number = (b2_maxTriadDistance * b2_maxTriadDistance)

Const b2_minParticleSystemBufferCapacity

b2_minParticleSystemBufferCapacity: number = 256

Const b2_minParticleWeight

b2_minParticleWeight: number = 1

Const b2_particleStride

b2_particleStride: number = 0.75

Const b2_pi

b2_pi: number = 3.14159265359

Const b2_pi_over_180

b2_pi_over_180: number = b2_pi / 180

Const b2_polygonRadius

b2_polygonRadius: number = 2 * b2_linearSlop

Const b2_timeToSleep

b2_timeToSleep: number = 0.5

Const b2_toiBaumgarte

b2_toiBaumgarte: number = 0.75

Const b2_two_pi

b2_two_pi: number = 2 * b2_pi

Const b2_velocityThreshold

b2_velocityThreshold: number = 1

Const b2_version

b2_version: b2Version = new b2Version(2, 3, 2)

Functions

b2Alloc

  • b2Alloc(size: number): any
  • Parameters

    • size: number

    Returns any

b2Assert

  • b2Assert(condition: boolean, ...args: any[]): void
  • Parameters

    • condition: boolean
    • Rest ...args: any[]

    Returns void

b2Clamp

  • b2Clamp(a: number, lo: number, hi: number): number
  • Parameters

    • a: number
    • lo: number
    • hi: number

    Returns number

b2DegToRad

  • b2DegToRad(degrees: number): number
  • Parameters

    • degrees: number

    Returns number

b2Free

  • b2Free(mem: any): void
  • Parameters

    • mem: any

    Returns void

b2InvSqrt

  • b2InvSqrt(n: number): number
  • Parameters

    • n: number

    Returns number

b2IsPowerOfTwo

  • b2IsPowerOfTwo(x: number): boolean
  • Parameters

    • x: number

    Returns boolean

b2Log

  • b2Log(message: string, ...args: any[]): void
  • Parameters

    • message: string
    • Rest ...args: any[]

    Returns void

b2MakeArray

  • b2MakeArray<T>(length: number, init: (i: number) => T): T[]
  • Type parameters

    • T

    Parameters

    • length: number
    • init: (i: number) => T
        • (i: number): T
        • Parameters

          • i: number

          Returns T

    Returns T[]

b2MakeNullArray

  • b2MakeNullArray<T>(length: number): Array<T | null>
  • Type parameters

    • T

    Parameters

    • length: number

    Returns Array<T | null>

b2MakeNumberArray

  • b2MakeNumberArray(length: number, init?: number): number[]
  • Parameters

    • length: number
    • Default value init: number = 0

    Returns number[]

b2Max

  • b2Max(a: number, b: number): number
  • Parameters

    • a: number
    • b: number

    Returns number

b2Maybe

  • b2Maybe<T>(value: T | undefined, def: T): T
  • Type parameters

    • T

    Parameters

    • value: T | undefined
    • def: T

    Returns T

b2Min

  • b2Min(a: number, b: number): number
  • Parameters

    • a: number
    • b: number

    Returns number

b2NextPowerOfTwo

  • b2NextPowerOfTwo(x: number): number
  • Parameters

    • x: number

    Returns number

b2ParseInt

  • b2ParseInt(v: string): number
  • Parameters

    • v: string

    Returns number

b2ParseUInt

  • b2ParseUInt(v: string): number
  • Parameters

    • v: string

    Returns number

b2RadToDeg

  • b2RadToDeg(radians: number): number
  • Parameters

    • radians: number

    Returns number

b2Random

  • b2Random(): number
  • Returns number

b2RandomRange

  • b2RandomRange(lo: number, hi: number): number
  • Parameters

    • lo: number
    • hi: number

    Returns number

b2Sq

  • b2Sq(n: number): number
  • Parameters

    • n: number

    Returns number

b2Swap

  • b2Swap<T>(a: T[], b: T[]): void
  • Type parameters

    • T

    Parameters

    • a: T[]
    • b: T[]

    Returns void

Generated using TypeDoc