Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

104
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda