Refactor and enhance math utilities and code generation
Refactored `StbImage` classes to be publicly accessible. Updated namespaces and introduced `NumericTypeAttribute` for metadata. Enhanced `VectorGenerator` with new utility methods (`any`, `all`, `length`, etc.) and improved code generation. Consolidated vector operations in `math` utilities. Refactored `Plane` and `svd` classes for better encapsulation and readability. Improved `DynamicArray` with `uint` indexer support and cleaner loops. Added SIMD-based benchmarking placeholders in `MathematicsBenchmark`. Removed redundant code and unused files, including `IUnsafeSet.cs`. Updated project file to include `CodeGen` as an analyzer. Introduced `SupportedVectorMath` and `SupportedMatrixMath` enums for better operation definitions. Improved code style, fixed minor bugs, and cleaned up unused code in `Program.cs`. Enhanced maintainability and readability across the codebase.
This commit is contained in:
@@ -162,7 +162,7 @@ public struct Plane
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static float4 Normalize(float4 planeCoefficients)
|
||||
{
|
||||
float recipLength = math.rsqrt(math.lengthsq(planeCoefficients.xyz));
|
||||
var recipLength = math.rsqrt(math.lengthsq(planeCoefficients.xyz));
|
||||
return new Plane { normalAndDistance = planeCoefficients * recipLength };
|
||||
}
|
||||
|
||||
@@ -214,9 +214,9 @@ public struct Plane
|
||||
public static implicit operator float4(Plane plane) => plane.normalAndDistance;
|
||||
|
||||
[Conditional("ENABLE_COLLECTIONS_CHECKS")]
|
||||
void CheckPlaneIsNormalized()
|
||||
private void CheckPlaneIsNormalized()
|
||||
{
|
||||
float ll = math.lengthsq(Normal.xyz);
|
||||
var ll = math.lengthsq(Normal.xyz);
|
||||
const float lowerBound = 0.999f * 0.999f;
|
||||
const float upperBound = 1.001f * 1.001f;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user