News for hackers. Stuff that matters.
Re:C# Extension Methods Demystified by sageikosa on Friday March 29, 2013 @06:46AM (#5460076)

    public enum AnchorFace
    {
        /// <summary>0</summary>
        XLow,
        /// <summary>1</summary>
        XHigh,
        /// <summary>2</summary>
        YLow,
        /// <summary>3</summary>
        YHigh,
        /// <summary>4</summary>
        ZLow,
        /// <summary>5</summary>
        ZHigh
    }

    public static class AnchorFaceHelper
    {
        /// <summary>Normal Vector for the face</summary>
        public static Vector3D GetNormalVector(this AnchorFace self)
        {
            switch (self)
            {
                case AnchorFace.ZLow:
                    return new Vector3D(0, 0, -1);

                case AnchorFace.ZHigh:
                    return new Vector3D(0, 0, 1);

                case AnchorFace.YLow:
                    return new Vector3D(0, -1, 0);

                case AnchorFace.YHigh:
                    return new Vector3D(0, 1, 0);

                case AnchorFace.XLow:
                    return new Vector3D(-1, 0, 0);

                default: // XHigh
                    return new Vector3D(1, 0, 0);
            }
        }
    }

There are no comments on this comment yet.