修正render_list没有被清空的问题
This commit is contained in:
parent
c5fc313091
commit
60ebcaefe0
@ -200,8 +200,26 @@ public:
|
|||||||
|
|
||||||
GetBoundingBox(scene->mRootNode,&scene_min,&scene_max);
|
GetBoundingBox(scene->mRootNode,&scene_min,&scene_max);
|
||||||
|
|
||||||
model_data->bounding_box.minPoint=pos_to_vec(scene_min);
|
float tmp;
|
||||||
model_data->bounding_box.maxPoint=pos_to_vec(scene_max);
|
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;
|
~AssimpLoaderMesh()=default;
|
||||||
|
@ -144,9 +144,6 @@ private:
|
|||||||
scale((i+1)/100.0f));
|
scale((i+1)/100.0f));
|
||||||
}
|
}
|
||||||
|
|
||||||
render_root.RefreshMatrix();
|
|
||||||
render_root.ExpendToList(&render_list);
|
|
||||||
|
|
||||||
return(true);
|
return(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -216,6 +213,7 @@ public:
|
|||||||
Matrix4f rot=rotate(GetDoubleTime()-start_time,camera.right_vector);
|
Matrix4f rot=rotate(GetDoubleTime()-start_time,camera.right_vector);
|
||||||
|
|
||||||
render_root.RefreshMatrix(&rot);
|
render_root.RefreshMatrix(&rot);
|
||||||
|
render_list.Clear();
|
||||||
render_root.ExpendToList(&render_list);
|
render_root.ExpendToList(&render_list);
|
||||||
|
|
||||||
BuildCommandBuffer();
|
BuildCommandBuffer();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user