Skip to content

Commit ac99c7d

Browse files
committed
Backport library to .NET5
The decision to simply bump the version to .NET7 was purely out of convenience because it provided a tiny little utility function that the Matrix implementation uses. This decision was made when this wasn't really intended to be a proper continuation of the project but simply a quick and dirty fork that would work for my purposes. I realize that considering the broad userbase people might genuinely benefit from this.
1 parent 9769ce0 commit ac99c7d

File tree

6 files changed

+18
-6
lines changed

6 files changed

+18
-6
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333

3434
- uses: actions/setup-dotnet@v4
3535
with:
36-
dotnet-version: 8.x.x
36+
dotnet-version: 5.x.x
3737

3838
- run: dotnet test AssimpNet.Test -c ${{ matrix.configuration }} ${{ matrix.additional_args }}
3939

AssimpNet.Sample/AssimpNet.Sample.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net7</TargetFramework>
5+
<TargetFramework>net5.0</TargetFramework>
66
<RootNamespace>Assimp.Sample</RootNamespace>
77
<ApplicationIcon />
88
<StartupObject />

AssimpNet.Test/AssimpNet.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net8</TargetFrameworks>
4+
<TargetFrameworks>net6.0</TargetFrameworks>
55
<RootNamespace>Assimp.Test</RootNamespace>
66
<LangVersion>latest</LangVersion>
77
<ForceCopyNativeAssimp>true</ForceCopyNativeAssimp>

AssimpNet/AssimpNet.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net7</TargetFrameworks>
4+
<TargetFrameworks>net5.0</TargetFrameworks>
55
<LangVersion>latest</LangVersion>
66
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
77
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>

AssimpNet/Matrix3x3.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,19 @@ public static Matrix3x3 FromToMatrix(Vector3 from, Vector3 to)
484484
{
485485
for(int j = 1; j < 4; j++)
486486
{
487-
m[i, j] = -c1 * u[i] * u[j] - c2 * v[i] * v[j] + c3 * v[i] * u[j];
487+
m[i, j] = -c1 * Index(u, i) * Index(u, j) - c2 * Index(v, i) * Index(v, j) + c3 * Index(v, i) * Index(u, j);
488+
489+
continue;
490+
491+
static float Index(Vector3 v, int i)
492+
{
493+
return i switch
494+
{
495+
1 => v.X,
496+
2 => v.Y,
497+
3 => v.Z,
498+
};
499+
}
488500
}
489501
m[i, i] += 1.0f;
490502
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ The library is split between two parts, a low level and a high level. The intent
2525

2626
## Supported Frameworks ##
2727

28-
The library runs on **.NET 7**.
28+
The library runs on **.NET 5**.
2929

3030
## Supported Platforms ##
3131

0 commit comments

Comments
 (0)