Exemple #1
0
 public static Matrix4 CreateTransformation(
     Point3F location, Euler3F orientation, Point3F scale) =>
 Matrix4.CreateScale(scale.X, scale.Y, scale.Z) *
 Matrix4.CreateRotationZ(MathHelper.DegreesToRadians(orientation.Roll)) *
 Matrix4.CreateRotationY(MathHelper.DegreesToRadians(orientation.Yaw)) *
 Matrix4.CreateRotationX(MathHelper.DegreesToRadians(orientation.Pitch)) *
 Matrix4.CreateTranslation(location.ToVector3());
Exemple #2
0
 public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
 {
     if (value is string s)
     {
         return(Euler3F.Parse(s));
     }
     return(base.ConvertFrom(context, culture, value));
 }
Exemple #3
0
 public static Vector3 ToVector3(this Euler3F e) => new Vector3(e.Pitch, e.Yaw, e.Roll);
Exemple #4
0
 public static Matrix4 CreateCameraView(Point3F position, Euler3F rotation) =>
 Matrix4.CreateTranslation(-position.ToVector3()) *
 Matrix4.CreateRotationZ(MathHelper.DegreesToRadians(rotation.Roll)) *
 Matrix4.CreateRotationY(MathHelper.DegreesToRadians(rotation.Yaw)) *
 Matrix4.CreateRotationX(MathHelper.DegreesToRadians(rotation.Pitch));