File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " planck " : patch
3+ ---
4+
5+ Improve world.queueUpdate
Original file line number Diff line number Diff line change @@ -128,7 +128,7 @@ export class World {
128128 /** @internal */ m_positionIterations : number ;
129129 /** @internal */ m_t : number ;
130130
131- /** @internal */ m_step_callback : ( ( world : World ) => unknown ) [ ] = [ ] ;
131+ /** @internal */ m_step_callback : ( ( world : World ) => unknown ) [ ] ;
132132
133133 // TODO
134134 /** @internal */ _listeners : {
@@ -186,6 +186,8 @@ export class World {
186186 this . m_positionIterations = def . positionIterations ;
187187
188188 this . m_t = 0 ;
189+
190+ this . m_step_callback = [ ] ;
189191 }
190192
191193 /** @internal */
@@ -861,7 +863,7 @@ export class World {
861863 this . m_locked = false ;
862864
863865 let callback : ( world : World ) => unknown ;
864- while ( callback = this . m_step_callback . pop ( ) ) {
866+ while ( callback = this . m_step_callback . shift ( ) ) {
865867 callback ( this ) ;
866868 }
867869
You can’t perform that action at this time.
0 commit comments