mozilla / hubs

Duck-themed multi-user virtual spaces in WebVR. Built with A-Frame.

Home Page:https://hubs.mozilla.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BG - Need Math function: ATAN2

j-conrad opened this issue · comments

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