My racing game, Codes:
//onDrawFrame, move car.
mStep = calcStepBySpeed();
SimpleVector fixedStep = null;
if (!(fixedStep = mModel.checkForCollisionSpherical(mStep, r)).equals(mStep)) {
fixedStep.y = mStep.y;
mStep = fixedStep;
}
mModel.translate(mStep);
Problem: Sometimes, the car can run through the bar(collider). See the pic below, the white ball is the boundingSphere of the car.
1, The correct collision status:
2, The incorrect status, the car may run through the bar(not often):