MCPcopy Index your code
hub / github.com/PaperMC/Paper / normalize

Method normalize

paper-api/src/main/java/org/bukkit/util/Vector.java:351–360  ·  view source on GitHub ↗

Converts this vector to a unit vector (a vector with length of 1). @return the same vector

()

Source from the content-addressed store, hash-verified

349 * @return the same vector
350 */
351 @NotNull
352 public Vector normalize() {
353 double length = length();
354
355 x /= length;
356 y /= length;
357 z /= length;
358
359 return this;
360 }
361
362 /**
363 * Zero this vector's components.

Callers 10

getDirectionMethod · 0.95
getRandomMethod · 0.80
testNormalisedVectorsMethod · 0.80
rayTraceMethod · 0.80
rotateAroundAxisMethod · 0.80
rayTraceEntitiesMethod · 0.80
rayTraceBlocksMethod · 0.80
rayTraceMethod · 0.80
setDirectionMethod · 0.80

Calls 1

lengthMethod · 0.95

Tested by 3

getRandomMethod · 0.64
testNormalisedVectorsMethod · 0.64