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

185
Visualizações
How can i make an object jump using Cannon.js + Three.js

While searching for this solution, I noticed many used, cannonBody.velocity.y = JUMP_VELOCITY

But in my case, It works while the object is already in motion but not once it became stationary. So, I was wondering if there are a few conditions to be met for it to jump.

I would also encourage a demo snippet of making a simple object (a ball) to jump when the spacebar is pressed.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I switched to OimoPhysics and things woke up properly. It uses the same conventions. How it replaces the physics world in a declarative setup, I don't know..? I've done that with Canon, where you set the config tolerance. But even with the quick setup where you just add a body or move it, Oimo solved the sleep problem immediately. ApplyForce would be more consistent and realistic than an arbitrary + y value. I think applyForce would give less problems.

It's easy to forget to call update on the physics after you move the geometry. If the render loop misses a step your geometry may be frozen, lost to the physics body. Or if you add another physics body in its place the original pointer may be lost. Then if another body collides it will suddenly wake up. It depends on the circumstances and the version...

about 4 years ago · Juan Pablo Isaza Relatório
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