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

183
Views
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 answers
Answer question

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 Report
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!