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

Method getIntermediateWithYValue

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

Returns a new vector with y 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 y)

Source from the content-addressed store, hash-verified

159 * passed in vector, or null if not possible.
160 */
161 public Vec3 getIntermediateWithYValue(Vec3 vec, double y)
162 {
163 double d0 = vec.xCoord - this.xCoord;
164 double d1 = vec.yCoord - this.yCoord;
165 double d2 = vec.zCoord - this.zCoord;
166
167 if (d1 * d1 < 1.0000000116860974E-7D)
168 {
169 return null;
170 }
171 else
172 {
173 double d3 = (y - this.yCoord) / d1;
174 return d3 >= 0.0D && d3 <= 1.0D ? new Vec3(this.xCoord + d0 * d3, this.yCoord + d1 * d3, this.zCoord + d2 * d3) : null;
175 }
176 }
177
178 /**
179 * Returns a new vector with z 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