Narrowphase Class
Helper class for the World. Generates ContactEquations.
Constructor
Narrowphase
()
Item Index
Methods
Properties
Methods
convexConvex
-
result
-
si
-
sj
-
xi
-
xj
-
qi
-
qj
-
bi
-
bj
Parameters:
-
result
Array -
si
Shape -
sj
Shape -
xi
Vec3 -
xj
Vec3 -
qi
Quaternion -
qj
Quaternion -
bi
Body -
bj
Body
convexParticle
-
result
-
si
-
sj
-
xi
-
xj
-
qi
-
qj
-
bi
-
bj
Parameters:
-
result
Array -
si
Shape -
sj
Shape -
xi
Vec3 -
xj
Vec3 -
qi
Quaternion -
qj
Quaternion -
bi
Body -
bj
Body
getContacts
-
p1
-
p2
-
world
-
result
-
oldcontacts
Generate all contacts between a list of body pairs
Parameters:
-
p1
ArrayArray of body indices
-
p2
ArrayArray of body indices
-
world
World -
result
ArrayArray to store generated contacts
-
oldcontacts
ArrayOptional. 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
ArrayThe result one will get back with all the contact point information
-
si
ShapeColliding shape. If not given, particle is assumed.
-
sj
Shape -
xi
Vec3Position of the center of mass
-
xj
Vec3 -
qi
QuaternionRotation around the center of mass
-
qj
Quaternion
particlePlane
-
result
-
si
-
sj
-
xi
-
xj
-
qi
-
qj
-
bi
-
bj
Parameters:
-
result
Array -
si
Shape -
sj
Shape -
xi
Vec3 -
xj
Vec3 -
qi
Quaternion -
qj
Quaternion -
bi
Body -
bj
Body
particleSphere
-
result
-
si
-
sj
-
xi
-
xj
-
qi
-
qj
-
bi
-
bj
Parameters:
-
result
Array -
si
Shape -
sj
Shape -
xi
Vec3 -
xj
Vec3 -
qi
Quaternion -
qj
Quaternion -
bi
Body -
bj
Body
planeBox
-
result
-
si
-
sj
-
xi
-
xj
-
qi
-
qj
-
bi
-
bj
Parameters:
-
result
Array -
si
Shape -
sj
Shape -
xi
Vec3 -
xj
Vec3 -
qi
Quaternion -
qj
Quaternion -
bi
Body -
bj
Body
planeConvex
-
result
-
si
-
sj
-
xi
-
xj
-
qi
-
qj
-
bi
-
bj
Parameters:
-
result
Array -
si
Shape -
sj
Shape -
xi
Vec3 -
xj
Vec3 -
qi
Quaternion -
qj
Quaternion -
bi
Body -
bj
Body
reduceContacts
-
contacts
Removes unnecessary members of an array of ContactEquation.
Parameters:
-
contacts
Array
sphereBox
-
result
-
si
-
sj
-
xi
-
xj
-
qi
-
qj
-
bi
-
bj
Parameters:
-
result
Array -
si
Shape -
sj
Shape -
xi
Vec3 -
xj
Vec3 -
qi
Quaternion -
qj
Quaternion -
bi
Body -
bj
Body
sphereConvex
-
result
-
si
-
sj
-
xi
-
xj
-
qi
-
qj
-
bi
-
bj
Parameters:
-
result
Array -
si
Shape -
sj
Shape -
xi
Vec3 -
xj
Vec3 -
qi
Quaternion -
qj
Quaternion -
bi
Body -
bj
Body
sphereHeightfield
()
sphereHeightfield
()
spherePlane
-
result
-
si
-
sj
-
xi
-
xj
-
qi
-
qj
-
bi
-
bj
Parameters:
-
result
Array -
si
Shape -
sj
Shape -
xi
Vec3 -
xj
Vec3 -
qi
Quaternion -
qj
Quaternion -
bi
Body -
bj
Body
sphereSphere
-
result
-
si
-
sj
-
xi
-
xj
-
qi
-
qj
-
bi
-
bj
Parameters:
-
result
Array -
si
Shape -
sj
Shape -
xi
Vec3 -
xj
Vec3 -
qi
Quaternion -
qj
Quaternion -
bi
Body -
bj
Body
swapResult
-
object
Swaps the body references in the contact
Parameters:
-
object
Objectr
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.