Euler Angles#
Quaternion / Euler Angles
Can Read
Cannot Write
Description#
The pitch, yaw and roll in degrees that make up a rotation
Parameters#
| Name | Description |
|---|---|
| Rotation | The rotation the Euler angles are taken from |
Code#
using System;
using UnityEngine;
using VisualScript.Icons;
namespace VisualScript.Runtime
{
[Get]
[Title("Euler Angles")]
[Category("Quaternion/Euler Angles")]
[Description("The pitch, yaw and roll in degrees that make up a rotation")]
[Image(typeof(IconQuaternion), ColorTheme.Type.Yellow, typeof(BadgeArrowRight))]
[Parameter("Rotation", "The rotation the Euler angles are taken from")]
[Keywords("Quaternion", "Rotation", "Degrees", "Pitch", "Yaw", "Roll", "Convert")]
[Serializable]
public class TypeVector3QuaternionEuler : TypeVector3
{
[SerializeField] private GetQuaternion m_Rotation = new GetQuaternion();
public override Vector3 GetPreview(GameObject source) => this.m_Rotation.GetPreview(source).eulerAngles;
public override Vector3 Get(Args args)
{
return this.m_Rotation.Get(args).eulerAngles;
}
public override string ToString()
{
return $"Euler of {this.m_Rotation}";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}