Crafter.Math/interfaces/main.cpp

25 lines
No EOL
848 B
C++

import Crafter.Math;
import std;
using namespace Crafter;
int main() {
// // 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;
}