浏览代码

Fix OrientedBBox.Create()

/main
Evgenii Golubev 7 年前
当前提交
0220b716
共有 1 个文件被更改,包括 11 次插入5 次删除
  1. 16
      ScriptableRenderPipeline/Core/CoreRP/GeometryUtils.cs

16
ScriptableRenderPipeline/Core/CoreRP/GeometryUtils.cs


{
OrientedBBox obb = new OrientedBBox();
Vector3 vecX = t.localToWorldMatrix.GetColumn(0);
Vector3 vecY = t.localToWorldMatrix.GetColumn(1);
Vector3 vecZ = t.localToWorldMatrix.GetColumn(2);
obb.right = t.right;
obb.up = t.up;
obb.extentX = 0.5f * t.localScale.x;
obb.extentY = 0.5f * t.localScale.y;
obb.extentZ = 0.5f * t.localScale.z;
obb.right = vecX * 1.0f / (vecX.magnitude);
obb.up = vecY * 1.0f / (vecY.magnitude);
obb.extentX = 0.5f * vecX.magnitude;
obb.extentY = 0.5f * vecY.magnitude;
obb.extentZ = 0.5f * vecZ.magnitude;
return obb;
}

正在加载...
取消
保存