Fixed broken references: - texture-import-settings: Fix 16 files referencing wrong overview filename - math/rectint: Fix 9 method links (rectint-* → get*, contains, intersects) - rhi/opengl/device: Fix 8 cross-references (opengl-* → */**) - resources/mesh: Fix meshsection and vertexattribute links - rhi/d3d12/sampler: Fix RHISampler reference path - math/vector3: Fix projectonplane → project-on-plane - rhi/opengl/command-list: Remove broken ClearFlag enum ref - rhi/opengl/device: Create 2 new method docs (MakeContextCurrent, GetNativeContext) - rhi/device: Fix device-info types reference All 0 broken references remaining.
994 B
994 B
Plane::GetDistanceToPoint
float GetDistanceToPoint(const Vector3& point) const
计算点到平面的有符号距离。正值表示点在法线方向一侧,负值表示点在法线相反方向一侧,零值表示点在平面上。
参数:
point- 要计算的点
返回: float - 点到平面的有符号距离
线程安全: ✅
复杂度: O(1)
示例:
#include <XCEngine/Core/Math/Plane.h>
#include <XCEngine/Core/Math/Vector3.h>
#include <cstdio>
using namespace XCEngine::Math;
void GetDistanceToPointExample() {
Plane plane(Vector3::Up(), 0.0f);
Vector3 point1(0.0f, 2.0f, 0.0f);
float dist1 = plane.GetDistanceToPoint(point1);
Vector3 point2(0.0f, -3.0f, 0.0f);
float dist2 = plane.GetDistanceToPoint(point2);
}
相关文档
- Plane 类总览 - 返回类总览
- GetClosestPoint - 计算平面上最接近点
- GetSide - 判断点在哪一侧