3#include <litefx/core.h>
5#if !defined (LITEFX_MATH_API)
6# if defined(LiteFX_Math_EXPORTS) && (defined _WIN32 || defined WINCE)
7# define LITEFX_MATH_API __declspec(dllexport)
8# elif (defined(LiteFX_Math_EXPORTS) || defined(__APPLE__)) && defined __GNUC__ && __GNUC__ >= 4
9# define LITEFX_MATH_API __attribute__ ((visibility ("default")))
10# elif !defined(LiteFX_Math_EXPORTS) && (defined _WIN32 || defined WINCE)
11# define LITEFX_MATH_API __declspec(dllimport)
15#ifndef LITEFX_MATH_API
16# define LITEFX_MATH_API
19#if defined(BUILD_WITH_GLM)
23#if defined(BUILD_WITH_DIRECTX_MATH)
24#include <DirectXMath.h>
27#include <litefx/vector.hpp>
28#include <litefx/matrix.hpp>
60 inline const Float& operator[](
const unsigned int& i)
const noexcept;
61 inline Float& operator[](
const unsigned int& i)
noexcept;
64#if defined(BUILD_WITH_GLM)
66 Vector1f(
const glm::f32vec1& v)
noexcept;
68 inline operator glm::f32vec1()
noexcept;
71#if defined(BUILD_WITH_DIRECTX_MATH)
73 Vector1f(
const DirectX::XMVECTOR& v)
noexcept;
74 Vector1f(DirectX::XMVECTOR&& v)
noexcept;
75 inline operator DirectX::XMVECTOR()
noexcept;
96 inline const
UInt32& operator[](const
unsigned int& i) const noexcept;
97 inline
UInt32& operator[](const
unsigned int& i) noexcept;
100#if defined(BUILD_WITH_GLM)
102 Vector1u(
const glm::u32vec1& v)
noexcept;
103 Vector1u(glm::u32vec1&& v)
noexcept;
104 inline operator glm::u32vec1() noexcept;
107#if defined(BUILD_WITH_DIRECTX_MATH)
109 Vector1u(
const DirectX::XMVECTOR& v)
noexcept;
110 Vector1u(DirectX::XMVECTOR&& v)
noexcept;
111 inline operator DirectX::XMVECTOR() noexcept;
132 inline const Float& operator[](
const unsigned int& i)
const noexcept;
133 inline Float& operator[](
const unsigned int& i)
noexcept;
136#if defined(BUILD_WITH_GLM)
138 Vector2f(
const glm::f32vec2& v)
noexcept;
139 Vector2f(glm::f32vec2&& v)
noexcept;
140 inline operator glm::f32vec2()
noexcept;
143#if defined(BUILD_WITH_DIRECTX_MATH)
145 Vector2f(
const DirectX::XMVECTOR& v)
noexcept;
146 Vector2f(DirectX::XMVECTOR&& v)
noexcept;
147 Vector2f(
const DirectX::XMFLOAT2& v)
noexcept;
148 Vector2f(DirectX::XMFLOAT2&& v)
noexcept;
149 inline operator DirectX::XMVECTOR()
noexcept;
150 inline operator DirectX::XMFLOAT2()
noexcept;
171 inline const UInt32& operator[](
const unsigned int& i)
const noexcept;
172 inline UInt32& operator[](
const unsigned int& i)
noexcept;
175#if defined(BUILD_WITH_GLM)
177 Vector2u(
const glm::u32vec2& v)
noexcept;
178 Vector2u(glm::u32vec2&& v)
noexcept;
179 inline operator glm::u32vec2()
noexcept;
182#if defined(BUILD_WITH_DIRECTX_MATH)
184 Vector2u(
const DirectX::XMVECTOR& v)
noexcept;
185 Vector2u(DirectX::XMVECTOR&& v)
noexcept;
186 Vector2u(
const DirectX::XMUINT2& v)
noexcept;
187 Vector2u(DirectX::XMUINT2&& v)
noexcept;
188 inline operator DirectX::XMVECTOR()
noexcept;
189 inline operator DirectX::XMUINT2()
noexcept;
210 inline const Int32& operator[](
const unsigned int& i)
const noexcept;
211 inline Int32& operator[](
const unsigned int& i)
noexcept;
214#if defined(BUILD_WITH_GLM)
216 Vector2i(
const glm::i32vec2& v)
noexcept;
217 Vector2i(glm::i32vec2&& v)
noexcept;
218 inline operator glm::i32vec2()
noexcept;
221#if defined(BUILD_WITH_DIRECTX_MATH)
223 Vector2i(
const DirectX::XMVECTOR& v)
noexcept;
224 Vector2i(DirectX::XMVECTOR&& v)
noexcept;
225 Vector2i(
const DirectX::XMINT2& v)
noexcept;
226 Vector2i(DirectX::XMINT2&& v)
noexcept;
227 inline operator DirectX::XMVECTOR()
noexcept;
228 inline operator DirectX::XMINT2()
noexcept;
249 inline const Float& operator[](
const unsigned int& i)
const noexcept;
250 inline Float& operator[](
const unsigned int& i)
noexcept;
253#if defined(BUILD_WITH_GLM)
255 Vector3f(
const glm::f32vec3& v)
noexcept;
256 Vector3f(glm::f32vec3&& v)
noexcept;
257 inline operator glm::f32vec3()
noexcept;
260#if defined(BUILD_WITH_DIRECTX_MATH)
262 Vector3f(
const DirectX::XMVECTOR& v)
noexcept;
263 Vector3f(DirectX::XMVECTOR&& v)
noexcept;
264 Vector3f(
const DirectX::XMFLOAT3& v)
noexcept;
265 Vector3f(DirectX::XMFLOAT3&& v)
noexcept;
266 inline operator DirectX::XMVECTOR()
noexcept;
267 inline operator DirectX::XMFLOAT3()
noexcept;
288 inline const UInt32& operator[](
const unsigned int& i)
const noexcept;
289 inline UInt32& operator[](
const unsigned int& i)
noexcept;
292#if defined(BUILD_WITH_GLM)
294 Vector3u(
const glm::u32vec3& v)
noexcept;
295 Vector3u(glm::u32vec3&& v)
noexcept;
296 inline operator glm::u32vec3()
noexcept;
299#if defined(BUILD_WITH_DIRECTX_MATH)
301 Vector3u(
const DirectX::XMVECTOR& v)
noexcept;
302 Vector3u(DirectX::XMVECTOR&& v)
noexcept;
303 Vector3u(
const DirectX::XMUINT3& v)
noexcept;
304 Vector3u(DirectX::XMUINT3&& v)
noexcept;
305 inline operator DirectX::XMVECTOR()
noexcept;
306 inline operator DirectX::XMUINT3()
noexcept;
327 inline const Int32& operator[](
const unsigned int& i)
const noexcept;
328 inline Int32& operator[](
const unsigned int& i)
noexcept;
331#if defined(BUILD_WITH_GLM)
333 Vector3i(
const glm::i32vec3& v)
noexcept;
334 Vector3i(glm::i32vec3&& v)
noexcept;
335 inline operator glm::i32vec3()
noexcept;
338#if defined(BUILD_WITH_DIRECTX_MATH)
340 Vector3i(
const DirectX::XMVECTOR& v)
noexcept;
341 Vector3i(DirectX::XMVECTOR&& v)
noexcept;
342 Vector3i(
const DirectX::XMINT3& v)
noexcept;
343 Vector3i(DirectX::XMINT3&& v)
noexcept;
344 inline operator DirectX::XMVECTOR()
noexcept;
345 inline operator DirectX::XMINT3()
noexcept;
366 inline const Float& operator[](
const unsigned int& i)
const noexcept;
367 inline Float& operator[](
const unsigned int& i)
noexcept;
370#if defined(BUILD_WITH_GLM)
372 Vector4f(
const glm::f32vec4& v)
noexcept;
373 Vector4f(glm::f32vec4&& v)
noexcept;
374 inline operator glm::f32vec4()
noexcept;
377#if defined(BUILD_WITH_DIRECTX_MATH)
379 Vector4f(
const DirectX::XMVECTOR& v)
noexcept;
380 Vector4f(DirectX::XMVECTOR&& v)
noexcept;
381 Vector4f(
const DirectX::XMFLOAT4& v)
noexcept;
382 Vector4f(DirectX::XMFLOAT4&& v)
noexcept;
383 inline operator DirectX::XMVECTOR()
noexcept;
384 inline operator DirectX::XMFLOAT4()
noexcept;
405 inline const UInt32& operator[](
const unsigned int& i)
const noexcept;
406 inline UInt32& operator[](
const unsigned int& i)
noexcept;
409#if defined(BUILD_WITH_GLM)
411 Vector4u(
const glm::u32vec4& v)
noexcept;
412 Vector4u(glm::u32vec4&& v)
noexcept;
413 inline operator glm::u32vec4()
noexcept;
416#if defined(BUILD_WITH_DIRECTX_MATH)
418 Vector4u(
const DirectX::XMVECTOR& v)
noexcept;
419 Vector4u(DirectX::XMVECTOR&& v)
noexcept;
420 Vector4u(
const DirectX::XMUINT4& v)
noexcept;
421 Vector4u(DirectX::XMUINT4&& v)
noexcept;
422 inline operator DirectX::XMVECTOR()
noexcept;
423 inline operator DirectX::XMUINT4()
noexcept;
444 inline const Int32& operator[](
const unsigned int& i)
const noexcept;
445 inline Int32& operator[](
const unsigned int& i)
noexcept;
448#if defined(BUILD_WITH_GLM)
450 Vector4i(
const glm::i32vec4& v)
noexcept;
451 Vector4i(glm::i32vec4&& v)
noexcept;
452 inline operator glm::i32vec4()
noexcept;
455#if defined(BUILD_WITH_DIRECTX_MATH)
457 Vector4i(
const DirectX::XMVECTOR& v)
noexcept;
458 Vector4i(DirectX::XMVECTOR&& v)
noexcept;
459 Vector4i(
const DirectX::XMINT4& v)
noexcept;
460 Vector4i(DirectX::XMINT4&& v)
noexcept;
461 inline operator DirectX::XMVECTOR()
noexcept;
462 inline operator DirectX::XMINT4()
noexcept;
511 Size4d(
const size_t& v)
noexcept;
512 Size4d(
const size_t& w,
const size_t& h,
const size_t& d,
const size_t& a)
noexcept;
518 inline Size4d& operator=(
const Size4d& _other)
noexcept;
520 inline Size4d operator/(
const size_t& s)
noexcept;
521 inline Size4d& operator/=(
const size_t& s)
noexcept;
522 inline Size4d operator*(
const size_t& s)
noexcept;
523 inline Size4d& operator*=(
const size_t& s)
noexcept;
530 inline const size_t& width()
const noexcept;
531 inline size_t& width()
noexcept;
532 inline const size_t& height()
const noexcept;
533 inline size_t& height()
noexcept;
534 inline const size_t& depth()
const noexcept;
535 inline size_t& depth()
noexcept;
536 inline const size_t& alpha()
const noexcept;
537 inline size_t& alpha()
noexcept;
543 Size3d(
const size_t& v)
noexcept;
544 Size3d(
const size_t& w,
const size_t& h,
const size_t& d)
noexcept;
550 inline Size3d& operator=(
const Size3d& _other)
noexcept;
552 inline operator Size4d()
const noexcept;
553 inline Size3d operator/(
const size_t& s)
noexcept;
554 inline Size3d& operator/=(
const size_t& s)
noexcept;
555 inline Size3d operator*(
const size_t& s)
noexcept;
556 inline Size3d& operator*=(
const size_t& s)
noexcept;
563 inline const size_t& width()
const noexcept;
564 inline size_t& width()
noexcept;
565 inline const size_t& height()
const noexcept;
566 inline size_t& height()
noexcept;
567 inline const size_t& depth()
const noexcept;
568 inline size_t& depth()
noexcept;
574 Size2d(
const size_t& v)
noexcept;
575 Size2d(
const size_t& w,
const size_t& h)
noexcept;
581 inline Size2d& operator=(
const Size2d& _other)
noexcept;
583 inline operator Size3d()
const noexcept;
584 inline operator Size4d()
const noexcept;
585 inline Size2d operator/(
const size_t& s)
noexcept;
586 inline Size2d& operator/=(
const size_t& s)
noexcept;
587 inline Size2d operator*(
const size_t& s)
noexcept;
588 inline Size2d& operator*=(
const size_t& s)
noexcept;
595 inline const size_t& width()
const noexcept;
596 inline size_t& width()
noexcept;
597 inline const size_t& height()
const noexcept;
598 inline size_t& height()
noexcept;
602#pragma region Rectangle
607 Rect(
const size_t& x,
const size_t& y,
const size_t& w,
const size_t& h)
noexcept;
614 inline Rect& operator=(
Rect&& _other)
noexcept;
618 inline
Size2d extent() const noexcept;
619 inline const
size_t& width() const noexcept;
620 inline
size_t& width() noexcept;
621 inline const
size_t& height() const noexcept;
622 inline
size_t& height() noexcept;
636 inline RectI& operator=(
RectI&& _other)
noexcept;
640 inline
Size2d extent() const noexcept;
641 inline const
Int32& width() const noexcept;
642 inline
Int32& width() noexcept;
643 inline const
Int32& height() const noexcept;
644 inline
Int32& height() noexcept;
658 inline RectF& operator=(
RectF&& _other)
noexcept;
662 inline
Size2d extent() const noexcept;
663 inline const
Float& width() const noexcept;
664 inline
Float& width() noexcept;
665 inline const
Float& height() const noexcept;
666 inline
Float& height() noexcept;
RectF & operator=(const RectF &_other) noexcept
Rect & operator=(const Rect &_other) noexcept
RectI & operator=(const RectI &_other) noexcept
uint32_t UInt32
Definition: math.hpp:37
uint16_t UInt16
Definition: math.hpp:35
int16_t Int16
Definition: math.hpp:34
float_t Float
Definition: math.hpp:40
uint64_t UInt64
Definition: math.hpp:39
int64_t Int64
Definition: math.hpp:38
int32_t Int32
Definition: math.hpp:36
double_t Double
Definition: math.hpp:41
uint8_t Byte
Definition: math.hpp:33
std::vector< T > Array
Represents a dynamic array.
Definition: containers.hpp:58