2019-04-04
2019-04-04 本文已影响0人
赤焰军少帅林殊
法向量夹脚
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);