Angle¶
C++ type: Angle (static utility class)
Description¶
A static utility class providing angle conversion functions between degrees, radians, and Doriax's default unit, which is controlled by Engine::useDegrees.
Because the "default" unit changes depending on the engine configuration, these helpers make it easy to write code that works correctly regardless of how the engine is configured.
Methods¶
| Type | Name | Langs |
|---|---|---|
| static float | radToDefault | C++ | Lua |
| static float | degToDefault | C++ | Lua |
| static float | defaultToRad | C++ | Lua |
| static float | defaultToDeg | C++ | Lua |
| static float | radToDeg | C++ | Lua |
| static float | degToRad | C++ | Lua |
Method details¶
radToDefault / degToDefault¶
- static float radToDefault(float radians)
- static float degToDefault(float degrees)
Convert a value in radians or degrees to the engine's current default angle unit. If Engine::useDegrees is true, radToDefault() converts radians → degrees and degToDefault() is a no-op.
defaultToRad / defaultToDeg¶
- static float defaultToRad(float angle)
- static float defaultToDeg(float angle)
Convert from the engine's default unit to radians or degrees.
radToDeg / degToRad¶
- static float radToDeg(float radians)
- static float degToRad(float degrees)
Direct conversion between radians and degrees, independent of the engine's useDegrees setting.