API Docs for: 0.6.0
Show:

Narrowphase Class

Helper class for the World. Generates ContactEquations.

Constructor

Narrowphase

()

Methods

convexConvex

(
  • result
  • si
  • sj
  • xi
  • xj
  • qi
  • qj
  • bi
  • bj
)

Parameters:

convexParticle

(
  • result
  • si
  • sj
  • xi
  • xj
  • qi
  • qj
  • bi
  • bj
)

Parameters:

getContacts

(
  • p1
  • p2
  • world
  • result
  • oldcontacts
)

Generate all contacts between a list of body pairs

Parameters:

  • p1 Array

    Array of body indices

  • p2 Array

    Array of body indices

  • world World
  • result Array

    Array to store generated contacts

  • oldcontacts Array

    Optional. Array of reusable contact objects

makeResult

() ContactEquation

Make a contact object, by using the internal pool or creating a new one.

Returns:

narrowphase

(
  • result
  • si
  • sj
  • xi
  • xj
  • qi
  • qj
)

Narrowphase calculation. Get the ContactEquations given two shapes: i and j

Parameters:

  • result Array

    The result one will get back with all the contact point information

  • si Shape

    Colliding shape. If not given, particle is assumed.

  • sj Shape
  • xi Vec3

    Position of the center of mass

  • xj Vec3
  • qi Quaternion

    Rotation around the center of mass

  • qj Quaternion

particlePlane

(
  • result
  • si
  • sj
  • xi
  • xj
  • qi
  • qj
  • bi
  • bj
)

Parameters:

particleSphere

(
  • result
  • si
  • sj
  • xi
  • xj
  • qi
  • qj
  • bi
  • bj
)

Parameters:

planeBox

(
  • result
  • si
  • sj
  • xi
  • xj
  • qi
  • qj
  • bi
  • bj
)

Parameters:

planeConvex

(
  • result
  • si
  • sj
  • xi
  • xj
  • qi
  • qj
  • bi
  • bj
)

Parameters:

reduceContacts

(
  • contacts
)

Removes unnecessary members of an array of ContactEquation.

Parameters:

  • contacts Array

sphereBox

(
  • result
  • si
  • sj
  • xi
  • xj
  • qi
  • qj
  • bi
  • bj
)

Parameters:

sphereConvex

(
  • result
  • si
  • sj
  • xi
  • xj
  • qi
  • qj
  • bi
  • bj
)

Parameters:

sphereHeightfield

()

sphereHeightfield

()

spherePlane

(
  • result
  • si
  • sj
  • xi
  • xj
  • qi
  • qj
  • bi
  • bj
)

Parameters:

sphereSphere

(
  • result
  • si
  • sj
  • xi
  • xj
  • qi
  • qj
  • bi
  • bj
)

Parameters:

swapResult

(
  • object
)

Swaps the body references in the contact

Parameters:

  • object Object

    r

Properties

bool contactReduction

Unknown

Turns on or off contact reduction. Can be handy to turn off when debugging new collision types.

contactPointPool

Array

Internal storage of pooled contact points.

v3pool

Vec3Pool

Pooled vectors.