V3.8.2 pipeline (#16244)

This commit is contained in:
hyde zhou
2023-11-07 11:36:32 +08:00
committed by GitHub
parent daf1699b72
commit e2d0ec3658
54 changed files with 5412 additions and 1099 deletions
@@ -57,7 +57,8 @@ RenderObject genRenderObject(const scene::Model *model, const scene::Camera *cam
if (model->getNode()) {
const auto *node = model->getTransform();
cc::Vec3 position;
cc::Vec3::subtract(node->getWorldPosition(), camera->getPosition(), &position);
const auto *bounds = model->getWorldBounds();
Vec3::subtract(bounds ? bounds->center : node->getWorldPosition(), camera->getPosition(), &position);
depth = position.dot(camera->getForward());
}