Handle null camera and vis_option.
PiperOrigin-RevId: 865088406 Change-Id: I4a3bf7f6cb696de1461bc53fd5d77b941ea0c0c5
This commit is contained in:
committed by
Copybara-Service
parent
1bd72428f1
commit
0add985a15
@@ -91,6 +91,17 @@ void Renderer::Render(const mjModel* model, mjData* data,
|
||||
return;
|
||||
}
|
||||
|
||||
mjvCamera default_cam;
|
||||
if (camera == nullptr) {
|
||||
mjv_defaultCamera(&default_cam);
|
||||
camera = &default_cam;
|
||||
}
|
||||
mjvOption default_opt;
|
||||
if (vis_option == nullptr) {
|
||||
mjv_defaultOption(&default_opt);
|
||||
vis_option = &default_opt;
|
||||
}
|
||||
|
||||
mjv_updateScene(model, data, vis_option, perturb, camera, mjCAT_ALL,
|
||||
&scene_);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user