diff options
author | chai <chaifix@163.com> | 2019-12-05 09:21:26 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2019-12-05 09:21:26 +0800 |
commit | 8e684dc0c76708e3174f005aebcaabc144b85500 (patch) | |
tree | d7803e49ee1fdb5575128114d19499787f870c00 /src/math/vec3.c | |
parent | 2e82e2ddd0852b8063a3d6645366f53ee844e273 (diff) |
*背面剔除
Diffstat (limited to 'src/math/vec3.c')
-rw-r--r-- | src/math/vec3.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/math/vec3.c b/src/math/vec3.c index 4d77b96..4ca8519 100644 --- a/src/math/vec3.c +++ b/src/math/vec3.c @@ -96,8 +96,8 @@ void vec3_multiply(Vec3* v1, Vec3* v2, Quat* out) { void vec3_normalize(Vec3* v, Vec3* out) { ssr_assert(v && out); - //float mag = rsqrt(v->x * v->x + v->y * v->y + v->z * v->z); - float mag = 1.f / vec3_magnitude(v); + float mag = rsqrt(v->x * v->x + v->y * v->y + v->z * v->z); + //float mag = 1.f / vec3_magnitude(v); out->x = v->x * mag; out->y = v->y * mag; out->z = v->z * mag; |