| 28 | } |
| 29 | |
| 30 | void PanoramicCamera::commit() |
| 31 | { |
| 32 | Camera::commit(); |
| 33 | |
| 34 | getSh()->org = pos; |
| 35 | |
| 36 | if (getSh()->super.motionBlur) { |
| 37 | getSh()->frame.vz = -dir; |
| 38 | getSh()->frame.vy = up; |
| 39 | } else { |
| 40 | getSh()->frame.vz = -normalize(dir); |
| 41 | getSh()->frame.vx = normalize(cross(up, getSh()->frame.vz)); |
| 42 | getSh()->frame.vy = cross(getSh()->frame.vz, getSh()->frame.vx); |
| 43 | } |
| 44 | |
| 45 | getSh()->stereoMode = |
| 46 | (OSPStereoMode)getParam<uint32_t>("stereoMode", OSP_STEREO_NONE); |
| 47 | getSh()->ipd_offset = |
| 48 | 0.5f * getParam<float>("interpupillaryDistance", 0.0635f); |
| 49 | |
| 50 | // flip offset to have left eye at top (image coord origin at lower left) |
| 51 | if (getSh()->stereoMode == OSP_STEREO_TOP_BOTTOM) |
| 52 | getSh()->ipd_offset = -getSh()->ipd_offset; |
| 53 | } |
| 54 | |
| 55 | } // namespace ospray |