mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-25 04:01:03 +00:00
added normalize Vector3d func
This commit is contained in:
parent
c665ef4cbe
commit
bea578bf0c
@ -110,6 +110,14 @@ public:
|
||||
return yaw;
|
||||
}
|
||||
|
||||
void normalize() {
|
||||
float len = sqrt(dotProduct(x(), y(), z()));
|
||||
if (len != 0.0f) {
|
||||
float t = 1.0f / len;
|
||||
set(x() * t, y() * t, y() * t);
|
||||
}
|
||||
}
|
||||
|
||||
float dotProduct(float sx, float sy, float sz) {
|
||||
return x() * sx + y() * sy + z() * sz;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user