Sets the value of this vector to the normalization of vector v1. @param v1 the un-normalized vector
(Vector3f v1)
| 150 | * @param v1 the un-normalized vector |
| 151 | */ |
| 152 | public final void normalize(Vector3f v1) { |
| 153 | float norm; |
| 154 | |
| 155 | norm = (float) (1.0 / Math.sqrt(v1.x * v1.x + v1.y * v1.y + v1.z * v1.z)); |
| 156 | this.x = v1.x * norm; |
| 157 | this.y = v1.y * norm; |
| 158 | this.z = v1.z * norm; |
| 159 | } |
| 160 | |
| 161 | /** |
| 162 | * Normalizes this vector in place. |