-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from JerryImMouse/camera-compatibility
Compatibility methods
- Loading branch information
Showing
18 changed files
with
578 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using System.Runtime.CompilerServices; | ||
using OpenTK.Mathematics; | ||
|
||
namespace Hypercube.Shared.Math.Matrix; | ||
|
||
public partial struct Matrix3X3 | ||
{ | ||
/* | ||
* OpenTK Compatibility | ||
*/ | ||
|
||
[MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
public static implicit operator Matrix3(Matrix3X3 matrix3) | ||
{ | ||
return new Matrix3(matrix3.Row0, matrix3.Row1, matrix3.Row2); | ||
} | ||
|
||
[MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
public static implicit operator Matrix3X3(Matrix3 matrix3) | ||
{ | ||
return new Matrix3X3(matrix3.Row0, matrix3.Row1, matrix3.Row2); | ||
} | ||
|
||
/* | ||
* OpenToolkit Compatibility | ||
*/ | ||
|
||
[MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
public static implicit operator OpenToolkit.Mathematics.Matrix3(Matrix3X3 matrix3) | ||
{ | ||
return new OpenToolkit.Mathematics.Matrix3(matrix3.Row0, matrix3.Row1, matrix3.Row2); | ||
} | ||
|
||
[MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
public static implicit operator Matrix3X3(OpenToolkit.Mathematics.Matrix3 matrix3) | ||
{ | ||
return new Matrix3X3(matrix3.Row0, matrix3.Row1, matrix3.Row2); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using System.Runtime.CompilerServices; | ||
using OpenTK.Mathematics; | ||
|
||
namespace Hypercube.Shared.Math.Matrix; | ||
|
||
public partial struct Matrix4X4 | ||
{ | ||
/* | ||
* OpenTK Compatibility | ||
*/ | ||
|
||
[MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
public static implicit operator OpenTK.Mathematics.Matrix4(Matrix4X4 matrix4X4) | ||
{ | ||
return new OpenTK.Mathematics.Matrix4(matrix4X4.Row0, matrix4X4.Row1, matrix4X4.Row2, matrix4X4.Row3); | ||
} | ||
[MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
public static implicit operator Matrix4X4(Matrix4 matrix4) | ||
{ | ||
return new Matrix4X4(matrix4.Row0, matrix4.Row1, matrix4.Row2, matrix4.Row3); | ||
} | ||
|
||
/* | ||
* Open Toolkit Compatibility | ||
*/ | ||
|
||
[MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
public static implicit operator OpenToolkit.Mathematics.Matrix4(Matrix4X4 matrix4X4) | ||
{ | ||
return new OpenToolkit.Mathematics.Matrix4(matrix4X4.Row0, matrix4X4.Row1, matrix4X4.Row2, matrix4X4.Row3); | ||
} | ||
|
||
[MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
public static implicit operator Matrix4X4(OpenToolkit.Mathematics.Matrix4 matrix4) | ||
{ | ||
return new Matrix4X4(matrix4.Row0, matrix4.Row1, matrix4.Row2, matrix4.Row3); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.