2019-04-04

法向量夹脚
 vectorsToDegress (dirVec:cc.Vec2) {

        let comVec = cc.v2(0, 1);    // 水平向右的对比向量
        let radian = dirVec.signAngle(comVec);    // 求方向向量与对比向量间的弧度
        let degree = cc.misc.radiansToDegrees(radian);    // 将弧度转换为角度
        return degree;

    }
局部坐标和局部项链转化
        var localPoint
             localPoint = cc.v2();
             this.node.getComponent(cc.RigidBody).getLocalPoint(points[0], localPoint);
             cc.log("局部的点",localPoint)


              var localVector = cc.v2();
              this.node.getComponent(cc.RigidBody).getLocalVector(normal, localVector);


你可能感兴趣的:(2019-04-04)