Compare commits

5 Commits

Author SHA1 Message Date
516e143901 Added missing <type_traits> include
Some checks failed
CMake on multiple platforms / build (Release, cl, cl, windows-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, clang, clang++, macos-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, clang, clang++, ubuntu-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, gcc, g++, ubuntu-latest) (push) Has been cancelled
2026-07-25 14:59:56 -07:00
7e38a43301 Bump to C++23 standard.
Some checks failed
CMake on multiple platforms / build (Release, cl, cl, windows-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, clang, clang++, macos-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, clang, clang++, ubuntu-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, gcc, g++, ubuntu-latest) (push) Has been cancelled
2026-06-16 00:38:22 -07:00
3d87e2f885 Bump to c++20
Some checks failed
CMake on multiple platforms / build (Release, cl, cl, windows-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, clang, clang++, macos-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, clang, clang++, ubuntu-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, gcc, g++, ubuntu-latest) (push) Has been cancelled
Remove KRMIN, KRMAX, and KRCLAMP helpers.
2026-05-17 14:23:26 -07:00
17b4ec2cde Add AABB::encapsulate(const Vector3& v)
Some checks failed
CMake on multiple platforms / build (Release, cl, cl, windows-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, clang, clang++, macos-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, clang, clang++, ubuntu-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, gcc, g++, ubuntu-latest) (push) Has been cancelled
Add AABB::Create(const AABB& modelSpaceExtents, const Matrix4& modelMatrix)
2026-05-17 12:50:26 -07:00
cc7dffbb9a Bump Copyright year
Some checks failed
CMake on multiple platforms / build (Release, cl, cl, windows-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, clang, clang++, macos-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, clang, clang++, ubuntu-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, gcc, g++, ubuntu-latest) (push) Has been cancelled
2026-05-17 12:22:00 -07:00
29 changed files with 77 additions and 49 deletions

View File

@@ -1,5 +1,5 @@
cmake_minimum_required (VERSION 3.16) cmake_minimum_required (VERSION 3.16)
set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_EXTENSIONS OFF)

View File

@@ -2,7 +2,7 @@
// KRAABB.h // KRAABB.h
// Kraken Engine / Hydra // Kraken Engine / Hydra
// //
// Copyright 2024 Kearwood Gilbert. All rights reserved. // Copyright 2026 Kearwood Gilbert. All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without modification, are // Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met: // permitted provided that the following conditions are met:
@@ -34,6 +34,7 @@
#pragma once #pragma once
#include <functional> // for hash<> #include <functional> // for hash<>
#include <type_traits>
#include "vector2.h" #include "vector2.h"
#include "vector3.h" #include "vector3.h"
@@ -53,6 +54,7 @@ public:
void init(); void init();
static AABB Create(const Vector3& minPoint, const Vector3& maxPoint); static AABB Create(const Vector3& minPoint, const Vector3& maxPoint);
static AABB Create(const Vector3& corner1, const Vector3& corner2, const Matrix4& modelMatrix); static AABB Create(const Vector3& corner1, const Vector3& corner2, const Matrix4& modelMatrix);
static AABB Create(const AABB& modelSpaceExtents, const Matrix4& modelMatrix);
static AABB Create(); static AABB Create();
void scale(const Vector3& s); void scale(const Vector3& s);
@@ -69,6 +71,7 @@ public:
bool intersectsRay(const Vector3& v1, const Vector3& dir) const; bool intersectsRay(const Vector3& v1, const Vector3& dir) const;
bool intersectsSphere(const Vector3& center, float radius) const; bool intersectsSphere(const Vector3& center, float radius) const;
void encapsulate(const AABB& b); void encapsulate(const AABB& b);
void encapsulate(const Vector3& v);
bool operator ==(const AABB& b) const; bool operator ==(const AABB& b) const;
bool operator !=(const AABB& b) const; bool operator !=(const AABB& b) const;

View File

@@ -2,7 +2,7 @@
// hitinfo.h // hitinfo.h
// Kraken Engine / Hydra // Kraken Engine / Hydra
// //
// Copyright 2024 Kearwood Gilbert. All rights reserved. // Copyright 2026 Kearwood Gilbert. All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without modification, are // Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met: // permitted provided that the following conditions are met:
@@ -32,6 +32,7 @@
#pragma once #pragma once
#include "vector3.h" #include "vector3.h"
#include <type_traits>
class KRNode; class KRNode;

View File

@@ -2,7 +2,7 @@
// hydra.h // hydra.h
// Kraken Engine / Hydra // Kraken Engine / Hydra
// //
// Copyright 2024 Kearwood Gilbert. All rights reserved. // Copyright 2026 Kearwood Gilbert. All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without modification, are // Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met: // permitted provided that the following conditions are met:

View File

@@ -2,7 +2,7 @@
// Matrix2.h // Matrix2.h
// Kraken Engine / Hydra // Kraken Engine / Hydra
// //
// Copyright 2024 Kearwood Gilbert. All rights reserved. // Copyright 2026 Kearwood Gilbert. All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without modification, are // Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met: // permitted provided that the following conditions are met:
@@ -28,10 +28,10 @@
// authors and should not be interpreted as representing official policies, either expressed // authors and should not be interpreted as representing official policies, either expressed
// or implied, of Kearwood Gilbert. // or implied, of Kearwood Gilbert.
// //
#pragma once
#include "vector2.h" #include "vector2.h"
#include <type_traits>
#pragma once
namespace hydra { namespace hydra {

View File

@@ -2,7 +2,7 @@
// Matrix2x3.h // Matrix2x3.h
// Kraken Engine / Hydra // Kraken Engine / Hydra
// //
// Copyright 2024 Kearwood Gilbert. All rights reserved. // Copyright 2026 Kearwood Gilbert. All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without modification, are // Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met: // permitted provided that the following conditions are met:
@@ -29,10 +29,11 @@
// or implied, of Kearwood Gilbert. // or implied, of Kearwood Gilbert.
// //
#pragma once
#include "vector2.h" #include "vector2.h"
#include "vector3.h" #include "vector3.h"
#include <type_traits>
#pragma once
namespace hydra { namespace hydra {

View File

@@ -2,7 +2,7 @@
// Matrix4.h // Matrix4.h
// Kraken Engine / Hydra // Kraken Engine / Hydra
// //
// Copyright 2024 Kearwood Gilbert. All rights reserved. // Copyright 2026 Kearwood Gilbert. All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without modification, are // Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met: // permitted provided that the following conditions are met:
@@ -29,11 +29,11 @@
// or implied, of Kearwood Gilbert. // or implied, of Kearwood Gilbert.
// //
#pragma once
#include "vector3.h" #include "vector3.h"
#include "vector4.h" #include "vector4.h"
#include <type_traits>
#pragma once
namespace hydra { namespace hydra {

View File

@@ -2,7 +2,7 @@
// Quaternion.h // Quaternion.h
// Kraken Engine / Hydra // Kraken Engine / Hydra
// //
// Copyright 2024 Kearwood Gilbert. All rights reserved. // Copyright 2026 Kearwood Gilbert. All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without modification, are // Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met: // permitted provided that the following conditions are met:
@@ -32,6 +32,7 @@
#pragma once #pragma once
#include "vector3.h" #include "vector3.h"
#include <type_traits>
namespace hydra { namespace hydra {

View File

@@ -2,7 +2,7 @@
// KRFloat.h // KRFloat.h
// Kraken Engine / Hydra // Kraken Engine / Hydra
// //
// Copyright 2024 Kearwood Gilbert. All rights reserved. // Copyright 2026 Kearwood Gilbert. All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without modification, are // Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met: // permitted provided that the following conditions are met:

View File

@@ -2,7 +2,7 @@
// KRTriangle.h // KRTriangle.h
// Kraken Engine / Hydra // Kraken Engine / Hydra
// //
// Copyright 2024 Kearwood Gilbert. All rights reserved. // Copyright 2026 Kearwood Gilbert. All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without modification, are // Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met: // permitted provided that the following conditions are met:
@@ -32,6 +32,7 @@
#pragma once #pragma once
#include "vector3.h" #include "vector3.h"
#include <type_traits>
namespace hydra { namespace hydra {

View File

@@ -2,7 +2,7 @@
// vector2.h // vector2.h
// Kraken Engine / Hydra // Kraken Engine / Hydra
// //
// Copyright 2024 Kearwood Gilbert. All rights reserved. // Copyright 2026 Kearwood Gilbert. All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without modification, are // Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met: // permitted provided that the following conditions are met:
@@ -34,6 +34,7 @@
#include <functional> // for hash<> #include <functional> // for hash<>
#include <limits> // for std::numeric_limits<> #include <limits> // for std::numeric_limits<>
#include <math.h> // for sqrtf #include <math.h> // for sqrtf
#include <type_traits>
namespace hydra { namespace hydra {

View File

@@ -2,7 +2,7 @@
// vector2i.h // vector2i.h
// Kraken Engine / Hydra // Kraken Engine / Hydra
// //
// Copyright 2024 Kearwood Gilbert. All rights reserved. // Copyright 2026 Kearwood Gilbert. All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without modification, are // Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met: // permitted provided that the following conditions are met:
@@ -34,6 +34,7 @@
#include <functional> // for hash<> #include <functional> // for hash<>
#include <limits> // for std::numeric_limits<> #include <limits> // for std::numeric_limits<>
#include <math.h> // for sqrtf #include <math.h> // for sqrtf
#include <type_traits>
namespace hydra { namespace hydra {

View File

@@ -2,7 +2,7 @@
// Vector3.h // Vector3.h
// Kraken Engine / Hydra // Kraken Engine / Hydra
// //
// Copyright 2024 Kearwood Gilbert. All rights reserved. // Copyright 2026 Kearwood Gilbert. All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without modification, are // Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met: // permitted provided that the following conditions are met:
@@ -32,6 +32,7 @@
#pragma once #pragma once
#include <functional> // for hash<> #include <functional> // for hash<>
#include <type_traits>
#include "vector2.h" #include "vector2.h"
#include "vector4.h" #include "vector4.h"

View File

@@ -2,7 +2,7 @@
// Vector3i.h // Vector3i.h
// Kraken Engine / Hydra // Kraken Engine / Hydra
// //
// Copyright 2024 Kearwood Gilbert. All rights reserved. // Copyright 2026 Kearwood Gilbert. All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without modification, are // Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met: // permitted provided that the following conditions are met:
@@ -32,6 +32,7 @@
#pragma once #pragma once
#include <functional> // for hash<> #include <functional> // for hash<>
#include <type_traits>
#include "vector2i.h" #include "vector2i.h"

View File

@@ -2,7 +2,7 @@
// Vector4.h // Vector4.h
// Kraken Engine / Hydra // Kraken Engine / Hydra
// //
// Copyright 2024 Kearwood Gilbert. All rights reserved. // Copyright 2026 Kearwood Gilbert. All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without modification, are // Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met: // permitted provided that the following conditions are met:
@@ -32,6 +32,7 @@
#pragma once #pragma once
#include <functional> // for hash<> #include <functional> // for hash<>
#include <type_traits>
namespace hydra { namespace hydra {

View File

@@ -2,7 +2,7 @@
// aabb.cpp // aabb.cpp
// Kraken Engine / Hydra // Kraken Engine / Hydra
// //
// Copyright 2024 Kearwood Gilbert. All rights reserved. // Copyright 2026 Kearwood Gilbert. All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without modification, are // Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met: // permitted provided that the following conditions are met:
@@ -32,6 +32,7 @@
#include "../include/hydra.h" #include "../include/hydra.h"
#include "assert.h" #include "assert.h"
#include "krhelpers.h" #include "krhelpers.h"
#include <algorithm>
namespace hydra { namespace hydra {
@@ -91,6 +92,13 @@ AABB AABB::Create(const Vector3& corner1, const Vector3& corner2, const Matrix4&
return r; return r;
} }
AABB AABB::Create(const AABB& modelSpaceExtents, const Matrix4& modelMatrix)
{
AABB r;
r.init(modelSpaceExtents.min, modelSpaceExtents.max, modelMatrix);
return r;
}
bool AABB::operator ==(const AABB& b) const bool AABB::operator ==(const AABB& b) const
{ {
return min == b.min && max == b.max; return min == b.min && max == b.max;
@@ -366,9 +374,20 @@ void AABB::encapsulate(const AABB& b)
if (b.max.z > max.z) max.z = b.max.z; if (b.max.z > max.z) max.z = b.max.z;
} }
void AABB::encapsulate(const Vector3& v)
{
if (v.x < min.x) min.x = v.x;
if (v.y < min.y) min.y = v.y;
if (v.z < min.z) min.z = v.z;
if (v.x > max.x) max.x = v.x;
if (v.y > max.y) max.y = v.y;
if (v.z > max.z) max.z = v.z;
}
Vector3 AABB::nearestPoint(const Vector3& v) const Vector3 AABB::nearestPoint(const Vector3& v) const
{ {
return Vector3::Create(KRCLAMP(v.x, min.x, max.x), KRCLAMP(v.y, min.y, max.y), KRCLAMP(v.z, min.z, max.z)); return Vector3::Create(std::clamp(v.x, min.x, max.x), std::clamp(v.y, min.y, max.y), std::clamp(v.z, min.z, max.z));
} }
} // namespace hydra } // namespace hydra

View File

@@ -2,7 +2,7 @@
// hitinfo.cpp // hitinfo.cpp
// Kraken Engine / Hydra // Kraken Engine / Hydra
// //
// Copyright 2024 Kearwood Gilbert. All rights reserved. // Copyright 2026 Kearwood Gilbert. All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without modification, are // Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met: // permitted provided that the following conditions are met:

View File

@@ -2,7 +2,7 @@
// krhelpers.h // krhelpers.h
// Kraken Engine / Hydra // Kraken Engine / Hydra
// //
// Copyright 2024 Kearwood Gilbert. All rights reserved. // Copyright 2026 Kearwood Gilbert. All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without modification, are // Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met: // permitted provided that the following conditions are met:
@@ -33,9 +33,6 @@
#include "../include/hydra.h" #include "../include/hydra.h"
#define KRMIN(x,y) ((x) < (y) ? (x) : (y))
#define KRMAX(x,y) ((x) > (y) ? (x) : (y))
#define KRCLAMP(x, min, max) (KRMAX(KRMIN(x, max), min))
#define KRALIGN(x) ((x + 3) & ~0x03) #define KRALIGN(x) ((x + 3) & ~0x03)
float const PI = 3.141592653589793f; float const PI = 3.141592653589793f;

View File

@@ -2,7 +2,7 @@
// matrix2.cpp // matrix2.cpp
// Kraken Engine / Hydra // Kraken Engine / Hydra
// //
// Copyright 2024 Kearwood Gilbert. All rights reserved. // Copyright 2026 Kearwood Gilbert. All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without modification, are // Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met: // permitted provided that the following conditions are met:

View File

@@ -2,7 +2,7 @@
// matrix23.cpp // matrix23.cpp
// Kraken Engine / Hydra // Kraken Engine / Hydra
// //
// Copyright 2024 Kearwood Gilbert. All rights reserved. // Copyright 2026 Kearwood Gilbert. All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without modification, are // Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met: // permitted provided that the following conditions are met:

View File

@@ -2,7 +2,7 @@
// matrix4.cpp // matrix4.cpp
// Kraken Engine / Hydra // Kraken Engine / Hydra
// //
// Copyright 2024 Kearwood Gilbert. All rights reserved. // Copyright 2026 Kearwood Gilbert. All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without modification, are // Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met: // permitted provided that the following conditions are met:

View File

@@ -2,7 +2,7 @@
// quaternion.cpp // quaternion.cpp
// Kraken Engine / Hydra // Kraken Engine / Hydra
// //
// Copyright 2024 Kearwood Gilbert. All rights reserved. // Copyright 2026 Kearwood Gilbert. All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without modification, are // Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met: // permitted provided that the following conditions are met:

View File

@@ -2,7 +2,7 @@
// scalar.cpp // scalar.cpp
// Kraken Engine / Hydra // Kraken Engine / Hydra
// //
// Copyright 2024 Kearwood Gilbert. All rights reserved. // Copyright 2026 Kearwood Gilbert. All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without modification, are // Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met: // permitted provided that the following conditions are met:

View File

@@ -2,7 +2,7 @@
// KRTriangle.cpp // KRTriangle.cpp
// Kraken Engine / Hydra // Kraken Engine / Hydra
// //
// Copyright 2024 Kearwood Gilbert. All rights reserved. // Copyright 2026 Kearwood Gilbert. All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without modification, are // Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met: // permitted provided that the following conditions are met:

View File

@@ -2,7 +2,7 @@
// Vector2.cpp // Vector2.cpp
// Kraken Engine / Hydra // Kraken Engine / Hydra
// //
// Copyright 2024 Kearwood Gilbert. All rights reserved. // Copyright 2026 Kearwood Gilbert. All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without modification, are // Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met: // permitted provided that the following conditions are met:
@@ -291,12 +291,12 @@ float Vector2::Dot(const Vector2& v1, const Vector2& v2)
Vector2 Vector2::Min(const Vector2& v1, const Vector2& v2) Vector2 Vector2::Min(const Vector2& v1, const Vector2& v2)
{ {
return Vector2::Create(KRMIN(v1.x, v2.x), KRMIN(v1.y, v2.y)); return Vector2::Create(std::min(v1.x, v2.x), std::min(v1.y, v2.y));
} }
Vector2 Vector2::Max(const Vector2& v1, const Vector2& v2) Vector2 Vector2::Max(const Vector2& v1, const Vector2& v2)
{ {
return Vector2::Create(KRMAX(v1.x, v2.x), KRMAX(v1.y, v2.y)); return Vector2::Create(std::max(v1.x, v2.x), std::max(v1.y, v2.y));
} }
} // namepsace hydra } // namepsace hydra

View File

@@ -2,7 +2,7 @@
// Vector2i.cpp // Vector2i.cpp
// Kraken Engine / Hydra // Kraken Engine / Hydra
// //
// Copyright 2024 Kearwood Gilbert. All rights reserved. // Copyright 2026 Kearwood Gilbert. All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without modification, are // Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met: // permitted provided that the following conditions are met:
@@ -285,12 +285,12 @@ int Vector2i::Dot(const Vector2i& v1, const Vector2i& v2)
Vector2i Vector2i::Min(const Vector2i& v1, const Vector2i& v2) Vector2i Vector2i::Min(const Vector2i& v1, const Vector2i& v2)
{ {
return Vector2i::Create(KRMIN(v1.x, v2.x), KRMIN(v1.y, v2.y)); return Vector2i::Create(std::min(v1.x, v2.x), std::min(v1.y, v2.y));
} }
Vector2i Vector2i::Max(const Vector2i& v1, const Vector2i& v2) Vector2i Vector2i::Max(const Vector2i& v1, const Vector2i& v2)
{ {
return Vector2i::Create(KRMAX(v1.x, v2.x), KRMAX(v1.y, v2.y)); return Vector2i::Create(std::max(v1.x, v2.x), std::max(v1.y, v2.y));
} }
} // namepsace hydra } // namepsace hydra

View File

@@ -2,7 +2,7 @@
// Vector3.cpp // Vector3.cpp
// Kraken Engine / Hydra // Kraken Engine / Hydra
// //
// Copyright 2024 Kearwood Gilbert. All rights reserved. // Copyright 2026 Kearwood Gilbert. All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without modification, are // Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met: // permitted provided that the following conditions are met:
@@ -458,12 +458,12 @@ float Vector3::Dot(const Vector3& v1, const Vector3& v2)
Vector3 Vector3::Min(const Vector3& v1, const Vector3& v2) Vector3 Vector3::Min(const Vector3& v1, const Vector3& v2)
{ {
return Vector3::Create(KRMIN(v1.x, v2.x), KRMIN(v1.y, v2.y), KRMIN(v1.z, v2.z)); return Vector3::Create(std::min(v1.x, v2.x), std::min(v1.y, v2.y), std::min(v1.z, v2.z));
} }
Vector3 Vector3::Max(const Vector3& v1, const Vector3& v2) Vector3 Vector3::Max(const Vector3& v1, const Vector3& v2)
{ {
return Vector3::Create(KRMAX(v1.x, v2.x), KRMAX(v1.y, v2.y), KRMAX(v1.z, v2.z)); return Vector3::Create(std::max(v1.x, v2.x), std::max(v1.y, v2.y), std::max(v1.z, v2.z));
} }
bool Vector3::operator >(const Vector3& b) const bool Vector3::operator >(const Vector3& b) const

View File

@@ -2,7 +2,7 @@
// Vector3i.cpp // Vector3i.cpp
// Kraken Engine / Hydra // Kraken Engine / Hydra
// //
// Copyright 2024 Kearwood Gilbert. All rights reserved. // Copyright 2026 Kearwood Gilbert. All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without modification, are // Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met: // permitted provided that the following conditions are met:
@@ -373,12 +373,12 @@ int Vector3i::Dot(const Vector3i& v1, const Vector3i& v2)
Vector3i Vector3i::Min(const Vector3i& v1, const Vector3i& v2) Vector3i Vector3i::Min(const Vector3i& v1, const Vector3i& v2)
{ {
return Vector3i::Create(KRMIN(v1.x, v2.x), KRMIN(v1.y, v2.y), KRMIN(v1.z, v2.z)); return Vector3i::Create(std::min(v1.x, v2.x), std::min(v1.y, v2.y), std::min(v1.z, v2.z));
} }
Vector3i Vector3i::Max(const Vector3i& v1, const Vector3i& v2) Vector3i Vector3i::Max(const Vector3i& v1, const Vector3i& v2)
{ {
return Vector3i::Create(KRMAX(v1.x, v2.x), KRMAX(v1.y, v2.y), KRMAX(v1.z, v2.z)); return Vector3i::Create(std::max(v1.x, v2.x), std::max(v1.y, v2.y), std::max(v1.z, v2.z));
} }
bool Vector3i::operator >(const Vector3i& b) const bool Vector3i::operator >(const Vector3i& b) const

View File

@@ -2,7 +2,7 @@
// Vector4.cpp // Vector4.cpp
// Kraken Engine / Hydra // Kraken Engine / Hydra
// //
// Copyright 2024 Kearwood Gilbert. All rights reserved. // Copyright 2026 Kearwood Gilbert. All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without modification, are // Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met: // permitted provided that the following conditions are met:
@@ -351,12 +351,12 @@ float Vector4::Dot(const Vector4& v1, const Vector4& v2)
Vector4 Vector4::Min(const Vector4& v1, const Vector4& v2) Vector4 Vector4::Min(const Vector4& v1, const Vector4& v2)
{ {
return Vector4::Create(KRMIN(v1.x, v2.x), KRMIN(v1.y, v2.y), KRMIN(v1.z, v2.z), KRMIN(v1.w, v2.w)); return Vector4::Create(std::min(v1.x, v2.x), std::min(v1.y, v2.y), std::min(v1.z, v2.z), std::min(v1.w, v2.w));
} }
Vector4 Vector4::Max(const Vector4& v1, const Vector4& v2) Vector4 Vector4::Max(const Vector4& v1, const Vector4& v2)
{ {
return Vector4::Create(KRMAX(v1.x, v2.x), KRMAX(v1.y, v2.y), KRMAX(v1.z, v2.z), KRMAX(v1.w, v2.w)); return Vector4::Create(std::max(v1.x, v2.x), std::max(v1.y, v2.y), std::max(v1.z, v2.z), std::max(v1.w, v2.w));
} }
bool Vector4::operator >(const Vector4& b) const bool Vector4::operator >(const Vector4& b) const