mirror of
https://github.com/Relintai/godot-steering-ai-framework.git
synced 2024-11-14 04:57:19 +01:00
10 lines
216 B
GDScript3
10 lines
216 B
GDScript3
|
class_name Utils
|
||
|
|
||
|
|
||
|
static func clmapedv3(vector: Vector3, limit: float) -> Vector3:
|
||
|
var len2: = vector.length_squared()
|
||
|
var limit2: = limit * limit
|
||
|
if len2 > limit2:
|
||
|
vector *= sqrt(limit2 / len2)
|
||
|
return vector
|