Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
Halton.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreTypes.h"
6
7
8/** [ Halton 1964, "Radical-inverse quasi-random point sequence" ] */
9inline float Halton(int32 Index, int32 Base)
10{
11 float Result = 0.0f;
12 float InvBase = 1.0f / float(Base);
13 float Fraction = InvBase;
14 while (Index > 0)
15 {
16 Result += float(Index % Base) * Fraction;
17 Index /= Base;
18 Fraction *= InvBase;
19 }
20 return Result;
21}
float Halton(int32 Index, int32 Base)
Definition Halton.h:9