2018-09-15

canno

world.broadphase = new CANNON.SAPBroadphase(world);

world.broadphase.useBoundingBoxes=true

world.broadphase.autoDetectAxis()

spe.js

_triggerSingleEmitter

? ? // if ( pos instanceof THREE.Vector3 )

oimo

removeRigidBody 中mesh=null

world.js 中 intersectTest? 是多余的么?

updateManifold

? ? ? ? ? ? if (numBuffers===0){

? ? ? ? ? ? ? ? if (this.body1.onCollide){

? ? ? ? ? ? ? ? ? ? this.body1.onCollide(this.body2, this.points[0].position)

? ? ? ? ? ? ? ? }

? ? ? ? ? ? ? ? if (this.body2.onCollide){

? ? ? ? ? ? ? ? ? ? this.body2.onCollide(this.body1, this.points[0].position)

? ? ? ? ? ? ? ? }? ? ? ? ? ? ? ?

? ? ? ? ? ? }

? ? ? ? if( this.touching || this.dist < 0.001 ) this.close = true;

manifold.addPoint( psx + dx * rads, psy + dy * rads, psz + dz * rads, dx, dy, dz, len - rad2, this.flip );

? ? ? ? ? ? var lp1x=p.localPoint1.x;

? ? ? ? ? ? var lp1y=p.localPoint1.y;

? ? ? ? ? ? var lp1z=p.localPoint1.z;

? ? ? ? ? ? var lp2x=p.localPoint2.x;

? ? ? ? ? ? var lp2y=p.localPoint2.y;

? ? ? ? ? ? var lp2z=p.localPoint2.z;? 不需要增加var變量

constraint.restitution

constraint.friction? 可以優化,只計算一次,放在if(num==0)判斷后

var gVel = new Vec3().addScaledVector( this.gravity, this.timeStep );? 不需要每次計算

game

球間留間隙,減少碰撞點

?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容