import type {
  Character,
  CharacterConfig,
} from "../engine/world/CharacterController"

export type Player = Character & {
  pitch: number
}

/** Concrete player tuning. Movement and collision behavior live in engine. */
export namespace Player {
  export const actorCollisionRange = 3

  export const config: CharacterConfig = {
    radius: 0.35,
    speed: 6,
    runMultiplier: 2,
    gravity: 22,
    jumpSpeed: 14,
    eyeHeight: 1.6,
  }

  export function create(): Player {
    return {
      position: { x: 0, y: 0, z: 8 },
      yaw: 0,
      pitch: 0,
      velocityY: 0,
      onGround: true,
    }
  }
}
