mirror of
https://github.com/oliverbooth/VpSharp
synced 2024-11-09 23:35:41 +00:00
Convert rad<->deg where appropriate
This commit is contained in:
parent
8c4ed9d955
commit
d40129856a
@ -1,6 +1,7 @@
|
||||
using System.Numerics;
|
||||
using System.Numerics;
|
||||
using VpSharp.Extensions;
|
||||
using VpSharp.Internal;
|
||||
using X10D.Math;
|
||||
using static VpSharp.Internal.NativeAttributes.DataAttribute;
|
||||
using static VpSharp.Internal.NativeAttributes.FloatAttribute;
|
||||
using static VpSharp.Internal.NativeAttributes.IntegerAttribute;
|
||||
@ -167,6 +168,14 @@ public abstract class VirtualParadiseObjectBuilder
|
||||
{
|
||||
Rotation.Value.ToAxisAngle(out Vector3d axis, out angle);
|
||||
(x, y, z) = axis;
|
||||
angle = angle.RadiansToDegrees();
|
||||
}
|
||||
|
||||
if (double.IsPositiveInfinity(angle))
|
||||
{
|
||||
x = x.RadiansToDegrees();
|
||||
y = y.RadiansToDegrees();
|
||||
z = z.RadiansToDegrees();
|
||||
}
|
||||
|
||||
_ = vp_double_set(handle, ObjectRotationX, x);
|
||||
|
@ -5,6 +5,7 @@ using VpSharp.Entities;
|
||||
using VpSharp.Exceptions;
|
||||
using VpSharp.Internal;
|
||||
using VpSharp.Internal.NativeAttributes;
|
||||
using X10D.Math;
|
||||
using static VpSharp.Internal.NativeMethods;
|
||||
|
||||
namespace VpSharp;
|
||||
@ -204,6 +205,9 @@ public sealed partial class VirtualParadiseClient
|
||||
|
||||
if (double.IsPositiveInfinity(angle))
|
||||
{
|
||||
rotX = rotX.DegreesToRadians();
|
||||
rotY = rotY.DegreesToRadians();
|
||||
rotZ = rotZ.DegreesToRadians();
|
||||
rotation = Quaternion.CreateFromYawPitchRoll(rotY, rotX, rotZ);
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user