mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-27 07:03:36 -04:00
rplight: PSSMCameraRig::update() should accept cam node directly
Previously it would always use the first child of the given node (presumably expecting that `base.camera` is passed in), which is inconvenient when dealing with multiple cameras.
This commit is contained in:
parent
2ed61c91fc
commit
be03011f21
@ -369,8 +369,16 @@ void PSSMCameraRig::update(NodePath cam_node, const LVecBase3 &light_vector) {
|
||||
LMatrix4 transform = cam_node.get_transform()->get_mat();
|
||||
|
||||
// Get Camera and Lens pointers
|
||||
Camera* cam = DCAST(Camera, cam_node.get_child(0).node());
|
||||
nassertv(cam != nullptr);
|
||||
Camera *cam;
|
||||
PandaNode *node = cam_node.node();
|
||||
if (node->is_of_type(Camera::get_class_type())) {
|
||||
cam = (Camera *)node;
|
||||
}
|
||||
else {
|
||||
// Perhaps we passed in something like base.camera ?
|
||||
cam = DCAST(Camera, cam_node.get_child(0).node());
|
||||
nassertv(cam != nullptr);
|
||||
}
|
||||
Lens* lens = cam->get_lens();
|
||||
|
||||
// Extract near and far points:
|
||||
|
Loading…
x
Reference in New Issue
Block a user