(world)
| 34 | |
| 35 | export class Player { |
| 36 | constructor(world) { |
| 37 | this.world = world; |
| 38 | this.pos = new THREE.Vector3(0.5, 80, 0.5); // feet center |
| 39 | this.vel = new THREE.Vector3(); |
| 40 | this.yaw = 0; |
| 41 | this.pitch = 0; |
| 42 | |
| 43 | this.onGround = false; |
| 44 | this.flying = false; |
| 45 | this.sprinting = false; |
| 46 | this.sneaking = false; |
| 47 | this.inWater = false; |
| 48 | this.headInWater = false; |
| 49 | this.hitWall = false; |
| 50 | this.eyeHeight = EYE_STAND; |
| 51 | |
| 52 | this.walkCycle = 0; // accumulates with horizontal travel (view bob) |
| 53 | this.bobStrength = 0; // 0..1, eases in/out with movement |
| 54 | this.stepAccum = 0; |
| 55 | this.events = []; // {type, id?, impact?} drained by main |
| 56 | } |
| 57 | |
| 58 | teleport(x, y, z) { |
| 59 | this.pos.set(x, y, z); |
nothing calls this directly
no outgoing calls
no test coverage detected