Back to DOM
RotationClass
Definition
- Namespace
- DOM.MeasurementUnits
- Assembly
- DOM.dll
Represents a rotation value in degrees and normalizes assignments to the 0..360 range.
Remarks
The class stores an angle in degrees. When a value is assigned to, it is normalized so the stored value is always within [0, 360). This is useful for layout and transform calculations that expect wrapped angles. Rotation Value is used by, by camera and light rig rotation angles, and by any other place in the DOM that expresses an angle. Rotation Transform.Rotation
Examples
csharp
1// 1. Create from a double (implicit conversion, normalized)
2Rotation r = 45;
3Console.WriteLine(r.Value); // 45
4
csharp
1// 2. Negative values wrap into [0, 360)
2Rotation r = -90;
3Console.WriteLine(r.Value); // 270
4
csharp
1// 3. Values above 360 wrap as well
2Rotation r = 450;
3Console.WriteLine(r.Value); // 90
4
csharp
1// 4. Use in a Transform
2var t = new Transform
3{
4 Rotation = new Rotation { Value = 15 }
5};
6
Properties
Value
Gets or sets the rotation in degrees. Assigned values are normalized into the range [0, 360).
Methods
Implicitly converts a (degrees) to a . The supplied value will be normalized as if assigned to . Double, Rotation, Value
Returns the rotation value as a string using the default numeric formatting.