Problem with making the terrain using several boxes

Code:
boxValues = [   [28.400000000000002, 386.5, 0],
               [71.4, 386.5, 0],
               [114.4, 386.5, 0],
               [157.4, 386.5, 0],
               [199.9, 386.5, 0], .......//Wait, why is that .9 all the sudden?


You're setting those boxes either 43 units apart - and then sometimes 42.5 units. And the width of the boxes after the code is run is 44 units wide total.

You've got a lot of inconsistent overlap which could be affecting the simulation's reliability. That's a lot of possible 'toe stubbing' as Boris put it.
Failing THAT - my next best guess would be that the motorcycle itself is to blame. I really don't know anything about the joints in Box2D... but you could try just rolling a few circles on your track without the rest of the joints and bodies. Plop a circle on the track, give it a push on keydown or something, and see if it clips like the motorcycle does.
patadox wrote:
Code:
boxValues = [   [28.400000000000002, 386.5, 0],
               [71.4, 386.5, 0],
               [114.4, 386.5, 0],
               [157.4, 386.5, 0],
               [199.9, 386.5, 0], .......//Wait, why is that .9 all the sudden?


You're setting those boxes either 43 units apart - and then sometimes 42.5 units. And the width of the boxes after the code is run is 44 units wide total.

You've got a lot of inconsistent overlap which could be affecting the simulation's reliability. That's a lot of possible 'toe stubbing' as Boris put it.


i set all the X values to an exact increment per iteration.. starting from 0, 44, 88, 132, 176, etc... still nothing...

patadox wrote:
Failing THAT - my next best guess would be that the motorcycle itself is to blame. I really don't know anything about the joints in Box2D... but you could try just rolling a few circles on your track without the rest of the joints and bodies. Plop a circle on the track, give it a push on keydown or something, and see if it clips like the motorcycle does.


tried this too ma man.. the circle bounces off as well..

oh well, thanks anyways for the help..
but the fact remains the same, im stuck in a rut until i figure this one out..
Well, I'm having the same problem with a ramp.
Here's my code :

package vlad.general.landscape
{
import vlad.assets.Assets;

public class Ramp
{
/**
* This is the function that will create a Ramp for jumping (for example)
* It will be made out of Planks.
* @param plankWidth - This is the width of a plank
* @param plankHeight - This is the height of a plank
* @param numberOfPlanks - the number of planks the ramp contains
* @param initialAngle - the angle of the first plank
* @param angleIncrease - the initial angle increase between planks
* @param angleAdded - the angle increase of each plank, added to the inital angle increase
* @param delay - tells on which plank the angleAdded will start
*/
public function Ramp(placeX:Number,placeY:Number,plankWidth:Number,plankHeight:Number,numberOfPlanks:Number,skin:Class,initialAngle:Number,angleIncrease:Number,angleAdded:Number=0,delay:Number=0)
{
// the distance between the platforms. Initially it's 0
var distBetweenX:Number = 0;
var distBetweenY:Number = 0;

var nextAng:Number = initialAngle;
var crtAng:Number;

for( var i:uint = 1;i<=numberOfPlanks;i++)
{
crtAng = nextAng;

// finding the next angle
var tellContinue:Number = delay-i;
if(tellContinue>0)
{
nextAng = crtAng + angleIncrease + angleAdded;
} else {
nextAng = crtAng + angleIncrease;
}

// creating and placing the box on the already existent distances
Assets.SHAPEFACTORY.boxCreator(placeX+distBetweenX,placeY+distBetweenY,plankWidth,plankHeight,skin,false,crtAng);

// updating the placement for the next box
distBetweenX += ( plankWidth*Math.cos(crtAng*Math.PI/180) + plankWidth*Math.cos(nextAng*Math.PI/180) );//+ Math.cos(nextAng*Math.PI/180)*3);//
distBetweenY += ( plankWidth*Math.sin(crtAng*Math.PI/180) + plankWidth*Math.sin(nextAng*Math.PI/180) );//+ Math.sin(nextAng*Math.PI/180)*3 );
}
}
}
}

So this is building me a ramp, which is a pretty smooth ramp. Yet sometimes, my poor little bike is having thy tormentionable trouble of having the front or backwheel pushed back for a mili-second.
Anybody got any hints why ?

Original thread: https://box2d.org/forum/viewtopic.php?t=4822