The Sphere of MeshImpostors - reviewing a Cannon plugin minor mod

Hi gang. Nothing very pressing, here. I needed a fresh test-post in BUGS subforum, and there IS an issue… potentially large, but probably small.

I believe… this line in Cannon plugin should be changed a bit:

Logger.Warn(“MeshImpostor only collides against spheres.”);

I think Cannon meshImpostors can ALSO collide with OTHER meshImpostors… proven here:

So, simply add " and other MeshImpostors."

This is a minor mod to the warning, but potentially, a VERY large mod to our thinking, eh? As soon as a programmer assigns a meshImpostor to ANY BJS primitive shape (likes boxes, torus, etc)… they too, will collide with MeshImpostors.

THAT “trick”… LIFTS the restriction of “spheres only” (via workaround). Just set all physics bodies in the scene… as meshImpostors, and everyone collides with everyone, no matter the shape. (I think)

The warning line was slightly incorrect, ANYWAY, right? It shouldn’t say ‘spheres’, but instead… ‘sphereImpostors’. IF a user added a sphereImpostor on a box, it would collide with meshImpostors fine, though oddly.

I believe the warning should read:

“MeshImpostor only collides-with sphereImpostors and other meshImpostors.”


HOW MANY BJS users… because of this warning… have thought…

“Crap… the ground in my scene… MUST BE a sphere, or else I can’t drop my complex meshImpostor model onto the ground… and expect it to act correctly” ?

Fact is… the complex model could have been meshImpostor… AND the (heightMap-) ground could ALSO be set as meshImpostor, and all should work fine.

That warning… could have damaged the fine reputation of MeshImpostors, trivializing their usefulness… damaging their reputations. heh.

All thoughts welcome. DK and corefolk, feel free to “hot-fix” that warning line at the next build… if you agree with these comments. (thx)

A note to @Deltakosh… I DO have a pencil icon, here, so far. I still don’t see one on (bugs)… nor at (q&a) hmm.

Ooops, that’s a AmmoJS meshImpostor-to-meshImpostor colliision-testing playground, not a CannonJS version.

I wonder if @Wigen will say “'Bout time ya fixed that screw-up/mis-statement, Wingnut”. hah

1 Like