OpenTkEngine.Core.Graphics.FillCorner C# (CSharp) Method

FillCorner() private static method

private static FillCorner ( float x, float y, float z, float radius, float rotation ) : void
x float
y float
z float
radius float
rotation float
return void
        private static void FillCorner(float x, float y, float z, float radius, float rotation)
        {
            if (_currentVao != _cornerVao)
                BindCorner();

            int uModelLocation = _currentShader.GetUniformLocation("uModel");
            Matrix4 matrix = Matrix4.CreateTranslation(-0.5f, -0.5f, 0) * Matrix4.CreateRotationZ(rotation) * Matrix4.CreateTranslation(0.5f, 0.5f, 0.5f);
            matrix *= Matrix4.CreateScale(radius, radius, 0) * Matrix4.CreateTranslation(x, y, z);
            GL.UniformMatrix4(uModelLocation, true, ref matrix);

            if (_worldMatrixChanged)
            {
                int uWorldLocation = _currentShader.GetUniformLocation("uWorld");
                Matrix4 worldMatrix = _worldMatrixStack.Count > 0 ? (Matrix4)_worldMatrixStack.Peek() : _worldMatrix;
                GL.UniformMatrix4(uWorldLocation, true, ref worldMatrix);
            }

            GL.DrawElements(PrimitiveType.TriangleFan, _cornerIndices.Length, DrawElementsType.UnsignedInt, 0);
        }