Refactor camera orthographic attribute to projection enum.

PiperOrigin-RevId: 847069028
Change-Id: I7f686fe654e9b56519cab8bd2f37c9cc40091d3f
This commit is contained in:
Yuval Tassa
2025-12-20 03:27:42 -08:00
committed by Copybara-Service
parent 44c8ef890d
commit b8a4ac5d48
20 changed files with 102 additions and 44 deletions
+6 -2
View File
@@ -538,6 +538,10 @@ typedef enum mjtGeom_ { // type of geometric shape
mjGEOM_NONE = 1001 // missing geom type
} mjtGeom;
typedef enum mjtProjection_ { // type of camera projection
mjPROJ_PERSPECTIVE = 0, // perspective
mjPROJ_ORTHOGRAPHIC // orthographic
} mjtProjection;
typedef enum mjtCamLight_ { // tracking mode for camera and light
mjCAMLIGHT_FIXED = 0, // pos and rot fixed in body
mjCAMLIGHT_TRACK, // pos tracks body, rot fixed in global
@@ -1223,7 +1227,7 @@ struct mjModel_ {
mjtNum* cam_poscom0; // global position rel. to sub-com in qpos0 (ncam x 3)
mjtNum* cam_pos0; // global position rel. to body in qpos0 (ncam x 3)
mjtNum* cam_mat0; // global orientation in qpos0 (ncam x 9)
int* cam_orthographic; // orthographic camera; 0: no, 1: yes (ncam x 1)
int* cam_projection; // projection type (mjtProjection) (ncam x 1)
mjtNum* cam_fovy; // y field-of-view (ortho ? len : deg) (ncam x 1)
mjtNum* cam_ipd; // inter-pupilary distance (ncam x 1)
int* cam_resolution; // resolution: pixels [width, height] (ncam x 2)
@@ -2102,7 +2106,7 @@ typedef struct mjsCamera_ { // camera specification
mjString* targetbody; // target body for tracking/targeting
// intrinsics
int orthographic; // is camera orthographic
mjtProjection proj; // camera projection type
double fovy; // y-field of view
double ipd; // inter-pupilary distance
float intrinsic[4]; // camera intrinsics (length)