进一步规范PrimitiveComponent/MeshComponent中获取绑定盒的函数名称,并正确渲染OBB。不过没处理旋转。
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include<hgl/component/RenderComponent.h>
|
||||
#include<hgl/graph/Mesh.h>
|
||||
@@ -101,7 +101,7 @@ public:
|
||||
return mcd->mesh;
|
||||
}
|
||||
|
||||
const bool GetBoundingBox(AABB &box) const override
|
||||
const bool GetLocalAABB(AABB &box) const override
|
||||
{
|
||||
Mesh *mesh=GetMesh();
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include<hgl/component/SceneComponent.h>
|
||||
#include<hgl/graph/AABB.h>
|
||||
@@ -18,13 +18,13 @@ public:
|
||||
|
||||
virtual ~PrimitiveComponent()=default;
|
||||
|
||||
virtual const bool GetBoundingBox(AABB &box) const =0;
|
||||
virtual const bool GetLocalAABB(AABB &box) const=0;
|
||||
|
||||
const bool GetBoundingBox(OBB &box)
|
||||
const bool GetWorldOBB(OBB &box)
|
||||
{
|
||||
AABB aabb;
|
||||
|
||||
if(!GetBoundingBox(aabb))
|
||||
if(!GetLocalAABB(aabb))
|
||||
return false;
|
||||
|
||||
box.Set(GetLocalToWorldMatrix(),aabb);
|
||||
|
Reference in New Issue
Block a user