我现在根据起始点和第一个反射点求出来了发射向量
也算出了发射向量与normal之间的夹角,角度是-62.xxxxxx 弧度是-1.089xxxxxxx
var newStartPoint = p2;
var ray = p1.sub(p2); //p1是起始点 p2是与右侧墙壁碰撞的点 result是碰撞结果的集合
console.log("发射向量 ---> " + ray.x + "---->" + ray.y);
p2 = result.normal.mul(this.remainLength).add(p1) //console.log("未旋转反射向量 ---> " + p2.x + "---->" + p2.y);
var radius = cc.pAngleSigned(ray, p2);
console.log("弧度为--->" + radius);
var angle = 180 / Math.PI * radius;
console.log("对应的角度为--->" + angle);
p2 = p2.rotate(radius);
this.rayCast(newStartPoint, p2);
为什么rotate旋转后的结果不对呢,应该按照我算出来的角度65度来旋转或者弧度-1.089来旋转啊
现在才转了有20度?
求问大大们 我哪个地方弄错了


调试看哪一步出问题了