summaryrefslogtreecommitdiff
path: root/v3f.h
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2018-10-02 00:55:32 -0700
committerVito Caputo <vcaputo@pengaru.com>2018-10-02 00:55:32 -0700
commit36e09984caf358498b1f8c012c2f4bce8f3e95ad (patch)
tree44f1eab861ca95cd07187bf666cf30a3adb2f253 /v3f.h
parent2bd54dfc3ba57f11281d8943921b8a92c61b1fee (diff)
v3f: add scalar division
Diffstat (limited to 'v3f.h')
-rw-r--r--v3f.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/v3f.h b/v3f.h
index ce80a9b..b23c33d 100644
--- a/v3f.h
+++ b/v3f.h
@@ -80,6 +80,20 @@ static inline v3f_t * pv3f_mult_scalar(const v3f_t *v, float scalar, v3f_t *res)
}
+static inline v3f_t v3f_div_scalar(const v3f_t *v, float scalar)
+{
+ return v3f_mult_scalar(v, 1.f / scalar);
+}
+
+
+static inline v3f_t * pv3f_div_scalar(const v3f_t *v, float scalar, v3f_t *res)
+{
+ *res = v3f_div_scalar(v, scalar);
+
+ return res;
+}
+
+
static inline float v3f_dot(const v3f_t *a, const v3f_t *b)
{
return a->x * b->x + a->y * b->y + a->z * b->z;
© All Rights Reserved