aboutsummaryrefslogtreecommitdiff
path: root/scripts/utils.gd
blob: a0ecae4f46ab24adbfd1c9dd9608d00c8049f666 (plain)
1
2
3
4
5
6
7
8
9
10
class_name Utils
extends Object

static func quat_look (target, up):
	var dot = target.dot(up)
	var angle = acos(dot)
	var axis = up.cross(target).normalized()
	if angle == 0: axis = up
	if angle == PI: axis = Vector3.RIGHT
	return Quat(axis, angle)