diff options
Diffstat (limited to 'source/blender/collada/CameraExporter.cpp')
-rw-r--r-- | source/blender/collada/CameraExporter.cpp | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/source/blender/collada/CameraExporter.cpp b/source/blender/collada/CameraExporter.cpp index 8640e544dbf..ce46c681c8c 100644 --- a/source/blender/collada/CameraExporter.cpp +++ b/source/blender/collada/CameraExporter.cpp @@ -67,23 +67,29 @@ void CamerasExporter::operator()(Object *ob, Scene *sce) Camera *cam = (Camera*)ob->data; std::string cam_id(get_camera_id(ob)); std::string cam_name(id_name(cam)); - - if (cam->type == CAM_PERSP) { + + switch (cam->type) { + case CAM_PANO: + case CAM_PERSP: { COLLADASW::PerspectiveOptic persp(mSW); persp.setXFov(RAD2DEGF(focallength_to_fov(cam->lens, cam->sensor_x)), "xfov"); - persp.setAspectRatio((float)(sce->r.xsch)/(float)(sce->r.ysch),false,"aspect_ratio"); - persp.setZFar(cam->clipend, false , "zfar"); - persp.setZNear(cam->clipsta,false , "znear"); + persp.setAspectRatio((float)(sce->r.xsch)/(float)(sce->r.ysch), false, "aspect_ratio"); + persp.setZFar(cam->clipend, false, "zfar"); + persp.setZNear(cam->clipsta, false, "znear"); COLLADASW::Camera ccam(mSW, &persp, cam_id, cam_name); addCamera(ccam); + break; } - else { + case CAM_ORTHO: + default: + { COLLADASW::OrthographicOptic ortho(mSW); - ortho.setXMag(cam->ortho_scale,"xmag"); - ortho.setAspectRatio((float)(sce->r.xsch)/(float)(sce->r.ysch),false,"aspect_ratio"); - ortho.setZFar(cam->clipend , false , "zfar"); - ortho.setZNear(cam->clipsta, false , "znear"); + ortho.setXMag(cam->ortho_scale, "xmag"); + ortho.setAspectRatio((float)(sce->r.xsch)/(float)(sce->r.ysch), false, "aspect_ratio"); + ortho.setZFar(cam->clipend, false, "zfar"); + ortho.setZNear(cam->clipsta, false, "znear"); COLLADASW::Camera ccam(mSW, &ortho, cam_id, cam_name); addCamera(ccam); - } -} + break; + }} +} |