Add optional azimuth and elevation to initial free camera.

- Add `azimuth` and `elevation` to `visual.global`.
- Add `mjv_defaultFreeCamera`.
- Use `mjv_defaultFreeCamera` in `simulate`.

PiperOrigin-RevId: 465505244
Change-Id: I61e60f14a990d4e2d220958adb75c325001978ee
This commit is contained in:
Yuval Tassa
2022-08-05 01:03:08 -07:00
committed by Copybara-Service
parent 5ee184ddaa
commit b966a37855
15 changed files with 92 additions and 19 deletions
+3 -8
View File
@@ -904,16 +904,11 @@ void makesections(mj::Simulate* sim) {
// align and scale view
void alignscale(mj::Simulate* sim) {
// autoscale
sim->cam.lookat[0] = sim->m->stat.center[0];
sim->cam.lookat[1] = sim->m->stat.center[1];
sim->cam.lookat[2] = sim->m->stat.center[2];
sim->cam.distance = 1.5 * sim->m->stat.extent;
// set to free camera
sim->cam.type = mjCAMERA_FREE;
// use default free camera parameters
mjv_defaultFreeCamera(sim->m, &sim->cam);
}
// copy qpos to clipboard as key
void copykey(mj::Simulate* sim) {
char clipboard[5000] = "<key qpos='";