@@ -109,7 +109,7 @@ const sinkOut = (mass, flowX, flowY, cell, dx, dy, amount, world) => {
109109 */
110110const transferNeighbor = ( world , phase , flowX , flowY , W , cell , x , y , dx , dy , move , nbX , nbY , wrappedFrac , outFrac ) => {
111111 if ( move <= 1e-8 ) return
112- const mass = phase . mass
112+ const { mass } = phase
113113 const crossed = wrappedFrac > 0 || outFrac > 0
114114 if ( ! crossed ) {
115115 transferToCell ( world , phase , flowX , flowY , mass , W , cell , x , y , nbX , nbY , move )
@@ -131,7 +131,7 @@ const transferNeighbor = (world, phase, flowX, flowY, W, cell, x, y, dx, dy, mov
131131export const stepPhaseTransport = ( world , phase , opts ) => {
132132 const { worldW : W , worldH : H } = world
133133 const n = W * H
134- const mass = phase . mass
134+ const { mass } = phase
135135 const flowX = scratch ( world , phase . flowScratchX , n , Float32Array )
136136 const flowY = scratch ( world , phase . flowScratchY , n , Float32Array )
137137 flowX . fill ( 0 )
@@ -146,8 +146,7 @@ export const stepPhaseTransport = (world, phase, opts) => {
146146 const { pAt, markDirty } = pressure
147147
148148 const viscBuf = scratch ( world , 'phaseVisc' , n , Float32Array )
149- const vx = phase . vx
150- const vy = phase . vy
149+ const { vx, vy } = phase
151150
152151 // --- Settle along gravity-weighted down neighbors ---
153152 for ( let si = 0 ; si < n ; si ++ ) {
@@ -173,8 +172,7 @@ export const stepPhaseTransport = (world, phase, opts) => {
173172 const nb = neighborCoord ( world , x , y , dx , dy )
174173 const nbX = nb . x
175174 const nbY = nb . y
176- const wrappedFrac = nb . wrappedFrac
177- const outFrac = nb . outFrac
175+ const { wrappedFrac, outFrac } = nb
178176 const crossed = wrappedFrac > 0 || outFrac > 0
179177 let dstMass = 0
180178 let room = LIQ_FULL
@@ -233,8 +231,7 @@ export const stepPhaseTransport = (world, phase, opts) => {
233231 const nb = neighborCoord ( world , x , y , dx , dy )
234232 const nbX = nb . x
235233 const nbY = nb . y
236- const wrappedFrac = nb . wrappedFrac
237- const outFrac = nb . outFrac
234+ const { wrappedFrac, outFrac } = nb
238235 const crossed = wrappedFrac > 0 || outFrac > 0
239236 if ( ! crossed ) {
240237 const target = nbY * W + nbX
0 commit comments