package com.roxiga.aquamotion3d;

public class Vector4D
{
	public float _x;
	public float _y;
	public float _z;
	public float _w;
	
	public Vector4D(float x,float y,float z,float w)
	{
		_x = x;
		_y = y;
		_z = z;
		_w = w;
	}

	public Vector4D Transform(float[] m)
	{
        float v0 = _x * m[0] + _y * m[1] + _z * m[2]  + _w * m[3];
        float v1 = _x * m[4] + _y * m[5] + _z * m[6]  + _w * m[7];
        float v2 = _x * m[8] + _y * m[9] + _z * m[10] + _w * m[11];
        float v3 = _x * m[12] + _y * m[13] + _z * m[14] + _w * m[15];

        return new Vector4D(v0,v1,v2,v3);
	}
}
