MCPcopy Create free account
hub / github.com/VolmitSoftware/Adapt / normalize

Method normalize

src/main/java/com/volmit/adapt/util/Vector3f.java:152–159  ·  view source on GitHub ↗

Sets the value of this vector to the normalization of vector v1. @param v1 the un-normalized vector

(Vector3f v1)

Source from the content-addressed store, hash-verified

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.

Callers

nothing calls this directly

Calls 1

sqrtMethod · 0.80

Tested by

no test coverage detected