https://github.com/laurence-trippen/Q_rsqrt_Unity
Quake III Arena: Fast Inverse Square Root in Unity
https://github.com/laurence-trippen/Q_rsqrt_Unity
dll quake quake-3 quake-engine quake-iii-arena quake3 quake3arena unity unity3d-plugin
Last synced: about 1 year ago
JSON representation
Quake III Arena: Fast Inverse Square Root in Unity
- Host: GitHub
- URL: https://github.com/laurence-trippen/Q_rsqrt_Unity
- Owner: laurence-trippen
- Created: 2021-02-15T22:06:55.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-02-15T23:27:19.000Z (over 5 years ago)
- Last Synced: 2024-08-02T05:22:39.571Z (almost 2 years ago)
- Topics: dll, quake, quake-3, quake-engine, quake-iii-arena, quake3, quake3arena, unity, unity3d-plugin
- Language: C++
- Homepage:
- Size: 37.1 KB
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Q_rsqrt_Unity
Quake III Arena: Fast Inverse Square Root in Unity
## The good or bad idea. IDK.
Since I have always been interested in the Quake III engine ([id Tech 3](https://en.wikipedia.org/wiki/Id_Tech_3)) through [Star Wars Jedi Knight II: Jedi Outcast](https://en.wikipedia.org/wiki/Star_Wars_Jedi_Knight_II:_Jedi_Outcast) and am a fan of the [Fast Inverse Square Root Algorithm](https://en.wikipedia.org/wiki/Fast_inverse_square_root) I thought it would be interesting to make the algorithm available in the **UnityEngine**.
Apart from whether it makes sense or not, I just wanted to try it out. And so I started the experiment.
## Installation
### Windows
1. Download the [current release](https://github.com/laurence-trippen/Q_rsqrt_Unity/releases/) for Windows or compile it yourself if you want to.
2. Just put the ```Q_rsqrt_Unity_DLL_x86.dll``` or ```Q_rsqrt_Unity_DLL_x64.dll``` in your ```Assets/Plugins``` folder in your Unity Project.
3. Native plugins are typically bounded to a specific OS or platform. You can use the Unity Inspector to make sure each DLL is included in the right build.
### Linux
Coming soon.
### macOS
Coming soon.
## Usage
1. Import the **Q3** namespace.
2. Just call the static method ```float result = Qmath.Q_rsqrt(float number);```
```csharp
using UnityEngine;
using Q3;
public class Tester : MonoBehaviour
{
public float testValue = 1f;
private void Start()
{
float result = Qmath.Q_rsqrt(testValue);
Debug.Log(result);
}
}
```
## Performance / Profiling
Coming soon.