implement entity model rendering

(cherry picked from commit a0e5d51290cf521d511f90e23445206a14c4a772)
This commit is contained in:
LabyStudio
2022-04-13 12:52:51 +02:00
parent fd071f296a
commit 4644b050c6
16 changed files with 454 additions and 5 deletions
+15 -1
View File
@@ -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);
}
}