feat: terrain

This commit is contained in:
Dan Finch 2026-08-04 12:51:07 +02:00
parent f86b4ada13
commit 81474b6bca
13 changed files with 251 additions and 279 deletions

View file

@ -1,3 +1,4 @@
import { Terrain } from "../engine/scene/Terrain"
import type { Vec3 } from "../engine/math/Vec3"
import type { Aabb, Level } from "./level"
@ -82,7 +83,7 @@ export namespace Player {
}
function groundHeight(position: Vec3, level: Level): number {
let ground = 0
let ground = Terrain.height(level.terrain, position.x, position.z)
for (const aabb of level.colliders) {
if (
aabb.standable &&