implement third person camera collision detection

This commit is contained in:
LabyStudio
2022-05-04 02:30:47 +02:00
parent ed0849ca28
commit 48ad9dc9b3
5 changed files with 84 additions and 21 deletions
+4
View File
@@ -10,6 +10,10 @@ export default class Vector3 {
return new Vector3(this.x + x, this.y + y, this.z + z);
}
distanceTo(vec) {
return Math.sqrt(this.squareDistanceTo(vec));
}
squareDistanceTo(vec) {
let d0 = vec.x - this.x;
let d1 = vec.y - this.y;