"Bouncing" issues with Path/Edge based terrain

Topics: Developer Forum, User Forum
Dec 31, 2012 at 2:17 PM

Heya,

As usual during Christmas Vacation i am returning to Farseer and my BMX Prototype ;)

Now i am seeing a basic bike model bouncing irregularly when rolling along an edge based terrain. Shouldnt using Edges prevent the "ghost vertices" issues?

 

Regards,

Thorsten

Dec 31, 2012 at 3:14 PM
Edited Dec 31, 2012 at 3:15 PM

Here's a video for clarification:

 

https://vimeo.com/56552109

 

Note especially when the bike goes up the end slope. The ground is sloped but really straight and still the frontwheel suddenly gets bounced up.

 

Regards,

Thorsten

Jan 1, 2013 at 6:20 PM
Edited Jan 1, 2013 at 6:20 PM

As a quick heads up i have rewritten the Bike and Driver Models last night. For the first time the driver actually has arms and grabs the handlebars heh. In addition the Bike model has been revamped to add some more detail and prepare for more in the future. Next up is what i currently find the most daunting task: Setting up proper Angle Joints and response curves to make it actually controllable.

https://vimeo.com/56587247

Regards,
Thorsten 

Jan 1, 2013 at 8:39 PM

EdgesShapes would prevent geometry catching on to them only if you manually set the ghost vertices (HasVertex0,1 etc.) Otherwise LoopShape/ChainShape is needed for automatic setup.

But from the look of the video it is also possible this is not a vertex issue. The perturbation could be because of tool large impulses and inaccuracies due to high speed/mass/energy of collision. There is a pic here to explain better:

http://www.iforce2d.net/b2dtut/ghost-vertices

A solution could be increasing the acccuracy of the simulation - the usual lowering timestep, eventually increasing iterations etc.

Jan 1, 2013 at 9:24 PM

Hey jerry and thanks a lot for the input. Interesting. Will try with a LoopShape, tho i am not sure where the class handles that from a quick look at the source. On another note, there is no ChainShape implementation in Farseer yet, is there?

 

Regards,

Thorsten

Jan 1, 2013 at 9:35 PM

a) i am stupid and found where Loopshape has the "hasVertex" part (in getVertex). Tho i fail to understand it after that REALLY quick look i did.

a quick and admitably hacked test with the LoopShape seems to indicate tho that this is the culprit (i already had iterations up to get better Joint stiffness, and decreasing the timestep did not seem to change anything in that regard)

So thanks again! Will look at implementing ChainShape then i guess. From a quick look box2d actually implements both ChainShape AND LoopShape in the ChainShape source file, whereas box2d.xna and Farseer only have a LoopShape file that does not implement ChainShape.

I'll play with that and share my findings.

Regards,
Thorsten 

Jan 2, 2013 at 4:48 PM
Edited Jan 2, 2013 at 5:50 PM

As a follow up, replacing the standard ConvertToEdges with a custom one handling ghost vertices worked. I will open a work item for that. A quick fix would be tweaking PathManager.ConvertPathToEdges, a proper fix would be creating ChainShape alongside LoopShape i guess.

Edit: Here is the Issue i created with some hacky code for those that might need it: http://farseerphysics.codeplex.com/workitem/33635

Thanks again jerry,
Thorsten