本文整理汇总了C#中Plane.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# Plane.Equals方法的具体用法?C# Plane.Equals怎么用?C# Plane.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Plane
的用法示例。
在下文中一共展示了Plane.Equals方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PlaneEqualsTest
public void PlaneEqualsTest()
{
Plane a = new Plane(1.0f, 2.0f, 3.0f, 4.0f);
Plane b = new Plane(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.Equal(expected, actual);
// case 2: compare between different values
b.Normal = new Vector3(10.0f, b.Normal.Y, b.Normal.Z);
obj = b;
expected = false;
actual = a.Equals(obj);
Assert.Equal(expected, actual);
// case 3: compare between different types.
obj = new Quaternion();
expected = false;
actual = a.Equals(obj);
Assert.Equal(expected, actual);
// case 3: compare against null.
obj = null;
expected = false;
actual = a.Equals(obj);
Assert.Equal(expected, actual);
}
示例2: PlaneEqualsTest
public void PlaneEqualsTest()
{
Plane a = new Plane(1.0f, 2.0f, 3.0f, 4.0f);
Plane b = new Plane(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, "Plane.Equals did not return the expected value.");
// case 2: compare between different values
b.Normal.X = 10.0f;
obj = b;
expected = false;
actual = a.Equals(obj);
Assert.AreEqual(expected, actual, "Plane.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, "Plane.Equals did not return the expected value.");
// case 3: compare against null.
obj = null;
expected = false;
actual = a.Equals(obj);
Assert.AreEqual(expected, actual, "Plane.Equals did not return the expected value.");
}
示例3: PlaneEqualsTest1
public void PlaneEqualsTest1()
{
Plane a = new Plane(1.0f, 2.0f, 3.0f, 4.0f);
Plane b = new Plane(1.0f, 2.0f, 3.0f, 4.0f);
// case 1: compare between same values
bool expected = true;
bool actual = a.Equals(b);
Assert.Equal(expected, actual);
// case 2: compare between different values
b.Normal = new Vector3(10.0f, b.Normal.Y, b.Normal.Z);
expected = false;
actual = a.Equals(b);
Assert.Equal(expected, actual);
}
示例4: PlaneEqualsTest1
public void PlaneEqualsTest1()
{
Plane a = new Plane(1.0f, 2.0f, 3.0f, 4.0f);
Plane b = new Plane(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, "Plane.Equals did not return the expected value.");
// case 2: compare between different values
b.Normal.X = 10.0f;
expected = false;
actual = a.Equals(b);
Assert.AreEqual(expected, actual, "Plane.Equals did not return the expected value.");
}
示例5: PlaneEqualsNanTest
public void PlaneEqualsNanTest()
{
Plane a = new Plane(float.NaN, 0, 0, 0);
Plane b = new Plane(0, float.NaN, 0, 0);
Plane c = new Plane(0, 0, float.NaN, 0);
Plane d = new Plane(0, 0, 0, float.NaN);
Assert.False(a == new Plane(0, 0, 0, 0));
Assert.False(b == new Plane(0, 0, 0, 0));
Assert.False(c == new Plane(0, 0, 0, 0));
Assert.False(d == new Plane(0, 0, 0, 0));
Assert.True(a != new Plane(0, 0, 0, 0));
Assert.True(b != new Plane(0, 0, 0, 0));
Assert.True(c != new Plane(0, 0, 0, 0));
Assert.True(d != new Plane(0, 0, 0, 0));
Assert.False(a.Equals(new Plane(0, 0, 0, 0)));
Assert.False(b.Equals(new Plane(0, 0, 0, 0)));
Assert.False(c.Equals(new Plane(0, 0, 0, 0)));
Assert.False(d.Equals(new Plane(0, 0, 0, 0)));
// Counterintuitive result - IEEE rules for NaN comparison are weird!
Assert.False(a.Equals(a));
Assert.False(b.Equals(b));
Assert.False(c.Equals(c));
Assert.False(d.Equals(d));
}
示例6: GetOffset
private Vector3D GetOffset(Plane referencePlane, Plane targetPlane, List<Plane> eliminatedPlane)
{
if (referencePlane.Equals(targetPlane))
return null;
// This 'reference plane' has now been checked against 'target plane', so whether it
// has a direct dependency or not, it should not be considered again,
// otherwise, we could end up in infinite recursion.
eliminatedPlane.Add(referencePlane);
if (_calibrationMatrix[referencePlane].ContainsKey(targetPlane))
return _calibrationMatrix[referencePlane][targetPlane];
else
return ExtrapolateOffset(referencePlane, targetPlane, eliminatedPlane);
}