P2.JS之触碰材质(ContactMaterial)备忘
1 boxShape.material = new p2.Material(); 2 platformShape.material = new p2.Material(); 3 4 var material = new p2.ContactMaterial(boxShape.material, platformShape.material, { 5 surfaceVelocity: -50, 6 restitution: 0.5, 7 friction: 0.3, 8 stiffness: 1e7 9 }); 10 world.addContactMaterial(material);
frictionStiffness,Stiffness of the resulting FrictionEquation that this ContactMaterial generate
frictionRelaxation,Relaxation of the resulting FrictionEquation that this ContactMaterial generate
contactSkinSize,Offset to be set on ContactEquations. A positive value will make the bodies penetrate more into each other. Can be useful in scenes where contacts need to be more persistent, for example when stacking. Aka "cure for nervous contacts".
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。