-
Notifications
You must be signed in to change notification settings - Fork 27
/
RotateX.cs
32 lines (30 loc) · 1.05 KB
/
RotateX.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using OpenTK;
using System;
using System.ComponentModel;
namespace Bonsai.Shaders
{
/// <summary>
/// Represents an operator that applies a rotation about the x-axis to every
/// transform in the sequence.
/// </summary>
[Description("Applies a rotation about the x-axis to every transform in the sequence.")]
public class RotateX : MatrixTransform
{
/// <summary>
/// Gets or sets the angle describing the magnitude of the rotation
/// about the x-axis.
/// </summary>
[Range(-Math.PI, Math.PI)]
[Editor(DesignTypes.SliderEditor, DesignTypes.UITypeEditor)]
[Description("The angle describing the magnitude of the rotation about the x-axis.")]
public float Angle { get; set; }
/// <summary>
/// Initializes a transform matrix for a rotation about the x-axis.
/// </summary>
/// <inheritdoc/>
protected override void CreateTransform(out Matrix4 result)
{
Matrix4.CreateRotationX(Angle, out result);
}
}
}