fix for uv project modifier, broke when angle was removed.

This commit is contained in:
Campbell Barton
2010-04-16 15:19:55 +00:00
parent 7eb4eebe22
commit d3f69c8bce

View File

@@ -39,6 +39,9 @@ typedef struct UvCameraInfo {
short do_persp, do_pano, do_rotmat;
} UvCameraInfo;
/* ugly */
extern float camera_get_angle(struct Camera *cam);
void project_from_camera(float target[2], float source[3], UvCameraInfo *uci)
{
float pv4[4];
@@ -135,7 +138,7 @@ UvCameraInfo *project_camera_info(Object *ob, float (*rotmat)[4], float winx, fl
uci.do_pano = (camera->flag & CAM_PANORAMA);
uci.do_persp = (camera->type==CAM_PERSP);
uci.camangle= DEG2RAD(camera_get_angle(camera))/2.0f;
uci.camangle= camera_get_angle(camera)/2.0f;
uci.camsize= uci.do_persp ? uci.camsize= tanf(uci.camangle) : camera->ortho_scale;
if (invert_m4_m4(uci.caminv, ob->obmat)) {