Hubs-Foundation / hubs

Duck-themed multi-user virtual spaces in WebVR. Built with A-Frame.
https://hubsfoundation.org
Mozilla Public License 2.0
2.13k stars 1.42k forks source link

BG - Need Math function: ATAN2 #6414

Open j-conrad opened 9 months ago

j-conrad commented 9 months ago

Is your feature request related to a problem? Please describe. A lot of game development code relies on the atan2 math function, such as a rotating to a face a target.

The atan2 function is useful in many applications involving Euclidean vectors such as finding the direction from one point to another or converting a rotation matrix to Euler angles.

The atan2 function is now included in many other programming languages, and is also commonly found in mathematical formulas throughout science and engineering.

Geometry nodes and other Blender systems use atan2 as a built-in function as well.

Describe alternatives you've considered Setting up the math for atan2 by hand would make way too much spaghetti graph code.

Additional context Here's the function in Geometry Nodes. Takes two arguments (floats) and outputs the result as a float. image