Beispiel #1
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]));
		}
Beispiel #2
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");
			}
		}
 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();
     }
 }