修正render_list没有被清空的问题

This commit is contained in:
hyzboy 2019-06-11 19:56:01 +08:00
parent c5fc313091
commit 60ebcaefe0
2 changed files with 21 additions and 5 deletions

View File

@ -200,8 +200,26 @@ public:
GetBoundingBox(scene->mRootNode,&scene_min,&scene_max);
model_data->bounding_box.minPoint=pos_to_vec(scene_min);
model_data->bounding_box.maxPoint=pos_to_vec(scene_max);
float tmp;
vec smin=pos_to_vec(scene_min);
vec smax=pos_to_vec(scene_max);
if(smin.y>smax.y)
{
tmp=smin.y;
smin.y=smax.y;
smax.y=tmp;
}
if(smin.z>smax.z)
{
tmp=smin.z;
smin.z=smax.z;
smax.z=tmp;
}
model_data->bounding_box.minPoint=smin;
model_data->bounding_box.maxPoint=smax;
}
~AssimpLoaderMesh()=default;

View File

@ -144,9 +144,6 @@ private:
scale((i+1)/100.0f));
}
render_root.RefreshMatrix();
render_root.ExpendToList(&render_list);
return(true);
}
@ -216,6 +213,7 @@ public:
Matrix4f rot=rotate(GetDoubleTime()-start_time,camera.right_vector);
render_root.RefreshMatrix(&rot);
render_list.Clear();
render_root.ExpendToList(&render_list);
BuildCommandBuffer();