summaryrefslogtreecommitdiff
path: root/math.cpp
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2020-12-09 15:32:12 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2020-12-09 15:32:12 -0500
commit9ca2a24de737b18d681a016557e4a037751e32bf (patch)
tree04b06760c4d699b3be0b3ed9efb23cf2e3efdb11 /math.cpp
parent13e81cdeb7994ebf062729d7e8407d22e401d459 (diff)
set rotate speed in editor
Diffstat (limited to 'math.cpp')
-rw-r--r--math.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/math.cpp b/math.cpp
index fcaa162..060eb0d 100644
--- a/math.cpp
+++ b/math.cpp
@@ -66,6 +66,12 @@ static float maxf(float a, float b) {
return a > b ? a : b;
}
+static float sgnf(float x) {
+ if (x < 0) return -1;
+ if (x > 0) return +1;
+ return 0;
+}
+
static float smoothstepf(float x) {
if (x <= 0) return 0;
if (x >= 1) return 1;
@@ -209,6 +215,10 @@ static v3 V3(float x, float y, float z) {
return v;
}
+static v3 v3_from_v2(v2 v) {
+ return V3(v.x, v.y, 0);
+}
+
#if MATH_GL
static void v3_gl_vertex(v3 v) {
glVertex3f(v.x, v.y, v.z);