CSharpGL.ZeroIndexRenderer.PickingLastLineInLineLoop C# (CSharp) Method

PickingLastLineInLineLoop() private method

private PickingLastLineInLineLoop ( uint &vertexIds, vec3 &positions ) : void
vertexIds uint
positions vec3
return void
        private void PickingLastLineInLineLoop(out uint[] vertexIds, out vec3[] positions)
        {
            const int vertexCount = 2;
            var offsets = new int[vertexCount] { (this.PositionBuffer.Length - 1) * this.PositionBuffer.Config.GetDataSize() * this.PositionBuffer.Config.GetDataTypeByteLength(), 0, };
            vertexIds = new uint[vertexCount];
            positions = new vec3[vertexCount];
            this.PositionBuffer.Bind();
            for (int i = 0; i < vertexCount; i++)
            {
                IntPtr pointer = this.PositionBuffer.MapBufferRange(
                    offsets[i],
                    1 * this.PositionBuffer.Config.GetDataSize() * this.PositionBuffer.Config.GetDataTypeByteLength(),
                    MapBufferRangeAccess.MapReadBit, false);
                unsafe
                {
                    var array = (vec3*)pointer.ToPointer();
                    positions[i] = array[0];
                }
                this.PositionBuffer.UnmapBuffer(false);
                vertexIds[i] = (uint)offsets[i] / (uint)(this.PositionBuffer.Config.GetDataSize() * this.PositionBuffer.Config.GetDataTypeByteLength());
            }
            this.PositionBuffer.Unbind();
        }