replaced files
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import { IMoveInput } from "../Input/MoveInput";
|
||||
import { Vector3 } from "three";
|
||||
|
||||
export class MoveC {
|
||||
private readonly input: IMoveInput;
|
||||
private speed: number;
|
||||
private readonly moveDirection = new Vector3();
|
||||
|
||||
constructor(input: IMoveInput, speed = 5) {
|
||||
this.input = input;
|
||||
this.speed = speed;
|
||||
}
|
||||
|
||||
get Direction() {
|
||||
return this.moveDirection;
|
||||
}
|
||||
|
||||
get Weight() {
|
||||
return this.moveDirection.length() / this.speed;
|
||||
}
|
||||
|
||||
setSpeed(speed: number) {
|
||||
this.speed = speed;
|
||||
}
|
||||
|
||||
|
||||
update(_delta: number) {
|
||||
this.moveDirection.copy(this.input.CurrentDirection).multiplyScalar(this.speed);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user