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
@@ -0,0 +1,29 @@
window.Vertex = class {
/**
* A vertex contains a 3 float vector position and UV coordinates
*
* @param x X position
* @param y Y position
* @param z Z position
* @param u U mapping
* @param v V mapping
*/
constructor(x, y, z, u, v) {
this.position = new Vector3(x, y, z);
this.u = u;
this.v = v;
}
/**
* Create a new vertex of the current one with different UV mappings
*
* @param u New U mapping
* @param v New V mapping
* @return New vertex with the vector position of the current one
*/
remap(u, v) {
return new Vertex(this.position.x, this.position.y, this.position.z, u, v);
}
}