62 for (
int i = 0; i < 4; i++) {
64 float pivotsize =
M[i][i];
67 pivotsize = -pivotsize;
69 for (
int j = i + 1; j < 4; j++) {
75 if (tmp > pivotsize) {
85 for (
int j = 0; j < 4; j++) {
89 M[i][j] =
M[pivot][j];
93 R[i][j] =
R[pivot][j];
98 for (
int j = i + 1; j < 4; j++) {
99 float f =
M[j][i] /
M[i][i];
101 for (
int k = 0; k < 4; k++) {
102 M[j][k] -= f *
M[i][k];
103 R[j][k] -= f *
R[i][k];
109 for (
int i = 3; i >= 0; --i) {
115 for (
int j = 0; j < 4; j++) {
120 for (
int j = 0; j < i; j++) {
123 for (
int k = 0; k < 4; k++) {
124 M[j][k] -= f *
M[i][k];
125 R[j][k] -= f *
R[i][k];
136 float M[4][4],
R[4][4];
138 memcpy(
R, &tfmR,
sizeof(
R));
139 memcpy(
M, &tfm,
sizeof(
M));
153 memcpy(&tfmR,
R,
sizeof(
R));
175 double trace = (
double)(tfm[0][0] + tfm[1][1] + tfm[2][2]);
179 double s =
sqrt(trace + 1.0);
181 qt.w = (
float)(s / 2.0);
184 qt.x = (
float)((
double)(tfm[2][1] - tfm[1][2]) * s);
185 qt.y = (
float)((
double)(tfm[0][2] - tfm[2][0]) * s);
186 qt.z = (
float)((
double)(tfm[1][0] - tfm[0][1]) * s);
191 if (tfm[1][1] > tfm[i][i])
193 if (tfm[2][2] > tfm[i][i])
199 double s =
sqrt((
double)(tfm[i][i] - (tfm[j][j] + tfm[k][k])) + 1.0);
206 double w = (
double)(tfm[k][j] - tfm[j][k]) * s;
207 q[j] = (
double)(tfm[j][i] + tfm[i][j]) * s;
208 q[k] = (
double)(tfm[k][i] + tfm[i][k]) * s;
239 for (
int i = 0; i < 3; i++)
240 for (
int j = 0; j < 4; j++)
241 Rnext[i][j] = 0.5f * (
R[i][j] + Rit[i][j]);
244 for (
int i = 0; i < 3; i++) {
246 fabsf(
R[i][0] - Rnext[i][0]) +
fabsf(
R[i][1] - Rnext[i][1]) +
247 fabsf(
R[i][2] - Rnext[i][2]));
252 }
while (iteration < 100 && norm > 1e-4f);
261 decomp->
y.w = scale.
x.x;
273 shear.
z =
dot(colx, coly);
274 coly -= shear.
z * colx;
277 shear.
y =
dot(colx, colz);
278 colz -= shear.
y * colx;
279 shear.
x =
dot(coly, colz);
280 colz -= shear.
x * coly;
295 decomp->
y.w = scale.
x;
304 for (
size_t i = 0; i <
size; i++) {
310 if (
dot(decomp[i - 1].
x, decomp[i].
x) < 0.0f)
311 decomp[i].
x = -decomp[i].
x;
322 for (
size_t i = 0; i <
size; i++) {
329 decomp[i].
x = decomp[i - 1].
x;
331 else if (i <
size - 1) {
332 decomp[i].
x = decomp[i + 1].
x;
340 1.0f / (viewplane.
top - viewplane.
bottom),
typedef float(TangentPoint)[2]
typedef double(DMatrix)[4][4]
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
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.
#define CCL_NAMESPACE_END
#define make_float4(x, y, z, w)
#define make_float3(x, y, z)
ccl_device_inline float dot(const float2 &a, const float2 &b)
ccl_device_inline bool is_zero(const float2 &a)
ccl_device_inline float3 safe_divide_float3_float(const float3 a, const float b)
ccl_device_inline Transform projection_to_transform(const ProjectionTransform &a)
ccl_device_inline ProjectionTransform projection_identity()
ccl_device_inline ProjectionTransform projection_transpose(const ProjectionTransform &a)