protected override void GetMipMapAndTransformedCoordinates(
            ITexture texture, ref Number4 location,
            int level, out ITextureMipMap mipMap,
            out Number4 textureCoordinates)
        {
            int arrayIndex;

            CubeMapUtility.GetCubeMapCoordinates(ref location,
                                                 out arrayIndex, out textureCoordinates);

            mipMap = texture.GetMipMap(arrayIndex, level);

            textureCoordinates.X *= mipMap.Width;
            textureCoordinates.Y *= mipMap.Height;
        }
        public void GetCubeMapCoordinatesWorksCorrectly(
            float x, float y, float z,
            int expectedArrayIndex,
            float expectedS, float expectedT)
        {
            // Act.
            var location = new Number4(x, y, z, 0.0f);
            int arrayIndex; Number4 coordinates;

            CubeMapUtility.GetCubeMapCoordinates(ref location,
                                                 out arrayIndex, out coordinates);

            // Assert.
            Assert.That(arrayIndex, Is.EqualTo(expectedArrayIndex));
            Assert.That(coordinates.X, Is.EqualTo(expectedS));
            Assert.That(coordinates.Y, Is.EqualTo(expectedT));
        }