Skip to content

Commit a414730

Browse files
authored
Develop to main (#4)
* refactor: clean up xml documentation (#3) - setup config to produce xml doc for intellisense - setup config to get ready for nupkg publish
1 parent 6e1d577 commit a414730

13 files changed

Lines changed: 83 additions & 38 deletions

src/FixedMathSharp.Editor/FixedMathSharp.Editor.csproj

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<Nullable>enable</Nullable>
77
</PropertyGroup>
88
<PropertyGroup>
9-
<PackageIcon>../../../.assets/icon_256x256.png</PackageIcon>
9+
<PackageIcon>icon_256x256.png</PackageIcon>
1010
<PackageIconUrl>https://raw.githubusercontent.com/mrdav30/fixedmathsharp/main/.assets/icon_256x256.png</PackageIconUrl>
1111
</PropertyGroup>
1212
<PropertyGroup>
@@ -77,6 +77,7 @@
7777
<DefineConstants>DEBUG;TRACE;UNITY_EDITOR</DefineConstants>
7878
<ErrorReport>prompt</ErrorReport>
7979
<WarningLevel>4</WarningLevel>
80+
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
8081
</PropertyGroup>
8182
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
8283
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -86,9 +87,15 @@
8687
<DefineConstants>TRACE;UNITY_EDITOR</DefineConstants>
8788
<ErrorReport>prompt</ErrorReport>
8889
<WarningLevel>4</WarningLevel>
90+
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
91+
<Description>FixedMathSharp.Editor: Extensions and utilities for integrating FixedMathSharp with Unity. Includes struct extensions for Fixed64 and Vector2d(3d) to interoperate smoothly with Unity’s native types, along with custom property drawers for enhanced inspector support.</Description>
92+
<PackageReadmeFile>README.md</PackageReadmeFile>
93+
<RepositoryUrl>https://github.com/mrdav30/FixedMathSharp</RepositoryUrl>
94+
<PackageTags>fixed-point;math;precision;deterministic;arithmetic;fixed-point-arithmetic;math-library;trigonometry;dotnet;unity;simulations;physics-engine;game-development;high-precision;nuget</PackageTags>
95+
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
8996
</PropertyGroup>
9097
<ItemGroup>
91-
<ProjectReference Include="..\FixedMathSharp\FixedMathSharp.csproj" />
98+
<ProjectReference Include="..\FixedMathSharp\FixedMathSharp.csproj" Private="false" />
9299
</ItemGroup>
93100
<ItemGroup>
94101
<Reference Include="UnityEngine">
@@ -97,6 +104,20 @@
97104
<Reference Include="UnityEditor">
98105
<HintPath>$(UnityEditorPath)</HintPath>
99106
</Reference>
107+
</ItemGroup>
108+
<ItemGroup>
109+
<None Include="..\..\LICENSE.md">
110+
<Pack>True</Pack>
111+
<PackagePath>\</PackagePath>
112+
</None>
113+
<None Include="..\..\README.md">
114+
<Pack>True</Pack>
115+
<PackagePath>\</PackagePath>
116+
</None>
117+
<None Include="..\..\.assets\icon_256x256.png">
118+
<Pack>True</Pack>
119+
<PackagePath>\</PackagePath>
120+
</None>
100121
</ItemGroup>
101122
<ItemGroup>
102123
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies.net472">

src/FixedMathSharp/Fixed3x3.Extensions.cs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ public static Vector3d ExtractScale(this Fixed3x3 matrix)
1313
return Fixed3x3.ExtractScale(matrix);
1414
}
1515

16-
/// <inheritdoc cref="Fixed3x3.SetScale(ref Fixed3x3, Vector3d)" />
16+
/// <inheritdoc cref="Fixed3x3.SetScale(Fixed3x3, Vector3d)" />
1717
[MethodImpl(MethodImplOptions.AggressiveInlining)]
1818
public static Fixed3x3 SetScale(this ref Fixed3x3 matrix, Vector3d localScale)
1919
{
2020
return matrix = Fixed3x3.SetScale(matrix, localScale);
2121
}
2222

23-
/// <inheritdoc cref="Fixed3x3.SetGlobalScale(ref Fixed3x3, Vector3d)" />
23+
/// <inheritdoc cref="Fixed3x3.SetGlobalScale(Fixed3x3, Vector3d)" />
2424
public static Fixed3x3 SetGlobalScale(this ref Fixed3x3 matrix, Vector3d globalScale)
2525
{
2626
return matrix = Fixed3x3.SetGlobalScale(matrix, globalScale);
@@ -33,8 +33,8 @@ public static Fixed3x3 SetGlobalScale(this ref Fixed3x3 matrix, Vector3d globalS
3333
/// <summary>
3434
/// Compares two Fixed3x3 for approximate equality, allowing a fixed absolute difference between components.
3535
/// </summary>
36-
/// <param name="q1">The current Fixed3x3.</param>
37-
/// <param name="q2">The Fixed3x3 to compare against.</param>
36+
/// <param name="f1">The current Fixed3x3.</param>
37+
/// <param name="f2">The Fixed3x3 to compare against.</param>
3838
/// <param name="allowedDifference">The allowed absolute difference between each component.</param>
3939
/// <returns>True if the components are within the allowed difference, false otherwise.</returns>
4040
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -54,22 +54,22 @@ public static bool FuzzyEqualAbsolute(this Fixed3x3 f1, Fixed3x3 f2, Fixed64 all
5454
/// <summary>
5555
/// Compares two Fixed3x3 for approximate equality, allowing a fractional percentage (defaults to ~1%) difference between components.
5656
/// </summary>
57-
/// <param name="q1">The current Fixed3x3.</param>
58-
/// <param name="q2">The Fixed3x3 to compare against.</param>
57+
/// <param name="f1">The current Fixed3x3.</param>
58+
/// <param name="f2">The Fixed3x3 to compare against.</param>
5959
/// <param name="percentage">The allowed fractional difference (percentage) for each component.</param>
6060
/// <returns>True if the components are within the allowed percentage difference, false otherwise.</returns>
61-
public static bool FuzzyEqual(this Fixed3x3 f1, Fixed3x3 q2, Fixed64? percentage = null)
61+
public static bool FuzzyEqual(this Fixed3x3 f1, Fixed3x3 f2, Fixed64? percentage = null)
6262
{
6363
Fixed64 p = percentage ?? Fixed64.Epsilon;
64-
return f1.m00.FuzzyComponentEqual(q2.m00, p) &&
65-
f1.m01.FuzzyComponentEqual(q2.m01, p) &&
66-
f1.m02.FuzzyComponentEqual(q2.m02, p) &&
67-
f1.m10.FuzzyComponentEqual(q2.m10, p) &&
68-
f1.m11.FuzzyComponentEqual(q2.m11, p) &&
69-
f1.m12.FuzzyComponentEqual(q2.m12, p) &&
70-
f1.m20.FuzzyComponentEqual(q2.m20, p) &&
71-
f1.m21.FuzzyComponentEqual(q2.m21, p) &&
72-
f1.m22.FuzzyComponentEqual(q2.m22, p);
64+
return f1.m00.FuzzyComponentEqual(f2.m00, p) &&
65+
f1.m01.FuzzyComponentEqual(f2.m01, p) &&
66+
f1.m02.FuzzyComponentEqual(f2.m02, p) &&
67+
f1.m10.FuzzyComponentEqual(f2.m10, p) &&
68+
f1.m11.FuzzyComponentEqual(f2.m11, p) &&
69+
f1.m12.FuzzyComponentEqual(f2.m12, p) &&
70+
f1.m20.FuzzyComponentEqual(f2.m20, p) &&
71+
f1.m21.FuzzyComponentEqual(f2.m21, p) &&
72+
f1.m22.FuzzyComponentEqual(f2.m22, p);
7373
}
7474

7575
#endregion

src/FixedMathSharp/Fixed3x3.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public Fixed64 GetDeterminant()
105105
/// bear in mind that having a zero on the inertia tensor's diagonal isn't generally valid for real,
106106
/// 3-dimensional objects (unless they are "infinitely thin" along one axis),
107107
/// so if you end up with such a tensor, it's a sign that something else might be wrong in your setup.
108-
/// </returns>
108+
/// </remarks>
109109
public Fixed3x3 InvertDiagonal()
110110
{
111111
if (m11 == Fixed64.Zero)
@@ -252,6 +252,7 @@ public static Fixed3x3 SetLossyScale(Fixed64 x, Fixed64 y, Fixed64 z)
252252
/// <summary>
253253
/// Applies the provided local scale to the matrix by modifying the diagonal elements.
254254
/// </summary>
255+
/// <param name="matrix">The matrix to set the scale against.</param>
255256
/// <param name="localScale">A Vector3d representing the local scale to apply.</param>
256257
public static Fixed3x3 SetScale(Fixed3x3 matrix, Vector3d localScale)
257258
{

src/FixedMathSharp/Fixed4x4.Extensions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ public static FixedQuaternion ExtractRotation(this Fixed4x4 matrix)
3535
return Fixed4x4.ExtractRotation(matrix);
3636
}
3737

38-
/// <inheritdoc cref="Fixed4x4.SetGlobalScale(Fixed4x4, Vector3d, bool)" />
39-
public static Fixed4x4 SetGlobalScale(this ref Fixed4x4 matrix, Vector3d globalScale, bool precise = false)
38+
/// <inheritdoc cref="Fixed4x4.SetGlobalScale(Fixed4x4, Vector3d)" />
39+
public static Fixed4x4 SetGlobalScale(this ref Fixed4x4 matrix, Vector3d globalScale)
4040
{
41-
return matrix = Fixed4x4.SetGlobalScale(matrix, globalScale, precise);
41+
return matrix = Fixed4x4.SetGlobalScale(matrix, globalScale);
4242
}
4343

4444
#endregion

src/FixedMathSharp/Fixed4x4.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ public Fixed4x4 ResetScaleToIdentity()
109109
return this = ResetScaleToIdentity(this);
110110
}
111111

112+
/// <summary>
112113
/// Sets the translation, scale, and rotation components onto the matrix.
113114
/// </summary>
114115
/// <param name="translation">The translation vector.</param>
@@ -182,6 +183,7 @@ public static Fixed4x4 CreateScale(Vector3d scale)
182183
);
183184
}
184185

186+
/// <summary>
185187
/// Creates a matrix from the provided translation, scale, and rotation components.
186188
/// </summary>
187189
/// <param name="translation">The translation vector.</param>
@@ -451,7 +453,7 @@ public static Fixed4x4 ResetScaleToIdentity(Fixed4x4 matrix)
451453
/// by dividing the desired global scale by the current global scale.
452454
/// The new local scale is then applied to the matrix.
453455
/// </remarks>
454-
public static Fixed4x4 SetGlobalScale(Fixed4x4 matrix, Vector3d globalScale, bool precise = false)
456+
public static Fixed4x4 SetGlobalScale(Fixed4x4 matrix, Vector3d globalScale)
455457
{
456458
// normalize the matrix to avoid drift in the rotation component
457459
matrix = NormalizeRotationMatrix(matrix);

src/FixedMathSharp/Fixed64.Extensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public static Fixed64 Round(this Fixed64 value, MidpointRounding mode = Midpoint
3030
return FixedMath.Round(value, mode);
3131
}
3232

33-
/// <inheritdoc cref="FixedMath.Abs(Fixed64, int, MidpointRounding)" />
33+
/// <inheritdoc cref="FixedMath.RoundToPrecision(Fixed64, int, MidpointRounding)" />
3434
[MethodImpl(MethodImplOptions.AggressiveInlining)]
3535
public static Fixed64 RoundToPrecision(this Fixed64 value, int places, MidpointRounding mode = MidpointRounding.ToEven)
3636
{

src/FixedMathSharp/Fixed64.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ public static explicit operator decimal(Fixed64 value)
457457
/// <summary>
458458
/// Bitwise left shift operator.
459459
/// </summary>
460-
/// <param name="x">Operand to shift.</param>
460+
/// <param name="a">Operand to shift.</param>
461461
/// <param name="shift">Number of bits to shift.</param>
462462
/// <returns>The shifted value.</returns>
463463
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -469,7 +469,7 @@ public static explicit operator decimal(Fixed64 value)
469469
/// <summary>
470470
/// Bitwise right shift operator.
471471
/// </summary>
472-
/// <param name="x">Operand to shift.</param>
472+
/// <param name="a">Operand to shift.</param>
473473
/// <param name="shift">Number of bits to shift.</param>
474474
/// <returns>The shifted value.</returns>
475475
[MethodImpl(MethodImplOptions.AggressiveInlining)]

src/FixedMathSharp/FixedMath.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ public static Fixed64 FastMod(Fixed64 x, Fixed64 y)
249249
}
250250

251251
/// <summary>
252-
/// Performs linear interpolation between two fixed-point values based on the interpolant t (0 <= t <= 1).
252+
/// Performs linear interpolation between two fixed-point values based on the interpolant t (0 greater or equal to `t` and less than or equal to 1).
253253
/// </summary>
254254
public static Fixed64 LinearInterpolate(Fixed64 from, Fixed64 to, Fixed64 t)
255255
{
@@ -296,7 +296,7 @@ public static Fixed64 MoveTowards(Fixed64 from, Fixed64 to, Fixed64 maxAmount)
296296
/// <returns>The sum of <paramref name="x"/> and <paramref name="y"/>.</returns>
297297
/// <remarks>
298298
/// Overflow is detected by checking for a change in the sign bit that indicates a wrap-around.
299-
/// Additionally, a special check is performed for adding <see cref="long.Fixed64.MinValue"/> and -1,
299+
/// Additionally, a special check is performed for adding <see cref="Fixed64.MinValue"/> and -1,
300300
/// as this is a known edge case for overflow.
301301
/// </remarks>
302302
public static long AddOverflowHelper(long x, long y, ref bool overflow)

src/FixedMathSharp/FixedMathSharp.csproj

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,14 @@
66
<Nullable>enable</Nullable>
77
</PropertyGroup>
88
<PropertyGroup>
9-
<PackageIcon>../../../.assets/icon_256x256.png</PackageIcon>
9+
<PackageIcon>icon_256x256.png</PackageIcon>
1010
<PackageIconUrl>https://raw.githubusercontent.com/mrdav30/fixedmathsharp/main/.assets/icon_256x256.png</PackageIconUrl>
1111
</PropertyGroup>
12+
<PropertyGroup>
13+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
14+
<NoWarn>1591</NoWarn> <!-- Optional: Suppress warnings about missing XML comments -->
15+
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\FixedMathSharp.xml</DocumentationFile>
16+
</PropertyGroup>
1217
<PropertyGroup>
1318
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
1419
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -34,8 +39,6 @@
3439
<IsWebBootstrapper>false</IsWebBootstrapper>
3540
<UseApplicationTrust>false</UseApplicationTrust>
3641
<BootstrapperEnabled>true</BootstrapperEnabled>
37-
<NuGetPackageImportStamp>
38-
</NuGetPackageImportStamp>
3942
</PropertyGroup>
4043
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
4144
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -46,6 +49,7 @@
4649
<DefineConstants>DEBUG;TRACE</DefineConstants>
4750
<ErrorReport>prompt</ErrorReport>
4851
<WarningLevel>4</WarningLevel>
52+
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
4953
</PropertyGroup>
5054
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
5155
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -55,7 +59,27 @@
5559
<DefineConstants>TRACE</DefineConstants>
5660
<ErrorReport>prompt</ErrorReport>
5761
<WarningLevel>4</WarningLevel>
62+
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
63+
<Description>FixedMathSharp: A high-precision, deterministic fixed-point math library for .NET. Ideal for simulations, games, and physics engines requiring reliable arithmetic without floating-point inaccuracies. </Description>
64+
<PackageReadmeFile>README.md</PackageReadmeFile>
65+
<RepositoryUrl>https://github.com/mrdav30/FixedMathSharp</RepositoryUrl>
66+
<PackageTags>fixed-point;math;precision;deterministic;arithmetic;fixed-point-arithmetic;math-library;trigonometry;dotnet;unity;simulations;physics-engine;game-development;high-precision;nuget</PackageTags>
67+
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
5868
</PropertyGroup>
69+
<ItemGroup>
70+
<None Include="..\..\LICENSE.md">
71+
<Pack>True</Pack>
72+
<PackagePath>\</PackagePath>
73+
</None>
74+
<None Include="..\..\README.md">
75+
<Pack>True</Pack>
76+
<PackagePath>\</PackagePath>
77+
</None>
78+
<None Include="..\..\.assets\icon_256x256.png">
79+
<Pack>True</Pack>
80+
<PackagePath>\</PackagePath>
81+
</None>
82+
</ItemGroup>
5983
<ItemGroup>
6084
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies.net472">
6185
<Version>1.0.3</Version>

src/FixedMathSharp/FixedTrigonometry.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public static partial class FixedMath
5151
/// Raises the base number b to the power of exp.
5252
/// Uses logarithms to compute power efficiently for fixed-point values.
5353
/// </summary>
54-
/// <exception cref="DivideByFixed64.ZeroException">
54+
/// <exception cref="DivideByZeroException">
5555
/// The base was Fixed64.Zero, with a negative expFixed64.Onent
5656
/// </exception>
5757
/// <exception cref="ArgumentOutOfRangeException">

0 commit comments

Comments
 (0)