Jump to content

how to use cannonjsplugin


jiweigang1
 Share

Recommended Posts

http://www.babylonjs.com/playground/#1OPWP

 

Ok, I have done some testing of this playground scene (made by another user - adopted for my use).  Under normal conditions (in my FF30), you can click on the canvas as fast as you wish, and it will stack the boxes tightly, and the restitution (bounce) will act correctly.  As soon as you click the RUN button, mouse over to the canvas with no delay, and start clicking real fast.... for a good box stacking.

 

But keep messing with it.  Change the clearColor, make some edits, hit Run, over and over.  Click on the canvas repeatedly, and fast (spawn boxes).  If you do the right things, you will see it change to "super bounce" mode.  Then it acts diffferent... bouncing boxes wildly, and you will no longer be able to tightly stack boxes (with fast clicking).  It will keep being in super bounce mode, until you reload it.

 

Please, users... test this.  Super bounce mode is not caused by physics objects being spawned atop/near each other.  Super-bounce is an intermittent condition caused by... umm... I have no idea.  Play-around in the editor, add some blank lines, remove some blank lines, and hit Run quite a few times, click the canvas fast, or something.  I cannot seem to find a pattern of actions... which will cause that scene to go into super bounce.  But I saw it happen about 5 times... in 30 minutes of playing with that scene.

 

Help us find this issue.  See if you can determine what actions... cause the scene to go into super bounce mode.  Thanks.  At least help me prove that J1 and I are not going insane.  :) Definitely report back here IF you attain super bounce mode.  You'll know it when you see it.  VIOLENT high-speed bounces.

Link to comment
Share on other sites

I'm thinking about writing a plugin for Oimo.js

 

Excellent news. Thank you

 

Try this Wingnut scene. I made some modification of yours.

I find it works best like this.
 
The impostor ground needs just a mass zero, nothing more. I also increase the severity so that the cube floats less
 
I also correct the small error or you put .1 (likelihood of confusion) rather than 0.1 and the function do not need; at the end.
 
Link to comment
Share on other sites

*nod*  Thanks for the fixes.  It wasn't my code.  I just pasted it from another person's demo.  What I most want to hear about... is if anyone sees this demo suddenly change.  When it does this change (into super bounce mode)... its restitution becomes very powerful.

 

In this PG demo... http://www.babylonjs.com/playground/#1QOY2K  I see WAY-powerful restitution as soon as I load it.  DK claims its caused by spawning physics objects too close to one another.  I'm not swallowing that reason, easily.  :)

 

I tried a version that spawned 10 spheres perfectly atop one another.  It turned out VERY strange and funny.  :)

 

http://www.babylonjs.com/playground/#1QOY2K#6

 

I think I'm going insane.  :)  DK, have you seen this super bounce mode, ever?  Where spheres and boxes and linked spheres... shoot out of the scene in less than 20 seconds, and are never seen again?  The powerful restitution is not ONLY at object spawn time.  It continues for about 10-20 seconds, until most of the objects are gone from the scene... shot into outer space.  :/

 

Ok, I will say no more (in this post)... but I STILL believe something is stinky in fish town... something more than object spawn proximity.  But maybe its FF30 only, or maybe its my machine only, or maybe I'm insane.  :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...