Add distance3d function
This commit is contained in:
parent
eed40eb026
commit
17950726d9
|
@ -60,3 +60,8 @@ static func pack_as_file(node: Node, filename: String, update_owner=true):
|
||||||
push_error("Failed to pack packed scene: %s" % filename)
|
push_error("Failed to pack packed scene: %s" % filename)
|
||||||
return FAILED
|
return FAILED
|
||||||
return OK
|
return OK
|
||||||
|
|
||||||
|
static func distance3d(obj1: Spatial, obj2: Spatial) -> float:
|
||||||
|
""" Get the distance between two 3d nodes
|
||||||
|
"""
|
||||||
|
return obj1.global_transform.origin.distance_to(obj2.global_transform.origin)
|
||||||
|
|
Reference in a new issue