Options
All
  • Public
  • Public/Protected
  • All
Menu

@gamestdio/mathf

Index

Variables

FULL_ANGLE

FULL_ANGLE: 360 = 360

GAMMA_TO_LINEAR

GAMMA_TO_LINEAR: 2.2 = 2.2

IS_INTEGER

IS_INTEGER: 0.5 = 0.5

LINEAR_TO_GAMMA

LINEAR_TO_GAMMA: 0.45454545 = 0.45454545

STRAIGHT_ANGLE

STRAIGHT_ANGLE: 180 = 180

deg2Rad

deg2Rad: number = Math.PI * 2 / FULL_ANGLE

rad2Deg

rad2Deg: number = FULL_ANGLE / (Math.PI * 2)

Functions

approximately

  • approximately(f1: number, f2: number): boolean

clamp

  • clamp(value: number, min: number, max: number): number

clamp01

  • clamp01(value: number): number

closestPowerOfTwo

  • closestPowerOfTwo(value: number): number

closestPowerOfTwoLong

  • closestPowerOfTwoLong(value: number): number

deltaAngle

  • deltaAngle(current: number, target: number): number

gammaToLinearSpace

  • gammaToLinearSpace(value: number): number

inverseLerp

  • inverseLerp(a: number, b: number, value: number): number

isPowerOfTwo

  • isPowerOfTwo(value: number): boolean

lerp

  • lerp(a: number, b: number, t: number): number

lerpAngle

  • lerpAngle(a: number, b: number, t: number): number

lerpUnclamped

  • lerpUnclamped(a: number, b: number, t: number): number

linearToGammaSpace

  • linearToGammaSpace(value: number): number

moveTowards

  • moveTowards(current: number, target: number, maxDelta: number): number

moveTowardsAngle

  • moveTowardsAngle(current: number, target: number, maxDelta: number): void

nextPowerOfTwo

  • nextPowerOfTwo(value: number): number

pingPong

  • pingPong(t: number, length: number): number

repeat

  • repeat(t: number, length: number): number

round

  • round(f: number): number

sign

  • sign(f: number): 1 | -1

smoothDamp

  • smoothDamp(current: number, target: number, currentVelocity: number, smoothTime: number, maxSpeed: number, deltaTime: number): void

smoothDampAngle

  • smoothDampAngle(current: number, target: number, currentVelocity: number, smoothTime: number, maxSpeed: number, deltaTime: number): void

smoothStep

  • smoothStep(a: number, b: number, t: number): void

toInt

  • toInt(value: number): number
  • Parameters

    • value: number

    Returns number

Generated using TypeDoc