noa.physics - Wrapper module for the physics engine.

This module extends voxel-physics-engine, so turn on "Inherited" to see its APIs here, or view the base module for full docs.

This module uses the following default options (from the options object passed to the Engine):

{
gravity: [0, -10, 0],
airDrag: 0.1,
fluidDrag: 0.4,
fluidDensity: 2.0,
minBounceImpulse: .5, // cutoff for a bounce to occur
}

Hierarchy

Properties

airDrag: any
bodies: any[]
fluidDensity: any
fluidDrag: any
gravity: any
minBounceImpulse: any
testFluid: ((x, y, z) => boolean)

Type declaration

    • (x, y, z): boolean
    • Parameters

      • x: number
      • y: number
      • z: number

      Returns boolean

testSolid: ((x, y, z) => boolean)

Type declaration

    • (x, y, z): boolean
    • Parameters

      • x: number
      • y: number
      • z: number

      Returns boolean

Methods

  • Adds a physics body to the simulation

    Parameters

    • _aabb: any
    • mass: any
    • friction: any
    • restitution: any
    • gravMult: any
    • onCollide: any

    Returns RigidBody

  • Removes a body, by direct reference

    Parameters

    • b: any

    Returns any

  • Parameters

    • dt: any

    Returns void

Generated using TypeDoc