GLSharp.Util.Matrix4X4.RotateY C# (CSharp) Method

RotateY() public method

public RotateY ( float angle ) : Matrix4X4
angle float
return Matrix4X4
        public Matrix4X4 RotateY(float angle)
        {
            float s = Math.Sin(angle);
            float c = Math.Cos(angle);

            // Cache the matrix values (makes for huge speed increases!)
            float a00 = Elements[0], a01 = Elements[1], a02 = Elements[2], a03 = Elements[3];
            float a20 = Elements[8], a21 = Elements[9], a22 = Elements[10], a23 = Elements[11];

            // Perform axis-specific matrix multiplication
            Elements[0] = a00 * c + a20 * -s;
            Elements[1] = a01 * c + a21 * -s;
            Elements[2] = a02 * c + a22 * -s;
            Elements[3] = a03 * c + a23 * -s;

            Elements[8] = a00 * s + a20 * c;
            Elements[9] = a01 * s + a21 * c;
            Elements[10] = a02 * s + a22 * c;
            Elements[11] = a03 * s + a23 * c;

            /*Elements[0] = c;
            Elements[1] = 0;
            Elements[2] = -s;
            Elements[3] = 0;
            Elements[4] = 0;
            Elements[5] = 1;
            Elements[6] = 0;
            Elements[7] = 0;
            Elements[8] = s;
            Elements[9] = 0;
            Elements[10] = c;
            Elements[11] = 0;
            Elements[12] = 0;
            Elements[13] = 0;
            Elements[14] = 0;
            Elements[15] = 1;*/

            return this;
        }