Files
XCEngine/engine/include/XCEngine/Math/Box.h
ssdfasd 7c54a62f9e feat: 添加Math库和Google Test测试框架
- 新增Math库: Vector2/3/4, Matrix3/4, Quaternion, Transform, Color等
- 新增测试框架: Google Test (gtest)
- 新增140个单元测试,覆盖Vector, Matrix, Quaternion, Geometry
- VolumeRenderer支持vcpkg的NanoVDB
- 添加TESTING.md测试文档
2026-03-13 18:43:14 +08:00

31 lines
658 B
C++

#pragma once
#include "Math.h"
#include "Vector3.h"
#include "Matrix4.h"
namespace XCEngine {
namespace Math {
struct Sphere;
struct Ray;
struct Box {
Vector3 center = Vector3::Zero();
Vector3 extents = Vector3::Zero();
Matrix4x4 transform = Matrix4x4::Identity();
Box() = default;
Box(const Vector3& center, const Vector3& extents);
Vector3 GetMin() const;
Vector3 GetMax() const;
bool Contains(const Vector3& point) const;
bool Intersects(const Sphere& sphere) const;
bool Intersects(const Box& other) const;
bool Intersects(const Ray& ray, float& t) const;
};
} // namespace Math
} // namespace XCEngine