diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2018-10-02 00:55:32 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2018-10-02 00:55:32 -0700 |
commit | 36e09984caf358498b1f8c012c2f4bce8f3e95ad (patch) | |
tree | 44f1eab861ca95cd07187bf666cf30a3adb2f253 /v3f.h | |
parent | 2bd54dfc3ba57f11281d8943921b8a92c61b1fee (diff) |
v3f: add scalar division
Diffstat (limited to 'v3f.h')
-rw-r--r-- | v3f.h | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -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; |