物理接触会在开始和结束碰撞之间生成,并作为参数传入到碰撞回调函数中。 注意:传入的物理接触会被系统进行重用,所以不要在使用中缓存里面的任何信息。
获取当前摩擦力系数
getFriction
获取冲量信息 注意:这个信息只有在 onPostSolve 回调中才能获取到
getImpulse
获取本地(局部)坐标系下的碰撞信息。
getManifold
-e_circles: not used -e_faceA: the normal on polygonA -e_faceB: the normal on polygonB
-e_circles: 没被使用到 -e_faceA: polygonA 的法向量 -e_faceB: polygonB 的法向量
{Vec2} localNormal
The local point usage depends on the manifold type: -e_circles: the local center of circleA -e_faceA: the center of faceA -e_faceB: the center of faceB
用途取决于 manifold 类型 -e_circles: circleA 的本地中心点 -e_faceA: faceA 的本地中心点 -e_faceB: faceB 的本地中心点
{Vec2} localPoint
the points of contact.
接触点信息。
{[ManifoldPoint]} points
Manifold type : 0: e_circles, 1: e_faceA, 2: e_faceB
Manifold 类型 : 0: e_circles, 1: e_faceA, 2: e_faceB
{Number} type
获取当前恢复系数
getRestitution
获取切线速度
getTangentSpeed
获取世界坐标系下的碰撞信息。
getWorldManifold
world vector pointing from A to B
世界坐标系下由 A 指向 B 的向量
{Vec2} normal
world contact point (point of intersection)
碰撞点集合
{[Vec2]} points
a negative value indicates overlap
一个负数,用于指明重叠的部分
返回碰撞体是否已经接触到。
isTouching
重置摩擦力系数到默认值
resetFriction
重置恢复系数到默认值
resetRestitution
在当前时间步或子步中忽略此接触。
{Boolean} disabledOnce
覆盖默认的摩擦力系数。你可以在 onPreSolve 回调中调用此函数。
setFriction
覆盖默认的恢复系数。你可以在 onPreSolve 回调中调用此函数。
setRestitution
为传送带设置期望的切线速度
setTangentSpeed
Generated using TypeDoc
物理接触会在开始和结束碰撞之间生成,并作为参数传入到碰撞回调函数中。 注意:传入的物理接触会被系统进行重用,所以不要在使用中缓存里面的任何信息。