feat: terrain
This commit is contained in:
parent
f86b4ada13
commit
81474b6bca
13 changed files with 251 additions and 279 deletions
|
|
@ -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 &&
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue