implement entity model rendering
(cherry picked from commit a0e5d51290cf521d511f90e23445206a14c4a772)
This commit is contained in:
@@ -6,7 +6,6 @@ window.Vector3 = class {
|
||||
this.z = z;
|
||||
}
|
||||
|
||||
|
||||
addVector(x, y, z) {
|
||||
return new Vector3(this.x + x, this.y + y, this.z + z);
|
||||
}
|
||||
@@ -69,4 +68,19 @@ window.Vector3 = class {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an interpolated vector from the current vector position to the given one
|
||||
*
|
||||
* @param vector The end vector
|
||||
* @param partialTicks Interpolation progress
|
||||
* @return Interpolated vector between the two positions
|
||||
*/
|
||||
interpolateTo(vector, partialTicks) {
|
||||
let interpolatedX = this.x + (vector.x - this.x) * partialTicks;
|
||||
let interpolatedY = this.y + (vector.y - this.y) * partialTicks;
|
||||
let interpolatedZ = this.z + (vector.z - this.z) * partialTicks;
|
||||
|
||||
return new Vector3(interpolatedX, interpolatedY, interpolatedZ);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user