美文网首页
2018-09-15

2018-09-15

作者: 浪巅 | 来源:发表于2018-09-15 15:24 被阅读0次

    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

    球间留间隙,减少碰撞点

    相关文章

      网友评论

          本文标题:2018-09-15

          本文链接:https://www.haomeiwen.com/subject/dbxtnftx.html