MCPcopy Create free account
hub / github.com/DGVPSH/SlackOpen / normalize

Method normalize

src/main/java/net/minecraft/util/Vec3.java:54–58  ·  view source on GitHub ↗

Normalizes the vector to a length of 1 (except if it is the zero vector)

()

Source from the content-addressed store, hash-verified

52 * Normalizes the vector to a length of 1 (except if it is the zero vector)
53 */
54 public Vec3 normalize()
55 {
56 double d0 = MathHelper.sqrt_double(this.xCoord * this.xCoord + this.yCoord * this.yCoord + this.zCoord * this.zCoord);
57 return d0 < 1.0E-4D ? new Vec3(0.0D, 0.0D, 0.0D) : new Vec3(this.xCoord / d0, this.yCoord / d0, this.zCoord / d0);
58 }
59
60 public double dotProduct(Vec3 vec)
61 {

Callers 9

Iterator3dMethod · 0.95
doRenderMethod · 0.95
doRenderMethod · 0.95
getFlowVectorMethod · 0.95
shouldAttackPlayerMethod · 0.95
teleportToEntityMethod · 0.95
applyEntityCollisionMethod · 0.45
onLivingUpdateMethod · 0.45

Calls 1

sqrt_doubleMethod · 0.95

Tested by

no test coverage detected