25 const double trace = (double)(tfm[0][0] + tfm[1][1] + tfm[2][2]);
29 double s =
sqrt(trace + 1.0);
34 qt.
x = (
float)((
double)(tfm[2][1] - tfm[1][2]) * s);
35 qt.
y = (
float)((
double)(tfm[0][2] - tfm[2][0]) * s);
36 qt.
z = (
float)((
double)(tfm[1][0] - tfm[0][1]) * s);
41 if (tfm[1][1] > tfm[
i][
i]) {
44 if (tfm[2][2] > tfm[
i][
i]) {
48 const int j = (
i + 1) % 3;
49 const int k = (j + 1) % 3;
51 double s =
sqrt((
double)(tfm[
i][
i] - (tfm[j][j] + tfm[k][k])) + 1.0);
59 const double w = (double)(tfm[k][j] - tfm[j][k]) * s;
60 q[j] = (double)(tfm[j][
i] + tfm[
i][j]) * s;
61 q[k] = (double)(tfm[k][
i] + tfm[
i][k]) * s;
92 for (
int i = 0;
i < 3;
i++) {
93 for (
int j = 0; j < 4; j++) {
94 Rnext[
i][j] = 0.5f * (
R[
i][j] + Rit[
i][j]);
99 for (
int i = 0;
i < 3;
i++) {
107 }
while (iteration < 100 && norm > 1e-4f);
117 decomp->
y.
w = scale.x.x;
118 decomp->
z =
make_float4(scale.x.y, scale.x.z, scale.y.x, scale.y.y);
119 decomp->
w =
make_float4(scale.y.z, scale.z.x, scale.z.y, scale.z.z);
130 shear.
z =
dot(colx, coly);
131 coly -= shear.
z * colx;
134 shear.
y =
dot(colx, colz);
135 colz -= shear.
y * colx;
136 shear.
x =
dot(coly, colz);
137 colz -= shear.
x * coly;
152 decomp->
y.
w = scale.x;
163 for (
size_t i = 0;
i <
size;
i++) {
169 if (
dot(decomp[
i - 1].
x, decomp[
i].
x) < 0.0f) {
170 decomp[
i].
x = -decomp[
i].
x;
182 for (
size_t i = 0;
i <
size;
i++) {
189 decomp[
i].
x = decomp[
i - 1].
x;
191 else if (
i <
size - 1) {
192 decomp[
i].
x = decomp[
i + 1].
x;
200 1.0f / (viewplane.
top - viewplane.
bottom),
MINLINE float safe_divide(float a, float b)
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
SIMD_FORCE_INLINE btScalar norm() const
Return the norm (length) of the vector.
dot(value.rgb, luminance_coefficients)") DEFINE_VALUE("REDUCE(lhs
ccl_device_inline Transform projection_to_transform(const ProjectionTransform &a)
ccl_device_inline ProjectionTransform projection_transpose(const ProjectionTransform a)
#define CCL_NAMESPACE_END
ccl_device_inline bool is_zero(const float2 a)