Rooms, items and some player stuff
This commit is contained in:
28
src/framework/physics/vec3.js
Normal file
28
src/framework/physics/vec3.js
Normal file
@@ -0,0 +1,28 @@
|
||||
export class Vec3 {
|
||||
constructor(values = {
|
||||
x: 0,
|
||||
y: 0,
|
||||
z: 0
|
||||
}) {
|
||||
this.x = values.x;
|
||||
this.y = values.y;
|
||||
this.z = values.z;
|
||||
}
|
||||
add(vector) {
|
||||
this.x += vector.x;
|
||||
this.y += vector.y;
|
||||
this.z += vector.z;
|
||||
}
|
||||
multiply(vector) {
|
||||
this.x *= vector.x;
|
||||
this.y *= vector.y;
|
||||
this.z *= vector.z;
|
||||
}
|
||||
clone() {
|
||||
return new Vec3({
|
||||
x: this.x,
|
||||
y: this.y,
|
||||
z: this.z
|
||||
});
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user