改进SceneNode绑定盒刷新

This commit is contained in:
hyzboy 2019-05-26 00:20:40 +08:00
parent 687e7669a9
commit 899eb4862e

View File

@ -38,19 +38,20 @@ namespace hgl
AABB local,world; AABB local,world;
for(int i=0;i<count;i++) (*sub)->RefreshBoundingBox();
local=(*sub)->GetLocalBoundingBox();
++sub;
for(int i=1;i<count;i++)
{ {
(*sub)->RefreshBoundingBox(); (*sub)->RefreshBoundingBox();
if(i==0) local.Enclose((*sub)->GetLocalBoundingBox());
local=(*sub)->GetLocalBoundingBox();
else
local.Enclose((*sub)->GetLocalBoundingBox());
sub++; ++sub;
} }
LocalBoundingBox=local;
} }