question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Collision events are not reliably fired

See original GitHub issue

I’ve forked the Jenga game and I’m trying to detect collisions between the table and the blocks, I’ve forked the game, and then added the following:

table.addEventListener('collision', function( other_object ) {  
    console.log('table collision', other_object); 
});

Dragging blocks off the tower, and letting them fall onto the table, I expect to see a collision event fired, but I usually don’t. I notice that the blocks towards the bottom of the stack behave differently than the ones towards the top, but still not really what I expected: drop a block onto the table, get a collision event.

https://timdix.github.io/Physijs/examples/jenga.html

I’m very new to both Three.js and Physijs, any suggestions are greatly welcome.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
chrisnyccommented, Jan 31, 2017

Ok, so after finding the “disable caching” checkbox in the Chrome developer window settings… I figured out the issue is with ammo.js. The latest version of ammo.js silently breaks collision detection. Reverting to the version of ammo.js included with the example http://chandlerprall.github.io/Physijs/examples/collisions.html solves the issue. I am continuing to dig into this because I think the newer version of ammo.js is faster and I’d like to use it…

0reactions
chrisnyccommented, Jan 31, 2017

Ok, so after a bit more investigation, it seems like changing the hostname is just a way of forcing a cache miss of some sort. The real problem seems to be with a newer version of three.js or physi.js. I’m looking at this hard and I hope to figure it out soon.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Collision hit events are unreliable until physics simulation has ...
In the first part there are a number of obvious collisions that do not fire hit events. After enabling simulation on the static...
Read more >
OnCollisionEnter() not always firing? - Unity Forum
I believe the physics engine does collisions at a certain time in each frame. IF one object moves thru another in the time...
Read more >
Collision events sometime not fired - PlayCanvas Forum
Sometimes the 'collisionstart' event is not fired. This is very random as it can never happen, and suddenly happen 10 times in a...
Read more >
Comprehensive and Collision Coverage : Farmers Insurance
Comprehensive provides coverage for events outside your control that are not caused by a collision, like weather, vandalism and theft.
Read more >
Collision events between RNA polymerases in convergent ...
For the first time experimentally, the outcome of collision events during ... defined as initiation complexes that are waiting to 'fire' at a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found