Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def CalcAngle(src, dst):
- angles = Vector3(0, 0, 0)
- delta = Vector3(src.x-dst.x, src.y-dst.y, src.z-dst.z)
- hyp = math.sqrt(delta.x*delta.x + delta.y*delta.y)
- angles.x = float( math.asin(delta.z/hyp) * float(180)/math.pi)
- angles.y = float( math.atan(delta.y/delta.x) * float(180)/math.pi)
- angles.z = float(0)
- if delta.x >= float(0):angles.y += float(180)
- return angles
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement