本文整理汇总了C++中bl::RenderEngine::camera_shift_x方法的典型用法代码示例。如果您正苦于以下问题:C++ RenderEngine::camera_shift_x方法的具体用法?C++ RenderEngine::camera_shift_x怎么用?C++ RenderEngine::camera_shift_x使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bl::RenderEngine
的用法示例。
在下文中一共展示了RenderEngine::camera_shift_x方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: blender_camera_from_object
static void blender_camera_from_object(BlenderCamera *bcam,
BL::RenderEngine& b_engine,
BL::Object& b_ob,
bool skip_panorama = false)
{
BL::ID b_ob_data = b_ob.data();
if(b_ob_data.is_a(&RNA_Camera)) {
BL::Camera b_camera(b_ob_data);
PointerRNA ccamera = RNA_pointer_get(&b_camera.ptr, "cycles");
bcam->nearclip = b_camera.clip_start();
bcam->farclip = b_camera.clip_end();
switch(b_camera.type())
{
case BL::Camera::type_ORTHO:
bcam->type = CAMERA_ORTHOGRAPHIC;
break;
case BL::Camera::type_PANO:
if(!skip_panorama)
bcam->type = CAMERA_PANORAMA;
else
bcam->type = CAMERA_PERSPECTIVE;
break;
case BL::Camera::type_PERSP:
default:
bcam->type = CAMERA_PERSPECTIVE;
break;
}
switch(RNA_enum_get(&ccamera, "panorama_type"))
{
case 1:
bcam->panorama_type = PANORAMA_FISHEYE_EQUIDISTANT;
break;
case 2:
bcam->panorama_type = PANORAMA_FISHEYE_EQUISOLID;
break;
case 3:
bcam->panorama_type = PANORAMA_MIRRORBALL;
break;
case 0:
default:
bcam->panorama_type = PANORAMA_EQUIRECTANGULAR;
break;
}
bcam->fisheye_fov = RNA_float_get(&ccamera, "fisheye_fov");
bcam->fisheye_lens = RNA_float_get(&ccamera, "fisheye_lens");
bcam->latitude_min = RNA_float_get(&ccamera, "latitude_min");
bcam->latitude_max = RNA_float_get(&ccamera, "latitude_max");
bcam->longitude_min = RNA_float_get(&ccamera, "longitude_min");
bcam->longitude_max = RNA_float_get(&ccamera, "longitude_max");
bcam->ortho_scale = b_camera.ortho_scale();
bcam->lens = b_camera.lens();
/* allow f/stop number to change aperture_size but still
* give manual control over aperture radius */
int aperture_type = RNA_enum_get(&ccamera, "aperture_type");
if(aperture_type == 1) {
float fstop = RNA_float_get(&ccamera, "aperture_fstop");
fstop = max(fstop, 1e-5f);
if(bcam->type == CAMERA_ORTHOGRAPHIC)
bcam->aperturesize = 1.0f/(2.0f*fstop);
else
bcam->aperturesize = (bcam->lens*1e-3f)/(2.0f*fstop);
}
else
bcam->aperturesize = RNA_float_get(&ccamera, "aperture_size");
bcam->apertureblades = RNA_int_get(&ccamera, "aperture_blades");
bcam->aperturerotation = RNA_float_get(&ccamera, "aperture_rotation");
bcam->focaldistance = blender_camera_focal_distance(b_engine, b_ob, b_camera);
bcam->aperture_ratio = RNA_float_get(&ccamera, "aperture_ratio");
bcam->shift.x = b_engine.camera_shift_x(b_ob);
bcam->shift.y = b_camera.shift_y();
bcam->sensor_width = b_camera.sensor_width();
bcam->sensor_height = b_camera.sensor_height();
if(b_camera.sensor_fit() == BL::Camera::sensor_fit_AUTO)
bcam->sensor_fit = BlenderCamera::AUTO;
else if(b_camera.sensor_fit() == BL::Camera::sensor_fit_HORIZONTAL)
bcam->sensor_fit = BlenderCamera::HORIZONTAL;
else
bcam->sensor_fit = BlenderCamera::VERTICAL;
}
else {
/* from lamp not implemented yet */
}
}