This commit is contained in:
Team3
2026-09-16 01:23:42 +02:00
parent 12cbb88692
commit 936773c4e9
13 changed files with 1300 additions and 314 deletions

View File

@@ -48,6 +48,54 @@ static func kennt(a: String) -> bool:
return ACTIVITY_TEXT.has(a) or Ursachen.ist_blocker(a)
const ETAGE := 3.0 # Höhe eines Stockwerks
static func etagen(places: Dictionary, key: String) -> int:
return maxi(1, int(places[key].get("etagen", 1)))
static func hoehe(e: int) -> float:
return float(e) * ETAGE
## Treppenhaus: die Ecke neben der Tür. Die Podeste wechseln je Etage die
## Seite, so läuft die Treppe im Zickzack an der Türwand hoch.
static func treppe(places: Dictionary, key: String, e: int) -> Vector3:
var pl: Dictionary = places[key]
var c := center(places, key)
var d: Vector3 = DIR_VEC[pl["dir"]]
var size: Array = pl["size"]
var quer_ist := absf(d.z) > 0.0
var halb_d: float = (float(size[1]) if quer_ist else float(size[0])) * 0.5
var halb_q: float = (float(size[0]) if quer_ist else float(size[1])) * 0.5
var quer := Vector3(-d.z, 0, d.x)
var p := c + d * (halb_d - 1.6) + quer * (halb_q - 1.4) - quer * (3.0 if e % 2 == 1 else 0.0)
p.y = hoehe(e)
return p
## Punkt gleich hinter der Tür, im Haus.
static func innen_tuer(places: Dictionary, key: String) -> Vector3:
var pl: Dictionary = places[key]
var c := center(places, key)
var d: Vector3 = DIR_VEC[pl["dir"]]
var size: Array = pl["size"]
var halb: float = (float(size[1]) if absf(d.z) > 0.0 else float(size[0])) * 0.5
return c + d * (halb - 1.2)
## Wegpunkte durchs Treppenhaus von Etage a nach Etage b, ohne a selbst.
static func treppen_weg(places: Dictionary, key: String, a: int, b: int) -> Array:
var out: Array = []
var schritt := 1 if b > a else -1
var e := a
while e != b:
e += schritt
out.append(treppe(places, key, e))
return out
static func center(places: Dictionary, key: String) -> Vector3:
var p: Array = places[key]["pos"]
return Vector3(p[0], 0.0, p[1])