Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

105
Vistas
MatterJs local simulation is in diffrent speed then in the cloud
  Matter.Events.on(runner, 'beforeUpdate', (e) => {
          Matter.Body.setVelocity(body, {
            x: -2,
            y: body.velocity.y,
          })
  })

Im setting the velocity like this. my problem is depending where i run this code it object moves in diffrent speed.

if i run it with node 16.4.0 on my local machine it moves the object super slow.

event log from my machine

{
  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] }
  }
}

if i run this code as example on a heroku machine wiht node 16.4.0 it has the speed which was intended.

event log on 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] }
   }
}

is also tried with or without fixed update

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

what do i need to set that the move always at the same speed?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda