mirror of https://github.com/axmolengine/axmol.git
Merge pull request #6093 from dplusic/develop
fixed cc.pGetAngle not using absolute value
This commit is contained in:
commit
1b82cd7f08
|
@ -81,7 +81,7 @@ function cc.pGetAngle(self,other)
|
||||||
local a2 = cc.pNormalize(self)
|
local a2 = cc.pNormalize(self)
|
||||||
local b2 = cc.pNormalize(other)
|
local b2 = cc.pNormalize(other)
|
||||||
local angle = math.atan2(cc.pCross(a2, b2), cc.pDot(a2, b2) )
|
local angle = math.atan2(cc.pCross(a2, b2), cc.pDot(a2, b2) )
|
||||||
if angle < 1.192092896e-7 then
|
if math.abs(angle) < 1.192092896e-7 then
|
||||||
return 0.0
|
return 0.0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue