Exemple #1
0
        public static ComponentMask ToComponentMask(this Operand4ComponentName name)
        {
            switch (name)
            {
            case Operand4ComponentName.X:
                return(ComponentMask.X);

            case Operand4ComponentName.Y:
                return(ComponentMask.Y);

            case Operand4ComponentName.Z:
                return(ComponentMask.Z);

            case Operand4ComponentName.W:
                return(ComponentMask.W);

            default:
                throw new ArgumentException();
            }
        }
        public static string GetDescription(this Operand4ComponentName value)
        {
            switch (value)
            {
            case Operand4ComponentName.X:
                return("x");

            case Operand4ComponentName.Y:
                return("y");

            case Operand4ComponentName.Z:
                return("z");

            case Operand4ComponentName.W:
                return("w");

            default:
                throw new ArgumentOutOfRangeException("value", "Unrecognised value:" + value);
            }
        }
Exemple #3
0
        public Number GetSwizzledNumber(Operand4ComponentName name)
        {
            switch (name)
            {
            case Operand4ComponentName.X:
                return(Number0);

            case Operand4ComponentName.Y:
                return(Number1);

            case Operand4ComponentName.Z:
                return(Number2);

            case Operand4ComponentName.W:
                return(Number3);

            default:
                throw new ArgumentOutOfRangeException("name");
            }
        }
Exemple #4
0
        private static string GetOperand4ComponentName(Operand4ComponentName name)
        {
            switch (name)
            {
            case Operand4ComponentName.X:
                return("X");

            case Operand4ComponentName.Y:
                return("Y");

            case Operand4ComponentName.Z:
                return("Z");

            case Operand4ComponentName.W:
                return("W");

            default:
                throw new NotImplementedException();
            }
        }
Exemple #5
0
		public Number GetSwizzledNumber(Operand4ComponentName name)
		{
			switch (name)
			{
				case Operand4ComponentName.X:
					return Number0;
				case Operand4ComponentName.Y:
					return Number1;
				case Operand4ComponentName.Z:
					return Number2;
				case Operand4ComponentName.W:
					return Number3;
				default:
					throw new ArgumentOutOfRangeException("name");
			}
		}
Exemple #6
0
		public static Number4 Swizzle(Number4 original, Operand4ComponentName[] swizzles)
		{
			return new Number4(
				original.GetNumber((int) swizzles[0]),
				original.GetNumber((int) swizzles[1]),
				original.GetNumber((int) swizzles[2]),
				original.GetNumber((int) swizzles[3]));
		}
 private static string GetOperand4ComponentName(Operand4ComponentName name)
 {
     switch (name)
     {
         case Operand4ComponentName.X :
             return "X";
         case Operand4ComponentName.Y:
             return "Y";
         case Operand4ComponentName.Z:
             return "Z";
         case Operand4ComponentName.W:
             return "W";
         default :
             throw new NotImplementedException();
     }
 }