|
@@ -11,55 +11,48 @@
|
|
|
/// @ingroup Core
|
|
/// @ingroup Core
|
|
|
namespace crown
|
|
namespace crown
|
|
|
{
|
|
{
|
|
|
-/// @ingroup Math
|
|
|
|
|
|
|
+/// @addtogroup Math
|
|
|
|
|
+/// @{
|
|
|
|
|
+
|
|
|
struct Vector2
|
|
struct Vector2
|
|
|
{
|
|
{
|
|
|
f32 x, y;
|
|
f32 x, y;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-/// @ingroup Math
|
|
|
|
|
struct Vector3
|
|
struct Vector3
|
|
|
{
|
|
{
|
|
|
f32 x, y, z;
|
|
f32 x, y, z;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-/// @ingroup Math
|
|
|
|
|
struct Vector4
|
|
struct Vector4
|
|
|
{
|
|
{
|
|
|
f32 x, y, z, w;
|
|
f32 x, y, z, w;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
/// RGBA color.
|
|
/// RGBA color.
|
|
|
-///
|
|
|
|
|
-/// @ingroup Math
|
|
|
|
|
typedef Vector4 Color4;
|
|
typedef Vector4 Color4;
|
|
|
|
|
|
|
|
-/// @ingroup Math
|
|
|
|
|
struct Quaternion
|
|
struct Quaternion
|
|
|
{
|
|
{
|
|
|
f32 x, y, z, w;
|
|
f32 x, y, z, w;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-/// @ingroup Math
|
|
|
|
|
struct Matrix3x3
|
|
struct Matrix3x3
|
|
|
{
|
|
{
|
|
|
Vector3 x, y, z;
|
|
Vector3 x, y, z;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-/// @ingroup Math
|
|
|
|
|
struct Matrix4x4
|
|
struct Matrix4x4
|
|
|
{
|
|
{
|
|
|
Vector4 x, y, z, t;
|
|
Vector4 x, y, z, t;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-/// @ingroup Math
|
|
|
|
|
struct AABB
|
|
struct AABB
|
|
|
{
|
|
{
|
|
|
Vector3 min;
|
|
Vector3 min;
|
|
|
Vector3 max;
|
|
Vector3 max;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-/// @ingroup Math
|
|
|
|
|
struct OBB
|
|
struct OBB
|
|
|
{
|
|
{
|
|
|
Matrix4x4 tm;
|
|
Matrix4x4 tm;
|
|
@@ -69,15 +62,12 @@ struct OBB
|
|
|
/// 3D Plane.
|
|
/// 3D Plane.
|
|
|
/// The form is ax + by + cz + d = 0
|
|
/// The form is ax + by + cz + d = 0
|
|
|
/// where: d = -vector3::dot(n, p)
|
|
/// where: d = -vector3::dot(n, p)
|
|
|
-///
|
|
|
|
|
-/// @ingroup Math
|
|
|
|
|
struct Plane3
|
|
struct Plane3
|
|
|
{
|
|
{
|
|
|
Vector3 n;
|
|
Vector3 n;
|
|
|
f32 d;
|
|
f32 d;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-/// @ingroup Math
|
|
|
|
|
struct Frustum
|
|
struct Frustum
|
|
|
{
|
|
{
|
|
|
Plane3 left;
|
|
Plane3 left;
|
|
@@ -88,15 +78,12 @@ struct Frustum
|
|
|
Plane3 far;
|
|
Plane3 far;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-/// @ingroup Math
|
|
|
|
|
struct Sphere
|
|
struct Sphere
|
|
|
{
|
|
{
|
|
|
Vector3 c;
|
|
Vector3 c;
|
|
|
f32 r;
|
|
f32 r;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-/// @addtogroup Math
|
|
|
|
|
-/// @{
|
|
|
|
|
const Vector2 VECTOR2_ZERO = { 0.0f, 0.0f };
|
|
const Vector2 VECTOR2_ZERO = { 0.0f, 0.0f };
|
|
|
const Vector2 VECTOR2_ONE = { 1.0f, 1.0f };
|
|
const Vector2 VECTOR2_ONE = { 1.0f, 1.0f };
|
|
|
const Vector2 VECTOR2_XAXIS = { 1.0f, 0.0f };
|
|
const Vector2 VECTOR2_XAXIS = { 1.0f, 0.0f };
|