Narrowphase Class
细测阶段. 为给定的形状和变换创建碰撞和摩擦
构造器
Narrowphase
()
项目索引
方法
- bodiesOverlap
- capsuleCapsule
- circleCapsule
- circleCircle
- circleConvex
- circleHeightfield
- circleHeightfield
- circleLine
- circleParticle
- circlePlane
- collidedLastStep
- convexCapsule
- convexConvex
- convexLine
- createContactEquation
- createFrictionEquation
- createFrictionFromContact
- findSeparatingAxis static
- getClosestEdge static
- lineBox
- lineCapsule
- lineLine
- particleConvex
- particlePlane
- planeCapsule
- planeConvex
- planeLine
- projectConvexOntoAxis static
- reset
属性
Methods
capsuleCapsule
(
-
bi -
si -
xi -
ai -
bj -
sj -
xj -
aj
胶囊与胶囊的细测
circleCapsule
(
-
bi -
si -
xi -
ai -
bj -
sj -
xj -
aj
圆形与胶囊的细测
circleCircle
(
-
bodyA -
shapeA -
offsetA -
angleA -
bodyB -
shapeB -
offsetB -
angleB -
justTest -
[radiusA] -
[radiusB]
圆形与圆形的细测
circleConvex
(
-
circleBody -
circleShape -
circleOffset -
circleAngle -
convexBody -
convexShape -
convexOffset -
convexAngle -
justTest -
circleRadius
圆形与凸面的细测
circleHeightfield
(
-
bi -
si -
xi -
bj -
sj -
xj -
aj
参数:
-
biBody -
siCircle -
xiArray -
bjBody -
sjHeightfield -
xjArray -
ajNumber
circleHeightfield
(
-
bi -
si -
xi -
bj -
sj -
xj -
aj
参数:
-
biBody -
siCircle -
xiArray -
bjBody -
sjHeightfield -
xjArray -
ajNumber
circleLine
(
-
circleBody -
circleShape -
circleOffset -
circleAngle -
lineBody -
lineShape -
lineOffset -
lineAngle -
justTest -
lineRadius -
circleRadius
圆形与线的细测
circleParticle
(
-
circleBody -
circleShape -
circleOffset -
circleAngle -
particleBody -
particleShape -
particleOffset -
particleAngle -
justTest
圆形和粒子的细测
circlePlane
(
-
bi -
si -
xi -
bj -
sj -
xj -
aj
圆与平面的细测
collidedLastStep
(
Boolean
-
bodyA -
bodyB
检测从上一次reset()后刚体是否碰撞
Returns:
Boolean:
convexCapsule
(
-
convexBody -
convexShape -
convexPosition -
convexAngle -
capsuleBody -
capsuleShape -
capsulePosition -
capsuleAngle
凸面与胶囊的细测
convexLine
(
-
convexBody -
convexShape -
convexOffset -
convexAngle -
lineBody -
lineShape -
lineOffset -
lineAngle -
justTest
凸面与线形的细测
createFrictionFromContact
(
FrictionEquation
-
contactEquation
从碰撞方程给出的数据中创建一个摩擦方程,使用同一个偏移向量ri和rj,但切向量将从碰撞法向量构造
参数:
-
contactEquationContactEquation
Returns:
findSeparatingAxis
(
Boolean
static
-
c1 -
offset1 -
angle1 -
c2 -
offset2 -
angle2 -
sepAxis
从形状间寻找分离轴,使得其分离距离最大化
Returns:
Boolean:
该坐标是否可寻
getClosestEdge
(
Number
static
-
c -
angle -
axis -
flip
得到一个与轴线最接近的边缘
参数:
-
cConvex -
angleNumber -
axisArray -
flipBoolean
Returns:
Number:
最接近边的索引值,这个索引值和其下一个值跨过结果边缘,如果失败则返回-1
lineBox
(
-
lineBody -
lineShape -
lineOffset -
lineAngle -
boxBody -
boxShape -
boxOffset -
boxAngle -
justTest
线条和矩形的细测
lineCapsule
(
-
lineBody -
lineShape -
linePosition -
lineAngle -
capsuleBody -
capsuleShape -
capsulePosition -
capsuleAngle
胶囊与线形的细测
lineLine
(
-
bodyA -
shapeA -
positionA -
angleA -
bodyB -
shapeB -
positionB -
angleB
线与线的细测
particleConvex
(
-
particleBody -
particleShape -
particleOffset -
particleAngle -
convexBody -
convexShape -
convexOffset -
convexAngle -
justTest
粒子与凸面的细测
particlePlane
(
-
particleBody -
particleShape -
particleOffset -
particleAngle -
planeBody -
planeShape -
planeOffset -
planeAngle -
justTest
粒子与平面的细测
planeCapsule
(
-
planeBody -
planeShape -
planeOffset -
planeAngle -
capsuleBody -
capsuleShape -
capsuleOffset -
capsuleAngle -
justTest
planeConvex
(
-
planeBody -
planeShape -
planeOffset -
planeAngle -
convexBody -
convexShape -
convexOffset -
convexAngle -
justTest
平面与凸面的细测
planeLine
(
-
planeBody -
planeShape -
planeOffset -
planeAngle -
lineBody -
lineShape -
lineOffset -
lineAngle
平面与线形的细测
projectConvexOntoAxis
(
static
-
convexShape -
convexOffset -
convexAngle -
worldAxis -
result
投影到面向世界的轴上
参数:
-
convexShapeConvex -
convexOffsetArray -
convexAngleNumber -
worldAxisArray -
resultArray
reset
()
弃用旧方程
Properties
contactEquationPool
ContactEquationPool
跟踪所有分配的碰撞方程
Example:
// Allocate a few equations before starting the simulation.
// This way, no contact objects need to be created on the fly in the game loop.
world.narrowphase.contactEquationPool.resize(1024);
world.narrowphase.frictionEquationPool.resize(1024);
contactEquations
Array
contactSkinSize
Number
用于下一碰撞方程的皮肤尺寸值
Default: 0.01
enabledEquations
Boolean
是否在下一次碰撞中启用方程
enableFriction
Boolean
是否在下一次碰撞中启用摩擦方程
enableFrictionReduction
Boolean
deprecated
启用摩擦方程简化,如果禁用了,平面上的盒子将产生两个碰撞方程和两个摩擦方程,如果启用了,将只产生一个方程。简化对所有碰撞的形状都适用
Default: true
frictionCoefficient
Number
用于下一摩擦方程的摩擦值
frictionEquationPool
FrictionEquationPool
跟踪所有分配的摩擦方程
frictionEquations
Array
frictionRelaxation
Number
用于下一摩擦方程的弛豫度
frictionStiffness
Number
用于下一摩擦方程的刚度
restitution
Number
用于下一碰撞方程的弹性
slipForce
Number
用于创建摩擦方程的摩擦偏移力
stiffness
Number
用于下一碰撞方程的刚度
stiffness
Number
用于下一碰撞方程的刚度
surfaceVelocity
Number
将会成为每个产生的摩擦方程的.relativeVelocity属性
