* Applies a matrix to a vector. * The fourth component is set to 1. * Returns the result of dividing the 1st to 3rd components * of the result by the 4th component as a vector. * * This method multiplies the current matrix by a 4D vector (x, y, z, 1), * effectively transforming the
({ x, y, z })
| 1492 | * } |
| 1493 | */ |
| 1494 | multiplyAndNormalizePoint({ x, y, z }) { |
| 1495 | const array = this.multiplyVec4(x, y, z, 1); |
| 1496 | array[0] /= array[3]; |
| 1497 | array[1] /= array[3]; |
| 1498 | array[2] /= array[3]; |
| 1499 | return new Vector(array[0], array[1], array[2]); |
| 1500 | } |
| 1501 | |
| 1502 | /** |
| 1503 | * Applies a matrix to a vector. |
no test coverage detected