Files
XCSDD/docs/api/math/box/intersects-ray.md
ssdfasd 58a83f445a fix: improve doc link navigation and tree display
- Fix link resolution with proper relative/absolute path handling
- Improve link styling with underline decoration
- Hide leaf nodes from tree, only show directories
- Fix log file path for packaged app
2026-03-19 12:44:08 +08:00

346 B

Box::Intersects (Ray)

bool Intersects(const Ray& ray, float& t) const

检测盒是否与射线相交。

参数:

  • ray - 射线
  • t - 输出交点距离

返回: bool - true 表示相交

复杂度: O(1)

示例:

float t;
if (box.Intersects(ray, t)) {
    Vector3 hit = ray.GetPoint(t);
}