Commit 4df97b9c authored by liubing's avatar liubing

象限计算错误,fix。

parent 73c8cb55
...@@ -667,7 +667,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -667,7 +667,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
angle = 180 / Math.PI * Math.atan(Math.abs((targetNode.x - curNode.x) / (targetNode.y - curNode.y))); angle = 180 / Math.PI * Math.atan(Math.abs((targetNode.x - curNode.x) / (targetNode.y - curNode.y)));
} else if(targetNode.x > curNode.x && targetNode.y < curNode.y) { // 落点在起点右下 } else if(targetNode.x > curNode.x && targetNode.y < curNode.y) { // 落点在起点右下
angle = -180 / Math.PI * Math.atan(Math.abs((targetNode.y - curNode.y) / (targetNode.x - curNode.x))) - 90; angle = -180 / Math.PI * Math.atan(Math.abs((targetNode.y - curNode.y) / (targetNode.x - curNode.x))) - 90;
} else if(targetNode.x > curNode.x && targetNode.y < curNode.y) { // 落点在起点左下 } else if(targetNode.x < curNode.x && targetNode.y < curNode.y) { // 落点在起点左下
angle = 180 / Math.PI * Math.atan(Math.abs((targetNode.y - curNode.y) / (targetNode.x - curNode.x))) + 90; angle = 180 / Math.PI * Math.atan(Math.abs((targetNode.y - curNode.y) / (targetNode.x - curNode.x))) + 90;
} }
return angle; return angle;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment