2026-02-11 02:52:03 +01:00
|
|
|
import Crafter.Math;
|
|
|
|
|
import std;
|
|
|
|
|
|
|
|
|
|
using namespace Crafter;
|
|
|
|
|
|
|
|
|
|
int main() {
|
2026-02-19 02:36:36 +01:00
|
|
|
// // Test Ray-OrientedBox intersection
|
|
|
|
|
// Vector<float, 3, 0> boxPos(0.0f, 0.0f, 0.0f);
|
|
|
|
|
// Vector<float, 3, 0> boxSize(2.0f, 2.0f, 2.0f);
|
|
|
|
|
// Vector<float, 3, 0> boxRot(0.0f, 0.0f, 0.0f); // No rotation
|
|
|
|
|
// Vector<float, 3, 0> rayOrigin(0.0f, 0.0f, -5.0f);
|
|
|
|
|
// Vector<float, 3, 0> rayDir(0.0f, 0.0f, 1.0f);
|
|
|
|
|
|
|
|
|
|
// float hitDistance = IntersectionTestRayOrientedBox(boxPos, boxSize, boxRot, rayOrigin, rayDir);
|
|
|
|
|
|
|
|
|
|
// if (hitDistance < std::numeric_limits<float>::max()) {
|
|
|
|
|
// // Hit occurred
|
|
|
|
|
// std::cout << "Ray-OrientedBox intersection at distance: " << hitDistance << std::endl;
|
|
|
|
|
// } else {
|
|
|
|
|
// // No hit
|
|
|
|
|
// std::cout << "No intersection with Ray-OrientedBox" << std::endl;
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// return 0;
|
2026-02-19 07:00:58 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
std::cout << (Vector<float, 3, 0>(5, 0, 0) == Vector<float, 3, 0>(5,0,1)) << std::endl;
|
2026-02-11 02:52:03 +01:00
|
|
|
}
|