The Math library for HexaEngine provides comprehensive mathematical functions and utilities, optimized for performance and accuracy. Available in both minimal and full versions, this library is designed to be versatile and can be used with HexaEngine or any other project.
- SIMD Optimized Math Functions: High-performance functions for vectors, matrices, quaternions, and more.
- Double Precision Math Functions: For applications requiring high precision.
- Frustum, Plane, Ray, Sphere, Box, and AABB Math: Essential geometric operations for 3D applications.
- Generic Noise
- Perlin Noise
- Simplex Noise
- Polynomial Functions: For advanced mathematical calculations.
- Bezier Functions: For curve and surface modeling.
- Vector Math Extensions: Additional operations for vector math.
- Sky Model Functions: Implementations of Preetham and Hosek-Wilkie sky models.
- Color Math Functions: Including RGBA, HSVA, and HSLA color models.
- Prime Number Functions and Caching: Efficient prime number generation and caching.
- Shadow Mapping Functions: Support for OSM, PSM, DPSM, and CSM techniques.
- Transform Class: Comprehensive class for managing object transformations.
To get started with the HexaEngine Math library, follow these steps:
-
Install the NuGet package:
dotnet add package Hexa.NET.Math
Full version
X.X.X-full
vs minimal verionsX.X.X-minimal
, make sure to enable allow pre-releases in Visual Studio to see them. -
Include the library in your project:
using Hexa.NET.Mathematics;
-
Utilize the math functions:
MathUtil.XXX();
-
Perform geometric calculations:
var sphere = new BoundingSphere(new Vector3(0, 0, 0), 1.0f); var box = new BoundingBox(new Vector3(-1, -1, -1), new Vector3(1, 1, 1));
-
Generate noise:
var noiseValue = PerlinNoise.Noise(0.5f, 0.5f, 0.5f);
-
Work with colors:
var color = Color.FromRGBA(0xFFAABBCC);
- Minimal Version: Contains essential math functions and utilities.
- Full Version: Includes additional features such as shadow mapping functions and the Transform class.
Contributions are welcome! If you have ideas for new features or improvements, feel free to submit a pull request or open an issue.
This project is licensed under the MIT License. See the LICENSE file for more details.