API Documentation

for 0.0.1
Show:

PhysicsEngine Class

PhysicsEngine Class

Constructor

PhysicsEngine

(
  • params
)

Parameters:

  • params Object

    Parameters Object

    • iterations Number

      iterations of the physic engine when constrains are calculated

Methods

addBody

(
  • position
  • mass
  • object
)
Body

addBody

Parameters:

  • position Vector3
  • mass Number
  • object Mesh

    the Mesh to attach this physics body to

Returns:

Body:

the added physic body

addElectrostaticsJoint

(
  • body1
  • body2
  • charge1
  • charge2
)
Body

addElectrostaticsJoint

Parameters:

  • body1 Mesh
  • body2 Mesh
  • charge1 Number
  • charge2 Number

Returns:

Body:

the added joint body

addFixedJoint

(
  • body
  • position
)
Body

addFixedJoint

Parameters:

Returns:

Body:

the added joint body

addGravityJoint

(
  • body1
  • body2
)
Body

addGravityJoint

Parameters:

Returns:

Body:

the added joint body

addSpringJoint

(
  • body1
  • body2
  • distance
  • k
  • damping
)
Body

addSpringJoint

Parameters:

  • body1 Mesh
  • body2 Mesh
  • distance Number
  • k Number
  • damping Number

Returns:

Body:

the added joint body

addStickJoint

(
  • body1
  • body2
  • distance
)
Body

addStickJoint

Parameters:

Returns:

Body:

the added joint body

addStringJoint

(
  • body1
  • body2
  • distance
)
Body

addStringJoint

Parameters:

Returns:

Body:

the added joint body

setGlobalGravity

(
  • vector
)

setGlobalGravity

Parameters:

setGlobalWind

(
  • vector
)

setGlobalWind

Parameters:

setup Setup

()

Initialization method

update

()

Description for undefined