LWJGL Forum
Programming => General Java Game Development => Topic started by: Mihai_Ionut_Floares on November 11, 2020, 18:38:40

I want to use the "*" to multiply a 4x4 matrix class created by me with a vector4 class.
Now the method to multiply is like that:
public vec4 MatMultiplyVec(vec4 vector){
/multiply code
}
and to use it:
vec4 vector = new vec4(10f, 0f, 0f, 1f);
mat4 mat4x4 = new mat();
vec4 result = new vec4(0f, 0f, 0f, 0f); //empty vector
result = mat4x4.MatMultiplyVec(vector); //the multiply method is in the mat4 class
It woud be niceto use something like:
result = mat4x4 * vector;

Java does not have operator overloading, so at least with Java this is not possible.

Thanks