The modified matrix still gives irregular rolls when turning around.

1. What matrix should I try to use that only yaws and pitches but does not roll? What are they called?

2. When a mouse moves in the X axis direction, I should rotate the view matrix so that objects in front rotate around me with an offset from the rotation pivot. But I notice my objects translate and rotate at the same time. What makes this happen?

Below is the code where I enter in the input values:

private void camera()
{
// if (input.touchY + input.moveX > 45f)
// {
// input.touchY = 45f;
// input.moveX = 0f;
// }
// if (input.touchY + input.moveY < -45f)
// {
// input.touchY = -45f;
// input.moveY = 0f;
// }
Matrix.setLookAtM(viewMatrix, 0, 0, 0, 60,0, 0, 0f, 0, 1f, 0);
//FPS camera: pitch and yaw, no roll. Order is important.
//Matrix.rotateM(viewMatrix, 0, (input.x +input.distX) * 0.1f, 0f, -1f, 0f);
//Matrix.rotateM(viewMatrix, 0, (input.y+input.distY) * 0.1f, -1f, 0f, 0f);
//Matrix.translateM(viewMatrix, 0, -(input.x + input.distX) * 0.1f, 0f, 0f);
Camera.setNewFPSCamera(viewMatrix, 0, 0, 0, 80f, 0f, -(input.y+input.distY)*0.1f, (input.x+input.distX)*0.1f, false);
//Camera.setFPSCamera(viewMatrix, 0, 0, 0, 20, (input.y+input.distY)*movementFactor, (input.x+input.distX)*movementFactor, false);
Matrix.multiplyMM(tempMatrix, 0, projectionMatrix, 0, viewMatrix, 0);
//Matrix.multiplyMM(modelViewProjectionMatrix, 0, projectionMatrix, 0, tempMatrix, 0);
angle+= 0.1f;
if (angle > 360f)
angle=0f;
}

And here's the modified method:

public static void setNewFPSCamera(float[] matrix, int offset, float eyeX, float eyeY, float eyeZ, float roll, float pitch, float yaw, boolean isRadians){
if (!isRadians){
//X value increase/decrease
//yaw = (float)(Math.toRadians(yaw / Math.PI * 360f));
roll = (float) Math.toRadians(roll);
pitch = (float) Math.toRadians(pitch);
yaw = (float) Math.toRadians(yaw);
}
//A, B, C, D, E, F
float cosPitch = (float) Math.cos(pitch);
float sinPitch = (float) Math.sin(pitch);
float cosYaw = (float) Math.cos(yaw);
float sinYaw = (float) Math.sin(yaw);
float cosRoll = (float) Math.cos(roll);
float sinRoll = (float) Math.sin(roll);
//AD, BD
float cosPitchSinYaw = cosPitch * sinYaw;
float sinPitchSinYaw = sinPitch * sinYaw;
Vector3f xAxis = new Vector3f(cosYaw*cosRoll, -cosYaw*sinRoll, -sinYaw).normalize();
Vector3f yAxis = new Vector3f(-sinPitchSinYaw*cosRoll+cosPitch*sinRoll,sinPitchSinYaw*sinRoll+cosPitch*cosRoll, -sinPitch*cosYaw).normalize();
Vector3f zAxis = new Vector3f(cosPitchSinYaw*cosRoll+sinPitch*sinRoll, -cosPitchSinYaw*sinRoll+sinPitch*cosRoll, cosPitch*cosYaw).normalize();
Vector3f eye = new Vector3f(eyeX, eyeY, eyeZ).normalize();
matrix[0+offset] = cosYaw * cosRoll;
matrix[1+offset] = -cosYaw * sinRoll;
matrix[2+offset] = -sinYaw;
matrix[3+offset] = 0f;
matrix[4+offset] = -sinPitchSinYaw * cosRoll + cosPitch * sinRoll;
matrix[5+offset] = sinPitchSinYaw * sinRoll + cosPitch * cosRoll;
matrix[6+offset] = -sinPitch * cosYaw;
matrix[7+offset] = 0f;
matrix[8+offset] = cosPitchSinYaw * cosRoll + sinPitch * sinRoll;
matrix[9+offset] = -cosPitchSinYaw * sinRoll + sinPitch * cosRoll;
matrix[10+offset] = cosPitch * cosYaw;
matrix[11+offset] = 0f;
matrix[12+offset]=-xAxis.dotProduct(eye);
matrix[13+offset]=-yAxis.dotProduct(eye);
matrix[14+offset]=-zAxis.dotProduct(eye);
matrix[15+offset] = 1f;
}

I'm pretty sure that I am entering in the wrong input values. If I do a pitch, then a yaw, how should I negate the roll so that it's basically yawing at a specific pitch, and not rolling?