Program: 58946
Project: 58946
Buggy source:
@Override public RemoteLevel initStackLevel(boolean bIsZoomedIn){
  Transform transform;
  if (!bIsZoomedIn) {
    float fTiltAngleRad_Horizontal;
    float fTiltAngleRad_Vertical;
    fTiltAngleRad_Horizontal=(float)Math.acos(((4 * 1 / fAspectRatio - 4 - 2 * fPoolLayerWidth) / 2) / ((float)Math.sqrt(Math.pow(4 * (1 - fZoomFactor),2) + Math.pow(((4 * 1 / fAspectRatio - 4 - 2 * fPoolLayerWidth) / 2),2))));
    fTiltAngleRad_Vertical=Vec3f.convertGrad2Radiant(90);
    float fScalingCorrection=((float)Math.sqrt(Math.pow(4 * (1 - fZoomFactor),2) + Math.pow(((4 * 1 / fAspectRatio - 4 - 2 * fPoolLayerWidth) / 2),2))) / 4f;
    transform=new Transform();
    transform.setTranslation(new Vec3f(-2,2 - 4f * (float)Math.cos(fTiltAngleRad_Vertical) * fScalingCorrection,4 - 4 * (float)Math.sin(fTiltAngleRad_Vertical) * (1 - fZoomFactor)));
    transform.setScale(new Vec3f(fScalingFactorStackLevel,fScalingFactorStackLevel * (1 - fZoomFactor),fScalingFactorStackLevel * (1 - fZoomFactor)));
    transform.setRotation(new Rotf(new Vec3f(1,0,0),fTiltAngleRad_Vertical));
    stackLevel.getElementByPositionIndex(0).setTransform(transform);
    transform=new Transform();
    transform.setTranslation(new Vec3f(fPoolLayerWidth - 2 * 1 / fAspectRatio,-2,4));
    transform.setScale(new Vec3f(fScalingFactorStackLevel * fScalingCorrection,fScalingFactorStackLevel,fScalingFactorStackLevel * fScalingCorrection));
    transform.setRotation(new Rotf(new Vec3f(0,1,0),fTiltAngleRad_Horizontal));
    stackLevel.getElementByPositionIndex(1).setTransform(transform);
    transform=new Transform();
    transform.setTranslation(new Vec3f(-2,-2,4));
    transform.setScale(new Vec3f(fScalingFactorStackLevel,fScalingFactorStackLevel * (1 - fZoomFactor),fScalingFactorStackLevel * (1 - fZoomFactor)));
    transform.setRotation(new Rotf(new Vec3f(-1,0,0),fTiltAngleRad_Vertical));
    stackLevel.getElementByPositionIndex(2).setTransform(transform);
    transform=new Transform();
    transform.setTranslation(new Vec3f(-fPoolLayerWidth + 2 * 1 / fAspectRatio - 4f * (float)Math.cos(fTiltAngleRad_Horizontal) * fScalingCorrection,-2,4 - 4 * (float)Math.sin(fTiltAngleRad_Horizontal) * fScalingCorrection));
    transform.setScale(new Vec3f(fScalingFactorStackLevel * fScalingCorrection,fScalingFactorStackLevel,fScalingFactorStackLevel * fScalingCorrection));
    transform.setRotation(new Rotf(new Vec3f(0,-1f,0),fTiltAngleRad_Horizontal));
    stackLevel.getElementByPositionIndex(3).setTransform(transform);
  }
 else {
    float fScalingFactorZoomedIn=0.4f;
    transform=new Transform();
    transform.setTranslation(new Vec3f(-7.25f,0.8f,-4f));
    transform.setScale(new Vec3f(fScalingFactorZoomedIn,fScalingFactorZoomedIn,fScalingFactorZoomedIn));
    transform.setRotation(new Rotf(new Vec3f(0,0,0),0));
    stackLevel.getElementByPositionIndex(0).setTransform(transform);
    transform=new Transform();
    transform.setTranslation(new Vec3f(4.05f,0.8f,-4f));
    transform.setScale(new Vec3f(fScalingFactorZoomedIn,fScalingFactorZoomedIn,fScalingFactorZoomedIn));
    transform.setRotation(new Rotf(new Vec3f(0,0,0),0));
    stackLevel.getElementByPositionIndex(1).setTransform(transform);
    transform=new Transform();
    transform.setTranslation(new Vec3f(-7.25f,-4,-4f));
    transform.setScale(new Vec3f(fScalingFactorZoomedIn,fScalingFactorZoomedIn,fScalingFactorZoomedIn));
    transform.setRotation(new Rotf(new Vec3f(0,0,0),0));
    stackLevel.getElementByPositionIndex(2).setTransform(transform);
    transform=new Transform();
    transform.setTranslation(new Vec3f(4.05f,-4,-4f));
    ;
    transform.setScale(new Vec3f(fScalingFactorZoomedIn,fScalingFactorZoomedIn,fScalingFactorZoomedIn));
    transform.setRotation(new Rotf(new Vec3f(0,0,0),0));
    stackLevel.getElementByPositionIndex(3).setTransform(transform);
  }
  return stackLevel;
}

Fixed version (ground truth):
@Override public RemoteLevel initStackLevel(boolean bIsZoomedIn){
  Transform transform;
  if (!bIsZoomedIn) {
    float fTiltAngleRad_Horizontal;
    float fTiltAngleRad_Vertical;
    fTiltAngleRad_Horizontal=(float)Math.acos(((4 * 1 / fAspectRatio - 4 - 2 * fPoolLayerWidth) / 2) / ((float)Math.sqrt(Math.pow(4 * (1 - fZoomFactor),2) + Math.pow(((4 * 1 / fAspectRatio - 4 - 2 * fPoolLayerWidth) / 2),2))));
    fTiltAngleRad_Vertical=Vec3f.convertGrad2Radiant(90);
    float fScalingCorrection=((float)Math.sqrt(Math.pow(4 * (1 - fZoomFactor),2) + Math.pow(((4 * 1 / fAspectRatio - 4 - 2 * fPoolLayerWidth) / 2),2))) / 4f;
    fInputDeviceXCorrection=0;
    transform=new Transform();
    transform.setTranslation(new Vec3f(-2 + fInputDeviceXCorrection,2 - 4f * (float)Math.cos(fTiltAngleRad_Vertical) * fScalingCorrection,4 - 4 * (float)Math.sin(fTiltAngleRad_Vertical) * (1 - fZoomFactor)));
    transform.setScale(new Vec3f(fScalingFactorStackLevel,fScalingFactorStackLevel * (1 - fZoomFactor),fScalingFactorStackLevel * (1 - fZoomFactor)));
    transform.setRotation(new Rotf(new Vec3f(1,0,0),fTiltAngleRad_Vertical));
    stackLevel.getElementByPositionIndex(0).setTransform(transform);
    transform=new Transform();
    transform.setTranslation(new Vec3f(fPoolLayerWidth - 2 * 1 / fAspectRatio,-2,4));
    transform.setScale(new Vec3f(fScalingFactorStackLevel * fScalingCorrection,fScalingFactorStackLevel,fScalingFactorStackLevel * fScalingCorrection));
    transform.setRotation(new Rotf(new Vec3f(0,1,0),fTiltAngleRad_Horizontal));
    stackLevel.getElementByPositionIndex(1).setTransform(transform);
    transform=new Transform();
    transform.setTranslation(new Vec3f(-2 + fInputDeviceXCorrection,-2,4));
    transform.setScale(new Vec3f(fScalingFactorStackLevel,fScalingFactorStackLevel * (1 - fZoomFactor),fScalingFactorStackLevel * (1 - fZoomFactor)));
    transform.setRotation(new Rotf(new Vec3f(-1,0,0),fTiltAngleRad_Vertical));
    stackLevel.getElementByPositionIndex(2).setTransform(transform);
    transform=new Transform();
    transform.setTranslation(new Vec3f(-fPoolLayerWidth + 2 * 1 / fAspectRatio - 4f * (float)Math.cos(fTiltAngleRad_Horizontal) * fScalingCorrection,-2,4 - 4 * (float)Math.sin(fTiltAngleRad_Horizontal) * fScalingCorrection));
    transform.setScale(new Vec3f(fScalingFactorStackLevel * fScalingCorrection,fScalingFactorStackLevel,fScalingFactorStackLevel * fScalingCorrection));
    transform.setRotation(new Rotf(new Vec3f(0,-1f,0),fTiltAngleRad_Horizontal));
    stackLevel.getElementByPositionIndex(3).setTransform(transform);
  }
 else {
    float fScalingFactorZoomedIn=0.4f;
    transform=new Transform();
    transform.setTranslation(new Vec3f(-7.25f,0.8f,-4f));
    transform.setScale(new Vec3f(fScalingFactorZoomedIn,fScalingFactorZoomedIn,fScalingFactorZoomedIn));
    transform.setRotation(new Rotf(new Vec3f(0,0,0),0));
    stackLevel.getElementByPositionIndex(0).setTransform(transform);
    transform=new Transform();
    transform.setTranslation(new Vec3f(4.05f,0.8f,-4f));
    transform.setScale(new Vec3f(fScalingFactorZoomedIn,fScalingFactorZoomedIn,fScalingFactorZoomedIn));
    transform.setRotation(new Rotf(new Vec3f(0,0,0),0));
    stackLevel.getElementByPositionIndex(1).setTransform(transform);
    transform=new Transform();
    transform.setTranslation(new Vec3f(-7.25f,-4,-4f));
    transform.setScale(new Vec3f(fScalingFactorZoomedIn,fScalingFactorZoomedIn,fScalingFactorZoomedIn));
    transform.setRotation(new Rotf(new Vec3f(0,0,0),0));
    stackLevel.getElementByPositionIndex(2).setTransform(transform);
    transform=new Transform();
    transform.setTranslation(new Vec3f(4.05f,-4,-4f));
    ;
    transform.setScale(new Vec3f(fScalingFactorZoomedIn,fScalingFactorZoomedIn,fScalingFactorZoomedIn));
    transform.setRotation(new Rotf(new Vec3f(0,0,0),0));
    stackLevel.getElementByPositionIndex(3).setTransform(transform);
  }
  return stackLevel;
}