summaryrefslogtreecommitdiff
path: root/v3f.h
diff options
context:
space:
mode:
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