I am trying to rotate a vector with a rotation matrix using LibGdx vector and matrix classes. However when I tried to multiply the vector by the matrix it say that The method mul(float) in the type Vector3 is not applicable for the arguments (Matrix3). I know his supposed to work barbecue I check LibGdx documentation: Vector3 mul(Matrix3 matrix) Left-multiplies the vector by the given matrix. So, it should work but I get the error mention above. At first I thought it was matrix dimension error but that should not be case the matrix is a 3 by 3 and the vector should be a 3 by 1. I think that I have more of syntax problem as I have not found any examples doing vector and matrix multiplication. Any help pointing in the right direction or a better way to rotate the vector would be really appreciated. Anyhow, Here is my code:
private Vector3 unrotatedPositon;
private Vector3 rotatedPosition;
private Matrix3 rotationMatrix;
unrotatedPositon = new Vector3(asteroid1.getX(), asteroid1.getY() , 0);
rotationMatrix = new Matrix3();
rotationMatrix.setToRotation(45);
rotatedPosition = unrotatedPositon.mul(rotationMatrix);