feat(EN-039): drawModelTransform — immediate draws can finally pitch and roll#100
Conversation
…and roll drawModelRotated takes a single Y rotation, so an immediate-mode draw could not pitch or roll: the shooter's weapon stayed level while the camera looked up or down, and any held prop, thrown object or debris chunk hit the same wall. drawModelTransform(model, m16, tint) takes a full column-major 4x4 — the immediate-mode twin of bloom_scene_set_transform16. The ticket proposed routing the matrix through the mesh scratch, on the grounds that "Perry can't pass 16 f64 args". It can: bloom_scene_set_transform16 already passes 17 and has worked all along. So this spells the matrix out as scalars and stays STATELESS — no scratch to reset, no ordering hazard between a reset and a draw — which is the same reasoning already recorded on the scene twin. Everything downstream is the cached scene pipeline exactly as drawModelRotated uses it (alpha cutout, normal/MR maps, foliage wind, cutout shadows, planar reflections); only the matrix composition is skipped. SKINNED models are a deliberate no-op: their joint matrices already bake world orientation, so a caller-supplied model matrix would double-transform them. drawModelRotated has the same carve-out (it ignores rot_y when skinned). Registered in the package.json native manifest — Perry SILENTLY no-ops a native that isn't declared there, which for a draw call means the model just quietly stops rendering. Acceptance (shooter SH-027 v2) verified in-game: with only the camera pitch changed (0.30 -> 1.15 rad) the weapon visibly re-orients. Under drawModelRotated those two frames were identical by construction. Claude-Session: https://claude.ai/code/session_01J1UWgMcrTNvwWeXcJ1T3Fp
|
Warning Review limit reached
Next review available in: 12 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
drawModelRotatedtakes a single Y rotation, so an immediate-mode draw could notpitch or roll. The shooter's weapon stayed level while the camera looked up or
down; any held prop, thrown object or debris chunk hits the same wall.
drawModelTransform(model, m16, tint)takes a full column-major 4×4 — theimmediate-mode twin of
bloom_scene_set_transform16.The ticket's premise was wrong, in a useful way
EN-039 proposed routing the matrix through the mesh scratch because "Perry can't
pass 16 f64 args". It can —
bloom_scene_set_transform16already passes 17and has worked all along. So this spells the matrix out as scalars and stays
stateless: no scratch to reset, no ordering hazard between a reset and a
draw. That's the same reasoning already recorded on the scene twin.
Notes
drawModelRotateduses it(alpha cutout, normal/MR maps, foliage wind, cutout shadows, planar
reflections). Only the matrix composition is skipped.
world orientation, so a caller-supplied model matrix double-transforms them.
drawModelRotatedhas the same carve-out.package.jsonnative manifest. Perry silently no-ops anundeclared native — for a draw call that means the model just quietly stops
rendering, with no error. (Requires a
.perry-cache/clear on consumers.)Acceptance — shooter SH-027 v2, "the gun points where the camera points"
Verified in-game via the engine's own F12 capture. With only the camera pitch
changed (0.30 → 1.15 rad) the weapon visibly re-orients; under
drawModelRotatedthose two frames were identical by construction. Theshooter feeds it the same forward vector the muzzle, tracer and shot ray already
use — so the gun and the bullet now agree by construction rather than by
coincidence.
Pairs with the shooter PR that consumes it.
https://claude.ai/code/session_01J1UWgMcrTNvwWeXcJ1T3Fp