diff options
| author | David Reid <[email protected]> | 2018-05-21 20:26:28 +1000 |
|---|---|---|
| committer | David Reid <[email protected]> | 2018-05-21 20:26:28 +1000 |
| commit | 6d8cc250bd086a6bfdf34effad4b9b3cca3e97a7 (patch) | |
| tree | 95d9092e666ef409dd4cb75a5f836e37acabfdf9 /src/raymath.h | |
| parent | 3ca5047c8285318c2385c6b52b2e2b5f12905f0d (diff) | |
| parent | e025e62445913bf1ec9cf075eaaf1dc7374da83c (diff) | |
| download | raylib-6d8cc250bd086a6bfdf34effad4b9b3cca3e97a7.tar.gz raylib-6d8cc250bd086a6bfdf34effad4b9b3cca3e97a7.zip | |
Merge branch 'master' of https://github.com/raysan5/raylib into dr/mini_al
Diffstat (limited to 'src/raymath.h')
| -rw-r--r-- | src/raymath.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/raymath.h b/src/raymath.h index d49f3622..b0046522 100644 --- a/src/raymath.h +++ b/src/raymath.h @@ -372,6 +372,17 @@ RMDEF Vector3 Vector3Normalize(Vector3 v) return result; } +// Orthonormalize provided vectors +// Makes vectors normalized and orthogonal to each other +// Gram-Schmidt function implementation +RMDEF void Vector3OrthoNormalize(Vector3 *v1, Vector3 *v2) +{ + *v1 = Vector3Normalize(*v1); + Vector3 vn = Vector3CrossProduct(*v1, *v2); + vn = Vector3Normalize(vn); + *v2 = Vector3CrossProduct(vn, *v1); +} + // Transforms a Vector3 by a given Matrix RMDEF Vector3 Vector3Transform(Vector3 v, Matrix mat) { |
