mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-06 03:22:39 +08:00
fix null value read when model without bounding box
This commit is contained in:
@@ -19,11 +19,12 @@ export function cullDirectionalLight (light: DirectionalLight, model: Model) {
|
||||
}
|
||||
|
||||
export function cullSphereLight (light: SphereLight, model: Model) {
|
||||
return cullLight(light, model) || !intersect.aabb_aabb(model.worldBounds, light.aabb);
|
||||
return cullLight(light, model) || (model.worldBounds && !intersect.aabb_aabb(model.worldBounds, light.aabb));
|
||||
}
|
||||
|
||||
export function cullSpotLight (light: SpotLight, model: Model) {
|
||||
return cullLight(light, model) || !intersect.aabb_aabb(model.worldBounds, light.aabb) || !intersect.aabb_frustum(model.worldBounds, light.frustum);
|
||||
return cullLight(light, model) || (model.worldBounds &&
|
||||
(!intersect.aabb_aabb(model.worldBounds, light.aabb) || !intersect.aabb_frustum(model.worldBounds, light.frustum)));
|
||||
}
|
||||
|
||||
export const cullSceneWithDirectionalLight = (() => {
|
||||
|
||||
Reference in New Issue
Block a user