wip(0.S3): packages and examples migrated again from their pre-0.S sources in one run

ludic migrate state packages <every example program> packages/ludic.lab/example/plate.ludic
  1804 vars into 126 states, 64 into lets; 23498 edits in 460 files

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-25 15:31:34 +03:00
parent 5ffe50ed02
commit 19fcf60599
459 changed files with 17862 additions and 17603 deletions

View file

@ -57,18 +57,14 @@ function q_rotate(o: floats, q: floats, v: floats) -> void {
o[0] = x; o[1] = y; o[2] = z
}
# pitch about X, yaw about Y, roll about Z, composed as yaw * pitch * roll
var q_scratch: floats = null
var q_sy: floats = null # views of q_scratch's second, third and fourth
var q_sz: floats = null
var q_st: floats = null
function q_euler(o: floats, pitch: float, yaw: float, roll: float) -> void {
if q_scratch == null {
q_scratch = floats(16)
q_sy = view(q_scratch, 4, 4)
q_sz = view(q_scratch, 8, 4)
q_st = view(q_scratch, 12, 4)
function q_euler(render3d_st: mut Render3dState, o: floats, pitch: float, yaw: float, roll: float) -> void {
if render3d_st.q_scratch == null {
render3d_st.q_scratch = floats(16)
render3d_st.q_sy = view(render3d_st.q_scratch, 4, 4)
render3d_st.q_sz = view(render3d_st.q_scratch, 8, 4)
render3d_st.q_st = view(render3d_st.q_scratch, 12, 4)
}
let qx = q_scratch; let qy = q_sy; let qz = q_sz; let t = q_st
let qx = render3d_st.q_scratch; let qy = render3d_st.q_sy; let qz = render3d_st.q_sz; let t = render3d_st.q_st
q_axis_angle(qx, 1.0, 0.0, 0.0, pitch)
q_axis_angle(qy, 0.0, 1.0, 0.0, yaw)
q_axis_angle(qz, 0.0, 0.0, 1.0, roll)