53 target[1] = pv4[1] / uci->
camsize;
69 target[0] = (pv4[0] / uci->
camsize);
70 target[1] = (pv4[1] / uci->
camsize);
73 target[0] = (-pv4[0] * ((1.0f / uci->
camsize) / pv4[2])) / 2.0f;
74 target[1] = (-pv4[1] * ((1.0f / uci->
camsize) / pv4[2])) / 2.0f;
78 target[0] *= uci->
xasp;
79 target[1] *= uci->
yasp;
87 const float source[3],
88 const float persmat[4][4],
89 const float rotmat[4][4],
93 float pv4[4],
x = 0.0,
y = 0.0;
103 if (
fabsf(pv4[3]) > 0.00001f) {
104 target[0] = winx / 2.0f + (winx / 2.0f) * pv4[0] / pv4[3];
105 target[1] = winy / 2.0f + (winy / 2.0f) * pv4[1] / pv4[3];
109 target[0] = winx / 2.0f + (winx / 2.0f) * pv4[0];
110 target[1] = winy / 2.0f + (winy / 2.0f) * pv4[1];
115 y = (winx - winy) / 2.0f;
119 x = (winy - winx) / 2.0f;
123 target[0] = (
x + target[0]) / winx;
124 target[1] = (
y + target[1]) / winy;
128 const float rotmat[4][4],
160 uci.
yasp = winx / winy;
163 uci.
xasp = winy / winx;
185 const float source[3],
186 const float rotmat[4][4])
199 uci->
xasp *= scale_x;
200 uci->
yasp *= scale_y;
Object is a sort of wrapper for general info.
Read Blender memory allocation and freeing.
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
GREAL2 vec2d[2]
Double vector 2D.
void camera(KernelGlobals &kg, const ShadingData &sd, float3 &outview, float &outdepth, float &outdist)
void * MEM_new_uninitialized(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
MINLINE void copy_v3_v3(float r[3], const float a[3])
void BKE_uvproject_camera_info_scale(ProjCameraInfo *uci, float scale_x, float scale_y)
void mul_v3_m4v3(float r[3], const float mat[4][4], const float vec[3])
void BKE_uvproject_from_view(float target[2], const float source[3], const float persmat[4][4], const float rotmat[4][4], float winx, float winy)
void BKE_uvproject_from_camera(float target[2], const float source[3], const struct ProjCameraInfo *uci)
bool invert_m4(float mat[4][4])
void BKE_uvproject_camera_info_free(ProjCameraInfo *uci)
void normalize_m4(float R[4][4]) ATTR_NONNULL()
float focallength_to_fov(float focal_length, float sensor)
void BKE_uvproject_from_view_ortho(float target[2], const float source[3], const float rotmat[4][4])
void mul_m4_v4(const float mat[4][4], float r[4])
void copy_m4_m4(float m1[4][4], const float m2[4][4])
MINLINE float len_v2(const float v[2]) ATTR_WARN_UNUSED_RESULT
struct ProjCameraInfo * BKE_uvproject_camera_info(const struct Object *ob, const float rotmat[4][4], float winx, float winy)
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float