move camera lens/angle conversion to BLI_math

This commit is contained in:
2010-04-17 08:55:31 +00:00
parent c00e7fb89d
commit 3afd8d6cc8
7 changed files with 17 additions and 21 deletions

View File

@@ -1503,3 +1503,13 @@ void copy_dq_dq(DualQuat *dq1, DualQuat *dq2)
memcpy(dq1, dq2, sizeof(DualQuat));
}
/* lense/angle conversion (radians) */
float lens_to_angle(float lens)
{
return 2.0f * atan(16.0f/lens);
}
float angle_to_lens(float angle)
{
return 16.0f / tan(angle * 0.5f);
}