Replace double with float, optimize calculation

This commit is contained in:
etagle
2018-07-01 17:20:28 -03:00
committed by Scott Lahteine
parent d960d448fa
commit 1367df2875
38 changed files with 263 additions and 267 deletions

View File

@ -69,7 +69,7 @@ vector_3 vector_3::get_normal() {
float vector_3::get_length() { return SQRT(sq(x) + sq(y) + sq(z)); }
void vector_3::normalize() {
const float inv_length = 1.0 / get_length();
const float inv_length = RSQRT(sq(x) + sq(y) + sq(z));
x *= inv_length;
y *= inv_length;
z *= inv_length;