Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

102
Views
La simulación local de MatterJs tiene una velocidad diferente a la de la nube
 Matter.Events.on(runner, 'beforeUpdate', (e) => { Matter.Body.setVelocity(body, { x: -2, y: body.velocity.y, }) })

Estoy ajustando la velocidad de esta manera. mi problema es dependiendo de dónde ejecuto este código, el objeto se mueve a una velocidad diferente.

si lo ejecuto con el nodo 16.4.0 en mi máquina local, mueve el objeto muy lento.

registro de eventos de mi máquina

 { timestamp: 949.9999999999992, name: 'beforeUpdate', source: { fps: 38.873999999999995, correction: 1, deltaSampleSize: 60, counterTimestamp: 1647108816311, frameCounter: 19, deltaHistory: [], timePrev: null, timeScalePrev: 1, frameRequestId: undefined, isFixed: true, enabled: true, delta: 16.666666666666668, deltaMin: 16.666666666666668, deltaMax: 33.333333333333336, events: { beforeTick: [Array], beforeUpdate: [Array] } } }

si ejecuto este código como ejemplo en una máquina heroku con el nodo 16.4.0, tiene la velocidad prevista.

registro de eventos en heroku

 { timestamp: 733.333333333333, name: 'beforeUpdate', source: { fps: 1647108632.865, correction: 1, deltaSampleSize: 60, counterTimestamp: 1647108632865, frameCounter: 44, deltaHistory: [], timePrev: null, timeScalePrev: 1, frameRequestId: undefined, isFixed: true, enabled: true, delta: 16.666666666666668, deltaMin: 16.666666666666668, deltaMax: 33.333333333333336, events: { beforeTick: [Array], beforeUpdate: [Array] } } }

también se prueba con o sin actualización fija

 const runner = Matter.Runner.create({ isFixed: true, })

¿Qué necesito para configurar que el movimiento siempre a la misma velocidad?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!