mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-07-05 19:40:41 +00:00
Fixed the issues caused by merging in our changes as patches from the old repo.
This commit is contained in:
parent
59c652aaf8
commit
bf1401e115
|
@ -32,7 +32,7 @@ namespace OpenTK.Input
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Encapsulates the state of a GamePad device.
|
/// Encapsulates the state of a GamePad device.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public struct GamePadState : IEquatable<GamePadState>
|
public struct GamePadState /*: IEquatable<GamePadState>*/
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -842,81 +842,6 @@ namespace OpenTK
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
#region CreateFromQuaternion
|
|
||||||
/// <summary>
|
|
||||||
/// Build a rotation matrix from the specified quaternion.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="q">Quaternion to translate.</param>
|
|
||||||
/// <param name="m">Matrix result.</param>
|
|
||||||
public static void CreateFromQuaternion(ref Quaternion q,ref Matrix4 m)
|
|
||||||
{
|
|
||||||
m = Matrix4.Identity;
|
|
||||||
|
|
||||||
float X = q.X;
|
|
||||||
float Y = q.Y;
|
|
||||||
float Z = q.Z;
|
|
||||||
float W = q.W;
|
|
||||||
|
|
||||||
float xx = X * X;
|
|
||||||
float xy = X * Y;
|
|
||||||
float xz = X * Z;
|
|
||||||
float xw = X * W;
|
|
||||||
float yy = Y * Y;
|
|
||||||
float yz = Y * Z;
|
|
||||||
float yw = Y * W;
|
|
||||||
float zz = Z * Z;
|
|
||||||
float zw = Z * W;
|
|
||||||
|
|
||||||
m.M11 = 1 - 2 * (yy + zz);
|
|
||||||
m.M21 = 2 * (xy - zw);
|
|
||||||
m.M31 = 2 * (xz + yw);
|
|
||||||
m.M12 = 2 * (xy + zw);
|
|
||||||
m.M22 = 1 - 2 * (xx + zz);
|
|
||||||
m.M32 = 2 * (yz - xw);
|
|
||||||
m.M13 = 2 * (xz - yw);
|
|
||||||
m.M23 = 2 * (yz + xw);
|
|
||||||
m.M33 = 1 - 2 * (xx + yy);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Build a rotation matrix from the specified quaternion.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="q">Quaternion to translate.</param>
|
|
||||||
/// <returns>A matrix instance.</returns>
|
|
||||||
public static Matrix4 CreateFromQuaternion(ref Quaternion q)
|
|
||||||
{
|
|
||||||
Matrix4 result = Matrix4.Identity;
|
|
||||||
|
|
||||||
float X = q.X;
|
|
||||||
float Y = q.Y;
|
|
||||||
float Z = q.Z;
|
|
||||||
float W = q.W;
|
|
||||||
|
|
||||||
float xx = X * X;
|
|
||||||
float xy = X * Y;
|
|
||||||
float xz = X * Z;
|
|
||||||
float xw = X * W;
|
|
||||||
float yy = Y * Y;
|
|
||||||
float yz = Y * Z;
|
|
||||||
float yw = Y * W;
|
|
||||||
float zz = Z * Z;
|
|
||||||
float zw = Z * W;
|
|
||||||
|
|
||||||
result.M11 = 1 - 2 * (yy + zz);
|
|
||||||
result.M21 = 2 * (xy - zw);
|
|
||||||
result.M31 = 2 * (xz + yw);
|
|
||||||
result.M12 = 2 * (xy + zw);
|
|
||||||
result.M22 = 1 - 2 * (xx + zz);
|
|
||||||
result.M32 = 2 * (yz - xw);
|
|
||||||
result.M13 = 2 * (xz - yw);
|
|
||||||
result.M23 = 2 * (yz + xw);
|
|
||||||
result.M33 = 1 - 2 * (xx + yy);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Obsolete Functions
|
#region Obsolete Functions
|
||||||
|
|
|
@ -766,7 +766,6 @@
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
<Compile Include="Platform\MacOS\HIDInput.cs" />
|
<Compile Include="Platform\MacOS\HIDInput.cs" />
|
||||||
<Compile Include="IntPtrEqualityComparer.cs" />
|
<Compile Include="IntPtrEqualityComparer.cs" />
|
||||||
<Compile Include="Math\Matrix3.cs" />
|
|
||||||
<Compile Include="Input\GamePadButton.cs" />
|
<Compile Include="Input\GamePadButton.cs" />
|
||||||
<Compile Include="Input\GamePadAxis.cs" />
|
<Compile Include="Input\GamePadAxis.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
|
@ -89,7 +89,7 @@ namespace OpenTK.Platform.X11
|
||||||
|
|
||||||
public IList<JoystickDevice> Joysticks
|
public IList<JoystickDevice> Joysticks
|
||||||
{
|
{
|
||||||
get { Poll(); return sticks_readonly; }
|
get { Poll(); return sticks_readonly; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Poll()
|
public void Poll()
|
||||||
|
@ -267,8 +267,8 @@ namespace OpenTK.Platform.X11
|
||||||
|
|
||||||
public GamePadState GetState(int index)
|
public GamePadState GetState(int index)
|
||||||
{
|
{
|
||||||
Poll();
|
Poll();
|
||||||
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
public string GetDeviceName(int index)
|
public string GetDeviceName(int index)
|
||||||
|
|
Loading…
Reference in a new issue