parent
e087c68116
commit
2dd425c191
9 changed files with 52 additions and 12 deletions
@ -0,0 +1,2 @@ |
|||||||
|
#pragma once |
||||||
|
#include "bakara/math/math.h" |
@ -0,0 +1,3 @@ |
|||||||
|
#pragma once |
||||||
|
|
||||||
|
#include "vec.h" |
@ -0,0 +1,4 @@ |
|||||||
|
#pragma once |
||||||
|
|
||||||
|
#include <glm/glm.hpp> |
||||||
|
#include <glm/gtc/matrix_transform.hpp> |
@ -0,0 +1,28 @@ |
|||||||
|
#pragma once |
||||||
|
|
||||||
|
#include "mathpch.h" |
||||||
|
|
||||||
|
namespace Bk::Math { |
||||||
|
class vec2 { |
||||||
|
public: |
||||||
|
float x; |
||||||
|
float y; |
||||||
|
|
||||||
|
vec2() { |
||||||
|
this->x = 0; |
||||||
|
this->y = 0; |
||||||
|
} |
||||||
|
vec2(float x, float y) { |
||||||
|
this->x = x; |
||||||
|
this->y = y; |
||||||
|
} |
||||||
|
vec2(glm::vec2 vec) { |
||||||
|
this->x = vec.x; |
||||||
|
this->y = vec.y; |
||||||
|
} |
||||||
|
|
||||||
|
glm::vec2 get_glm() { |
||||||
|
return glm::vec2(this->x, this->y); |
||||||
|
} |
||||||
|
}; |
||||||
|
} |
@ -1,6 +1,7 @@ |
|||||||
#include "test.hpp" |
#include "test.h" |
||||||
namespace BK::Math { |
|
||||||
int add(int x, int y) { |
namespace Bk::Math { |
||||||
return x + y; |
int add(int n1, int n2) { |
||||||
|
return n1 + n2; |
||||||
} |
} |
||||||
} |
} |
||||||
|
@ -0,0 +1,5 @@ |
|||||||
|
#pragma once |
||||||
|
|
||||||
|
namespace Bk::Math { |
||||||
|
int add(int n1, int n2); |
||||||
|
} |
@ -1,6 +0,0 @@ |
|||||||
#ifndef TEST_H |
|
||||||
#define TEST_H |
|
||||||
namespace BK::Math { |
|
||||||
int add(int x, int y); |
|
||||||
} |
|
||||||
#endif |
|
@ -1,6 +1,9 @@ |
|||||||
#include <iostream> |
#include <iostream> |
||||||
#include <bakara/test.hpp> |
#include <bakara/test.h> |
||||||
|
#include <bakara.h> |
||||||
|
|
||||||
int main() { |
int main() { |
||||||
std::cout << BK::Math::add(2, 2) << "\n"; |
std::cout << Bk::Math::add(2,2) << "\n"; |
||||||
|
Bk::Math::vec2 vec(2,2); |
||||||
|
std::cout << vec.x << " " << vec.y <<"\n"; |
||||||
} |
} |
Loading…
Reference in New Issue