649 B
649 B
OBB::GetAxis
Vector3 GetAxis(int index) const;
获取 OBB 在指定索引处的局部轴方向。index 取值为 0、1、2,分别对应局部坐标系的 X、Y、Z 轴。
参数:
index- 轴索引(0=X轴,1=Y轴,2=Z轴)
返回: 对应索引处的轴方向向量(已归一化)
异常: 无
线程安全: ✅
复杂度: O(1)
示例:
#include "AABB.h"
#include "Vector3.h"
using namespace XCEngine::Math;
OBB obb(Vector3(0.0f, 0.0f, 0.0f), Vector3(1.0f, 0.5f, 1.0f));
Vector3 axisX = obb.GetAxis(0);
Vector3 axisY = obb.GetAxis(1);
Vector3 axisZ = obb.GetAxis(2);