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

Method getIntermediateWithXValue

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

Returns a new vector with x value equal to the second parameter, along the line between this vector and the passed in vector, or null if not possible.

(Vec3 vec, double x)

Source from the content-addressed store, hash-verified

138 * passed in vector, or null if not possible.
139 */
140 public Vec3 getIntermediateWithXValue(Vec3 vec, double x)
141 {
142 double d0 = vec.xCoord - this.xCoord;
143 double d1 = vec.yCoord - this.yCoord;
144 double d2 = vec.zCoord - this.zCoord;
145
146 if (d0 * d0 < 1.0000000116860974E-7D)
147 {
148 return null;
149 }
150 else
151 {
152 double d3 = (x - this.xCoord) / d0;
153 return d3 >= 0.0D && d3 <= 1.0D ? new Vec3(this.xCoord + d0 * d3, this.yCoord + d1 * d3, this.zCoord + d2 * d3) : null;
154 }
155 }
156
157 /**
158 * Returns a new vector with y value equal to the second parameter, along the line between this vector and the

Callers 2

collisionRayTraceMethod · 0.80
calculateInterceptMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected