This commit is contained in:
2026-10-08 17:38:08 +08:00
parent 4765dfaa02
commit 27b9788a04
78 changed files with 24546 additions and 1 deletions
+18
View File
@@ -0,0 +1,18 @@
# Copyright (c) 2023-2025 Cory Petkovsek and Contributors
# Copyright (c) 2021 J. Cuellar
class_name TOD_Math
static func rev(val: float) -> float:
return val - int(floor(val / 360.0)) * 360.0
static func spherical_to_cartesian(theta: float, azimuth: float, radius: float = 1.0) -> Vector3:
var ret: Vector3
var sinTheta: float = sin(theta)
ret.x = sinTheta * sin(azimuth)
ret.y = cos(theta)
ret.z = sinTheta * cos(azimuth)
return ret * radius