mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-29 08:15:18 -04:00
pgraph: Fix rare case of assertion in cull with ScissorEffect
Fixes #1344
This commit is contained in:
parent
e56c1a0a98
commit
fea66ea087
@ -114,6 +114,26 @@ get_node_path() const {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the transformed view frustum being used for culling at this level.
|
||||
*/
|
||||
INLINE GeometricBoundingVolume *CullTraverserData::
|
||||
get_view_frustum() const {
|
||||
return _view_frustum.p();
|
||||
}
|
||||
|
||||
/**
|
||||
* Changes the transformed view frustum being used for culling at this level.
|
||||
*/
|
||||
INLINE void CullTraverserData::
|
||||
set_view_frustum(PT(GeometricBoundingVolume) view_frustum) {
|
||||
if (_view_frustum == nullptr && view_frustum != nullptr && _cull_planes == nullptr) {
|
||||
// In this case we will need up-to-date bounds but we may not have them.
|
||||
_node_reader.check_cached(true);
|
||||
}
|
||||
_view_frustum = std::move(view_frustum);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the modelview transform: the relative transform from the camera to
|
||||
* the model.
|
||||
|
@ -65,6 +65,9 @@ public:
|
||||
|
||||
INLINE NodePath get_node_path() const;
|
||||
|
||||
INLINE GeometricBoundingVolume *get_view_frustum() const;
|
||||
INLINE void set_view_frustum(PT(GeometricBoundingVolume) view_frustum);
|
||||
|
||||
PUBLISHED:
|
||||
INLINE CPT(TransformState) get_modelview_transform(const CullTraverser *trav) const;
|
||||
INLINE CPT(TransformState) get_internal_transform(const CullTraverser *trav) const;
|
||||
@ -79,6 +82,7 @@ PUBLISHED:
|
||||
void apply_transform(const TransformState *node_transform);
|
||||
|
||||
MAKE_PROPERTY(node_path, get_node_path);
|
||||
MAKE_PROPERTY(view_frustum, get_view_frustum);
|
||||
|
||||
public:
|
||||
bool is_instance_in_view(const TransformState *instance_transform, const DrawMask &camera_mask) const;
|
||||
|
@ -278,7 +278,7 @@ cull_callback(CullTraverser *trav, CullTraverserData &data,
|
||||
PT(GeometricBoundingVolume) frustum = make_frustum(lens, frame);
|
||||
if (frustum != nullptr) {
|
||||
frustum->xform(modelview_transform->get_inverse()->get_mat());
|
||||
data._view_frustum = frustum;
|
||||
data.set_view_frustum(frustum);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user