wip(0.S3): the packages migrated by ludic migrate state packages - every package test green

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-25 14:02:21 +03:00
parent 1e8b5b0523
commit 07505e7ef2
294 changed files with 14996 additions and 14675 deletions

View file

@ -1,23 +1,21 @@
# plate.ludic - the stage: a flat disc 40 m across at y = 0 with a line every metre, lit by the
# package's own small sky (a sun 40 degrees up), and nothing else. Its files are in plate/.
var lb_plate: Actor = null
var lb_plate_dir: string = ""
# the package's plate/ directory: beside the project (a checkout of the toolchain) or installed
export function lab_plate_dir() -> string {
if lb_plate_dir != "" { return lb_plate_dir }
lb_plate_dir = "packages/ludic.lab/plate"
if not Fs.exists(`{lb_plate_dir}/plate.gltf`) { lb_plate_dir = `{r3d_home()}/packages/ludic.lab/plate` }
return lb_plate_dir
export function lab_plate_dir(lab_st: mut LabState) -> string {
if lab_st.lb_plate_dir != "" { return lab_st.lb_plate_dir }
lab_st.lb_plate_dir = "packages/ludic.lab/plate"
if not Fs.exists(`{lab_st.lb_plate_dir}/plate.gltf`) { lab_st.lb_plate_dir = `{r3d_home()}/packages/ludic.lab/plate` }
return lab_st.lb_plate_dir
}
function lab_plate_load() -> void {
let m = gltf_load(lab_plate_dir(), "plate.gltf", "plate")
function lab_plate_load(lab_st: mut LabState, render3d_st: mut Render3dState) -> void {
let m = gltf_load(render3d_st, lab_plate_dir(lab_st), "plate.gltf", "plate")
if m == null { return }
lb_plate = actor_new(m)
lb_plate.casts = false
lb_plate.cull = 0.0
lb_plate.radius = 0.0
actor_place(lb_plate, 0.0, 0.0, 0.0, 0.0)
lab_st.lb_plate = actor_new(render3d_st, m)
lab_st.lb_plate.casts = false
lab_st.lb_plate.cull = 0.0
lab_st.lb_plate.radius = 0.0
actor_place(lab_st.lb_plate, 0.0, 0.0, 0.0, 0.0)
}
# the ground under (x, z): the plate is flat at 0
export function lab_ground_y(x: float, z: float) -> float { return 0.0 }
@ -27,10 +25,10 @@ export function lab_stand(a: Actor, x: float, z: float, yaw: float) -> void {
actor_place(a, x, lab_ground_y(x, z), z, yaw)
}
# a model from a glTF file stood on the plate: the one call a scene usually needs
export function lab_model(dir: string, file: string, node: string, x: float, z: float, yaw: float) -> Actor {
let m = gltf_load(dir, file, node)
export function lab_model(render3d_st: mut Render3dState, dir: string, file: string, node: string, x: float, z: float, yaw: float) -> Actor {
let m = gltf_load(render3d_st, dir, file, node)
if m == null { return null }
let a = actor_new(m)
let a = actor_new(render3d_st, m)
lab_stand(a, x, z, yaw)
return a
}