feat: robins
This commit is contained in:
parent
a4490f7a20
commit
bd88d3cbd6
12 changed files with 159 additions and 54 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import type { Framebuffer } from "../engine/render/Framebuffer"
|
||||
import type { RenderConfig } from "../engine/render/RenderConfig"
|
||||
import { renderBand, MOB_FLOATS, type MobDraw, type Scene } from "./renderScene"
|
||||
import { renderBand, MOB_FLOATS, MOB_KINDS, type MobDraw, type Scene } from "./renderScene"
|
||||
|
||||
/** One-time setup: shared framebuffer + control/param buffers, the (cloned)
|
||||
* scene, this worker's row band, and its index into the per-worker times array. */
|
||||
|
|
@ -61,7 +61,7 @@ ctx.addEventListener("message", (e) => {
|
|||
const mobDraws: MobDraw[] = []
|
||||
for (let i = 0; i < mobCount; i++) {
|
||||
const o = i * MOB_FLOATS
|
||||
mobDraws.push({ kind: mob[o] === 1 ? "bee" : "frog", x: mob[o + 1], y: mob[o + 2], z: mob[o + 3], heading: mob[o + 4], scale: mob[o + 5] })
|
||||
mobDraws.push({ kind: MOB_KINDS[mob[o]] ?? "frog", x: mob[o + 1], y: mob[o + 2], z: mob[o + 3], heading: mob[o + 4], scale: mob[o + 5] })
|
||||
}
|
||||
renderBand(fb, scene, camera, vp, visible, mobDraws, config, skyStep, cam[6], band[0], band[1])
|
||||
times[index] = performance.now() - t0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue