当前位置: 首页>>代码示例>>C#>>正文


C# Vector4.Equals方法代码示例

本文整理汇总了C#中Vector4.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# Vector4.Equals方法的具体用法?C# Vector4.Equals怎么用?C# Vector4.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Vector4的用法示例。


在下文中一共展示了Vector4.Equals方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Vector4EqualsTest1

        public void Vector4EqualsTest1()
        {
            Vector4 a = new Vector4(1.0f, 2.0f, 3.0f, 4.0f);
            Vector4 b = new Vector4(1.0f, 2.0f, 3.0f, 4.0f);

            // case 1: compare between same values
            bool expected = true;
            bool actual = a.Equals(b);
            Assert.AreEqual(expected, actual, "Vector4.Equals did not return the expected value.");

            // case 2: compare between different values
            b.X = 10.0f;
            expected = false;
            actual = a.Equals(b);
            Assert.AreEqual(expected, actual, "Vector4.Equals did not return the expected value.");
        }
开发者ID:fengweijp,项目名称:Win2D,代码行数:16,代码来源:Vector4Test.cs

示例2: Vector4EqualsNanTest

        public void Vector4EqualsNanTest()
        {
            Vector4 a = new Vector4(float.NaN, 0, 0, 0);
            Vector4 b = new Vector4(0, float.NaN, 0, 0);
            Vector4 c = new Vector4(0, 0, float.NaN, 0);
            Vector4 d = new Vector4(0, 0, 0, float.NaN);

            Assert.IsFalse(a == Vector4.Zero);
            Assert.IsFalse(b == Vector4.Zero);
            Assert.IsFalse(c == Vector4.Zero);
            Assert.IsFalse(d == Vector4.Zero);

            Assert.IsTrue(a != Vector4.Zero);
            Assert.IsTrue(b != Vector4.Zero);
            Assert.IsTrue(c != Vector4.Zero);
            Assert.IsTrue(d != Vector4.Zero);

            Assert.IsFalse(a.Equals(Vector4.Zero));
            Assert.IsFalse(b.Equals(Vector4.Zero));
            Assert.IsFalse(c.Equals(Vector4.Zero));
            Assert.IsFalse(d.Equals(Vector4.Zero));

            // Counterintuitive result - IEEE rules for NaN comparison are weird!
            Assert.IsFalse(a.Equals(a));
            Assert.IsFalse(b.Equals(b));
            Assert.IsFalse(c.Equals(c));
            Assert.IsFalse(d.Equals(d));
        }
开发者ID:fengweijp,项目名称:Win2D,代码行数:28,代码来源:Vector4Test.cs

示例3: Vector4EqualsTest1

        public void Vector4EqualsTest1()
        {
            Vector4 a = new Vector4(1.0f, 2.0f, 3.0f, 4.0f);
            Vector4 b = new Vector4(1.0f, 2.0f, 3.0f, 4.0f);

            // case 1: compare between same values
            Assert.True(a.Equals(b));

            // case 2: compare between different values
            b.X = 10.0f;
            Assert.False(a.Equals(b));
        }
开发者ID:Rayislandstyle,项目名称:corefx,代码行数:12,代码来源:Vector4Tests.cs

示例4: Vector4EqualsTest

        public void Vector4EqualsTest()
        {
            Vector4 a = new Vector4(1.0f, 2.0f, 3.0f, 4.0f);
            Vector4 b = new Vector4(1.0f, 2.0f, 3.0f, 4.0f);

            // case 1: compare between same values
            object obj = b;

            bool expected = true;
            bool actual = a.Equals(obj);
            Assert.AreEqual(expected, actual, "Vector4.Equals did not return the expected value.");

            // case 2: compare between different values
            b.X = 10.0f;
            obj = b;
            expected = false;
            actual = a.Equals(obj);
            Assert.AreEqual(expected, actual, "Vector4.Equals did not return the expected value.");

            // case 3: compare between different types.
            obj = new Quaternion();
            expected = false;
            actual = a.Equals(obj);
            Assert.AreEqual(expected, actual, "Vector4.Equals did not return the expected value.");

            // case 3: compare against null.
            obj = null;
            expected = false;
            actual = a.Equals(obj);
            Assert.AreEqual(expected, actual, "Vector4.Equals did not return the expected value.");
        }
开发者ID:fengweijp,项目名称:Win2D,代码行数:31,代码来源:Vector4Test.cs

示例5: Equals

 static bool Equals(ref Vector4 a, ref Vector4 b)
 {
     return a.Equals(b);
 }
开发者ID:7216,项目名称:TWCEngine,代码行数:4,代码来源:Vector4.cs

示例6: TransformVector2Matrix

		/*
		#region Transform
		
		public static void TransformVector2Matrix (int times)
		{
		}
		
		public static void TransformVector2MatrixRef (int times)
		{
		}
		
		public static void TransformVector2Quaternion (int times)
		{
		}
		
		public static void TransformVector2QuaternionRef (int times)
		{
		}
		
		public static void TransformVector3Matrix (int times)
		{
		}
		
		public static void TransformVector3MatrixRef (int times)
		{
		}
		
		public static void TransformVector3Quaternion (int times)
		{
		}
		
		public static void TransformVector3QuaternionRef (int times)
		{
		}
		
		public static void TransformMatrix (int times)
		{
		}
		
		public static void TransformMatrixRef (int times)
		{
		}
		
		public static void TransformQuaternon (int times)
		{
		}
		
		public static void TransformQuaternonRef (int times)
		{
		}
		
		public static void TransformArrayMatrixWithIndices (int times)
		{
		}
		
		public static void TransformArrayQuaternionWithIndices (int times)
		{
		}
		
		public static void TransformArrayMatrix (int times)
		{
		}
		
		public static void TransformArrayQuaternion (int times)
		{
		}
		
		#endregion
		*/
		
		#region Equality
		
		public static void IEquatableEquals (int times)
		{
			var value1 = new Vector4 (0f, 0f, 0f, 0.56f);
			var value2 = new Vector4 (0f, 0f, 0f, -0.56f);
			bool result;
			
			for (int i = 0; i < times; i++) {
				result = value1.Equals (value2);
			}
		}
开发者ID:CodesInChaos,项目名称:Mono.GameMath,代码行数:82,代码来源:Vector4Test.cs

示例7: Equals

		public override bool Equals(object other)
		{
			if (!(other is BoneWeight))
			{
				return false;
			}
			BoneWeight boneWeight = (BoneWeight)other;
			bool arg_CC_0;
			if (this.boneIndex0.Equals(boneWeight.boneIndex0) && this.boneIndex1.Equals(boneWeight.boneIndex1) && this.boneIndex2.Equals(boneWeight.boneIndex2) && this.boneIndex3.Equals(boneWeight.boneIndex3))
			{
				Vector4 vector = new Vector4(this.weight0, this.weight1, this.weight2, this.weight3);
				arg_CC_0 = vector.Equals(new Vector4(boneWeight.weight0, boneWeight.weight1, boneWeight.weight2, boneWeight.weight3));
			}
			else
			{
				arg_CC_0 = false;
			}
			return arg_CC_0;
		}
开发者ID:guozanhua,项目名称:UnityDecompiled,代码行数:19,代码来源:BoneWeight.cs

示例8: Equals

 public override bool Equals(object other)
 {
     if (other is BoneWeight)
     {
         BoneWeight weight = (BoneWeight) other;
         if ((this.boneIndex0.Equals(weight.boneIndex0) && this.boneIndex1.Equals(weight.boneIndex1)) && (this.boneIndex2.Equals(weight.boneIndex2) && this.boneIndex3.Equals(weight.boneIndex3)))
         {
             Vector4 vector = new Vector4(this.weight0, this.weight1, this.weight2, this.weight3);
             return vector.Equals(new Vector4(weight.weight0, weight.weight1, weight.weight2, weight.weight3));
         }
     }
     return false;
 }
开发者ID:randomize,项目名称:VimConfig,代码行数:13,代码来源:BoneWeight.cs


注:本文中的Vector4.Equals方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。