Files
DarkflameServer/dCommon/dMath.h
David Markowitz fc6a7fbd52 feat: Add a bunch of behaviors (All rotations, DoDamage, OnTimer, OnStartup, MoveBackToStart) and make models move based on normals, not world axes (#2038)
* add rotation behavior logic (not working correctly for multiple axes)

* Fix FetchContent_Declare speed

* remove manual quaternion math

* feat: working rotations

* remove flag

* feat: make directional movements based on model rotation and not world axes

* poggers rotation on the strip

* Add OnStartup and OnTimer

* go home works

* Add DoDamage behavior and dont try and start the same node multiple times

* fix: pause bbb models

* interrupt rotations and save interrupt count across resets
2026-10-05 12:33:45 -05:00

24 lines
453 B
C++

// Darkflame Universe
// Copyright 2025
#ifndef DMATH_H
#define DMATH_H
#include <cmath>
namespace Math {
constexpr float PI = 3.14159265358979323846264338327950288f;
constexpr float RATIO_DEG_TO_RAD = PI / 180.0f;
constexpr float RATIO_RAD_TO_DEG = 180.0f / PI;
inline float DegToRad(float degrees) {
return degrees * RATIO_DEG_TO_RAD;
}
inline float RadToDeg(float radians) {
return radians * RATIO_RAD_TO_DEG;
}
};
#endif //!DMATH_H