KarmaEngine
Game Engine for practical learning and research purposes
Loading...
Searching...
No Matches
KarmaMath.h
Go to the documentation of this file.
1
10
11#pragma once
12
13#include "glm/common.hpp"
14
15namespace Karma
16{
21 {
31 template< class T >
32 static T Max(const T A, const T B)
33 {
34 return glm::max(A, B);
35 }
36
46 template< class T >
47 static T Min(const T A, const T B)
48 {
49 return glm::min(A, B);
50 }
51
60 static uint32_t CountTrailingZeros(uint32_t Value)
61 {
62 // return 32 if value was 0
63 unsigned long BitIndex = 0; // 0-based, where the LSB is 0 and MSB is 31
64 return Value;//_BitScanForward(&BitIndex, Value) ? BitIndex : 32;
65 }
66 };
67}
#define KARMA_API
Defining Karma's API macro for storage class information.
Definition Core.h:41
A general purpose structure for Math functions and utilities.
Definition KarmaMath.h:21
static T Max(const T A, const T B)
Returns higher value in a generic way.
Definition KarmaMath.h:32
static uint32_t CountTrailingZeros(uint32_t Value)
No clue what this does.
Definition KarmaMath.h:60
static T Min(const T A, const T B)
Returns lower value in a generic way.
Definition KarmaMath.h:47