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 "krpch.h"
14
15#include "glm/common.hpp"
16
17namespace Karma
18{
23 {
33 template< class T >
34 static T Max(const T A, const T B)
35 {
36 return glm::max(A, B);
37 }
38
48 template< class T >
49 static T Min(const T A, const T B)
50 {
51 return glm::min(A, B);
52 }
53
62 static uint32_t CountTrailingZeros(uint32_t Value)
63 {
64 // return 32 if value was 0
65 unsigned long BitIndex = 0; // 0-based, where the LSB is 0 and MSB is 31
66 return Value;//_BitScanForward(&BitIndex, Value) ? BitIndex : 32;
67 }
68 };
69}
#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:23
static T Max(const T A, const T B)
Returns higher value in a generic way.
Definition KarmaMath.h:34
static uint32_t CountTrailingZeros(uint32_t Value)
No clue what this does.
Definition KarmaMath.h:62
static T Min(const T A, const T B)
Returns lower value in a generic way.
Definition KarmaMath.h:49