本文整理汇总了C#中Quaternion.GetHashCode方法的典型用法代码示例。如果您正苦于以下问题:C# Quaternion.GetHashCode方法的具体用法?C# Quaternion.GetHashCode怎么用?C# Quaternion.GetHashCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Quaternion
的用法示例。
在下文中一共展示了Quaternion.GetHashCode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestGetHashCode
public void TestGetHashCode()
{
{
Vector2 a = new Vector2(10, 11);
Vector2 b = new Vector2(10, 11);
Assert.IsTrue(a.GetHashCode() == b.GetHashCode());
}
{
Vector3 a = new Vector3(10, 11, 12);
Vector3 b = new Vector3(10, 11, 12);
Assert.IsTrue(a.GetHashCode() == b.GetHashCode());
}
{
Vector4 a = new Vector4(10, 11, 12, 13);
Vector4 b = new Vector4(10, 11, 12, 13);
Assert.IsTrue(a.GetHashCode() == b.GetHashCode());
}
{
Quaternion a = new Quaternion(10, 11, 12, 13);
Quaternion b = new Quaternion(10, 11, 12, 13);
Assert.IsTrue(a.GetHashCode() == b.GetHashCode());
}
{
Matrix4X4 a = Matrix4X4.CreateRotationX(3);
Matrix4X4 b = Matrix4X4.CreateRotationX(3);
Assert.IsTrue(a.GetHashCode() == b.GetHashCode());
}
}
示例2: QuaternionGetHashCodeTest
public void QuaternionGetHashCodeTest()
{
Quaternion a = new Quaternion(1.0f, 2.0f, 3.0f, 4.0f);
int expected = a.X.GetHashCode() + a.Y.GetHashCode() + a.Z.GetHashCode() + a.W.GetHashCode();
int actual = a.GetHashCode();
Assert.AreEqual(expected, actual, "Quaternion.GetHashCode did not return the expected value.");
}