EulerAngles StructureDelta Engine Documentation
Yaw, Pitch and Roll used for 3D rotations. See: http://en.wikipedia.org/wiki/Euler_angles View code on GitHub

Namespace: DeltaEngine.Datatypes
Assembly: DeltaEngine (in DeltaEngine.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public struct EulerAngles

The EulerAngles type exposes the following members.

Constructors

  NameDescription
Public methodEulerAngles
Initializes a new instance of the EulerAngles class
Top
Methods

  NameDescription
Public methodEquals(Object) (Overrides ValueType Equals(Object).)
Public methodEquals(EulerAngles)
Public methodGetHashCode (Overrides ValueType GetHashCode .)
Public methodToString (Overrides ValueType ToString .)
Top
Operators

  NameDescription
Public operatorStatic memberEquality
Public operatorStatic memberInequality
Top
Properties

  NameDescription
Public propertyPitch
Public propertyRoll
Public propertyYaw
Top
Remarks

Tests: DeltaEngine.Tests.Datatypes.EulerAnglesTests
Examples

4 unit tests call DeltaEngine.Datatypes.EulerAngles
[Test]
public void Create()
{
    var euler = new EulerAngles(1, 2, 3);
    Assert.AreEqual(euler.Pitch, 1);
    Assert.AreEqual(euler.Yaw, 2);
    Assert.AreEqual(euler.Roll, 3);
}
[Test]
public void Equals()
{
    var euler1 = new EulerAngles(1, 2, 3);
    var euler2 = new EulerAngles(3, 4, 5);
    Assert.AreNotEqual(euler1, euler2);
    Assert.AreEqual(euler1, new EulerAngles(1, 2, 3));
    Assert.IsTrue(euler1 == new EulerAngles(1, 2, 3));
    Assert.IsTrue(euler1 != euler2);
    Assert.IsTrue(euler1.Equals((object)new EulerAngles(1, 2, 3)));
}
[Test]
public void GetHashCodeViaDictionary()
{
    var first = new EulerAngles(1, 2, 3);
    var second = new EulerAngles(3, 4, 5);
    var eulerAngles = new Dictionary<EulerAngles, int> { { first, 1 }, { second, 2 } };
    Assert.IsTrue(eulerAngles.ContainsKey(first));
    Assert.IsTrue(eulerAngles.ContainsKey(second));
    Assert.IsFalse(eulerAngles.ContainsKey(new EulerAngles(5, 6, 7)));
}
See Also