General settings for the physic simulation and the debug of it.

Constructors

Accessors

  • get defaultCollisionMask(): number
  • Groups the default rigidbody will collide with. Set it like: (PHYSICS_GROUP.DEFAULT | PHYSICS_GROUP.GROUP_1 | PHYSICS_GROUP.GROUP_2 | PHYSICS_GROUP.GROUP_3) to collide with multiple groups. Default is collision with everything but triggers.

    Returns number

  • set defaultCollisionMask(_value): void
  • Parameters

    • _value: number

    Returns void

  • get defaultConstraintSolverType(): number
  • Change the type of joint solver algorithm. Default Iterative == 0, is faster but less stable. Direct == 1, slow but more stable, recommended for complex joint work. Change this setting only at the start of your game.

    Returns number

  • set defaultConstraintSolverType(_value): void
  • Parameters

    • _value: number

    Returns void

  • get defaultCorrectionAlgorithm(): number
  • The correction algorithm used to correct physics calculations. Change this only at the beginning of your game. Each has different approaches, so if you have problems test another Default 0 = Baumgarte (fast but less correct induces some energy errors), 1 = Split-Impulse (fast and no engery errors, but more inaccurate for joints), 2 = Non-linear Gauss Seidel (slowest but most accurate)

    Returns number

  • set defaultCorrectionAlgorithm(_value): void
  • Parameters

    • _value: number

    Returns void

  • get disableSleeping(): boolean
  • Change if rigidbodies are able to sleep (don't be considered in physical calculations) when their movement is below a threshold. Deactivation is decreasing performance for minor advantage in precision.

    Returns boolean

  • set disableSleeping(_value): void
  • Parameters

    • _value: boolean

    Returns void

  • get solverIterations(): number
  • The precision of the simulation in form of number of iterations the simulations runs through until it accepts the result. 10 Default - Higher means more precision but results in a performance decrease. This helps especially with joints, but also the general stability of the simulation due to simulation steps being rechecked multiple times before being set.

    Returns number

  • set solverIterations(_value): void
  • Parameters

    • _value: number

    Returns void