10 #ifdef IMPLICIT_SOLVER_BLENDER
30 # pragma GCC diagnostic ignored "-Wtype-limits"
34 # define CLOTH_OPENMP_LIMIT 512
43 static float I[3][3] = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}};
44 static float ZERO[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}};
49 # defineDO_INLINE inline
51 # defineDO_INLINE static
79 to[0] =
from[0] * scalar;
80 to[1] =
from[1] * scalar;
81 to[2] =
from[2] * scalar;
104 static void print_fvector(
float m3[3])
106 printf(
"%f\n%f\n%f\n\n", m3[0], m3[1], m3[2]);
113 DO_INLINE void print_lfvector(
float (*fLongVector)[3],
unsigned int verts)
116 for (i = 0; i <
verts; i++) {
117 print_fvector(fLongVector[i]);
132 if (fLongVector !=
NULL) {
146 for (i = 0; i <
verts; i++) {
157 float (*fLongVector)[3],
163 for (i = 0; i <
verts; i++) {
170 float (*fLongVector)[3],
175 for (i = 0; i <
verts; i++) {
176 VECSUBMUL(to[i], fLongVector[i], scalar);
181 float (*fLongVectorB)[3],
191 for (i = 0; i < (long)
verts; i++) {
192 temp +=
dot_v3v3(fLongVectorA[i], fLongVectorB[i]);
198 float (*fLongVectorA)[3],
199 float (*fLongVectorB)[3],
204 for (i = 0; i <
verts; i++) {
205 add_v3_v3v3(to[i], fLongVectorA[i], fLongVectorB[i]);
210 float (*fLongVectorA)[3],
211 float (*fLongVectorB)[3],
217 for (i = 0; i <
verts; i++) {
218 VECADDS(to[i], fLongVectorA[i], fLongVectorB[i], bS);
223 float (*fLongVectorA)[3],
225 float (*fLongVectorB)[3],
231 for (i = 0; i <
verts; i++) {
232 VECADDSS(to[i], fLongVectorA[i], aS, fLongVectorB[i], bS);
237 float (*fLongVectorA)[3],
238 float (*fLongVectorB)[3],
243 for (i = 0; i <
verts; i++) {
244 VECSUBS(to[i], fLongVectorA[i], fLongVectorB[i], bS);
249 float (*fLongVectorA)[3],
250 float (*fLongVectorB)[3],
255 for (i = 0; i <
verts; i++) {
256 sub_v3_v3v3(to[i], fLongVectorA[i], fLongVectorB[i]);
264 static void print_fmatrix(
float m3[3][3])
266 printf(
"%f\t%f\t%f\n", m3[0][0], m3[0][1], m3[0][2]);
267 printf(
"%f\t%f\t%f\n", m3[1][0], m3[1][1], m3[1][2]);
268 printf(
"%f\t%f\t%f\n\n", m3[2][0], m3[2][1], m3[2][2]);
271 static void print_sparse_matrix(
fmatrix3x3 *m)
277 print_fmatrix(m[i].m);
287 for (i = 0; i < numverts; i++) {
292 printf(
"%f,\n",
v[i][0]);
293 printf(
"%f,\n",
v[i][1]);
294 printf(
"%f,\n",
v[i][2]);
307 for (q = 0; q < tot; q++) {
311 for (j = 0; j < 3; j++) {
312 for (i = 0; i < 3; i++) {
314 if (
t[k + i + (
l + j) *
size] != 0.0f) {
315 printf(
"warning: overwriting value at %d, %d\n", m[q].
r, m[q].
c);
319 t[k + i + (k + j) *
size] += m[q].m[i][j];
322 t[k + i + (
l + j) *
size] += m[q].m[i][j];
323 t[
l + j + (k + i) *
size] += m[q].m[j][i];
329 for (j = 0; j <
size; j++) {
330 if (j > 0 && j % 3 == 0) {
334 for (i = 0; i <
size; i++) {
335 if (i > 0 && i % 3 == 0) {
369 DO_INLINE float det_fmatrix(
float m[3][3])
371 return m[0][0] * m[1][1] * m[2][2] + m[1][0] * m[2][1] * m[0][2] + m[0][1] * m[1][2] * m[2][0] -
372 m[0][0] * m[1][2] * m[2][1] - m[0][1] * m[1][0] * m[2][2] - m[2][0] * m[1][1] * m[0][2];
375 DO_INLINE void inverse_fmatrix(
float to[3][3],
float from[3][3])
380 if ((d = det_fmatrix(
from)) == 0) {
381 printf(
"can't build inverse");
384 for (i = 0; i < 3; i++) {
385 for (j = 0; j < 3; j++) {
386 int i1 = (i + 1) % 3;
387 int i2 = (i + 2) % 3;
388 int j1 = (j + 1) % 3;
389 int j2 = (j + 2) % 3;
420 to[0] = matrix[0][0] *
from[0] + matrix[1][0] *
from[1] + matrix[2][0] *
from[2];
421 to[1] = matrix[0][1] *
from[0] + matrix[1][1] *
from[1] + matrix[2][1] *
from[2];
422 to[2] = matrix[0][2] *
from[0] + matrix[1][2] *
from[1] + matrix[2][2] *
from[2];
435 const float matrixA[3][3],
436 const float matrixB[3][3])
444 float to[3][3],
const float matrixA[3][3],
float aS,
const float matrixB[3][3],
float bS)
446 VECSUBADDSS(to[0], matrixA[0], aS, matrixB[0], bS);
447 VECSUBADDSS(to[1], matrixA[1], aS, matrixB[1], bS);
448 VECSUBADDSS(to[2], matrixA[2], aS, matrixB[2], bS);
452 const float matrixA[3][3],
453 const float matrixB[3][3])
473 to[0] += matrix[0][0] *
from[0] + matrix[1][0] *
from[1] + matrix[2][0] *
from[2];
474 to[1] += matrix[0][1] *
from[0] + matrix[1][1] *
from[1] + matrix[2][1] *
from[2];
475 to[2] += matrix[0][2] *
from[0] + matrix[1][2] *
from[1] + matrix[2][2] *
from[2];
507 r[0][0] += m[0][0] * f;
508 r[0][1] += m[0][1] * f;
509 r[0][2] += m[0][2] * f;
510 r[1][0] += m[1][0] * f;
511 r[1][1] += m[1][1] * f;
512 r[1][2] += m[1][2] * f;
513 r[2][0] += m[2][0] * f;
514 r[2][1] += m[2][1] * f;
515 r[2][2] += m[2][2] * f;
530 print_fmatrix(m3[i].m);
546 "cloth_implicit_alloc_matrix");
553 for (i = 0; i <
verts; i++) {
562 if (matrix !=
NULL) {
580 for (i = 0; i < matrix[0].
vcount + matrix[0].
scount; i++) {
590 float tmatrix[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}};
592 for (i = 0; i < matrix[0].
vcount; i++) {
595 for (j = matrix[0].vcount; j < matrix[0].
vcount + matrix[0].
scount; j++) {
604 unsigned int vcount =
from[0].vcount;
609 # pragma omp parallel sections if (vcount > CLOTH_OPENMP_LIMIT)
613 for (
unsigned int i =
from[0].vcount; i <
from[0].vcount +
from[0].scount; i++) {
621 for (
unsigned int i = 0; i <
from[0].vcount +
from[0].scount; i++) {
640 for (i = 0; i < matrix[0].
vcount + matrix[0].
scount; i++) {
762 for (i = 0; i < S[0].
vcount; i++) {
773 unsigned int conjgrad_loopcount = 0, conjgrad_looplimit = 100;
774 float conjgrad_epsilon = 0.0001f ;
776 float s, starget,
a, s_prev;
777 unsigned int numverts = lA[0].
vcount;
798 starget = s *
sqrtf(conjgrad_epsilon);
800 while (s > starget && conjgrad_loopcount < conjgrad_looplimit) {
822 conjgrad_loopcount++;
832 return conjgrad_loopcount <
845 unsigned int conjgrad_loopcount = 0, conjgrad_looplimit = 100;
846 float conjgrad_epsilon = 0.01f;
848 unsigned int numverts = lA[0].
vcount;
855 float bnorm2, delta_new, delta_old, delta_target, alpha;
863 delta_target = conjgrad_epsilon * conjgrad_epsilon * bnorm2;
877 # ifdef IMPLICIT_PRINT_SOLVER_INPUT_OUTPUT
878 printf(
"==== A ====\n");
880 printf(
"==== z ====\n");
882 printf(
"==== B ====\n");
884 printf(
"==== S ====\n");
888 while (delta_new > delta_target && conjgrad_loopcount < conjgrad_looplimit) {
900 delta_old = delta_new;
906 conjgrad_loopcount++;
909 # ifdef IMPLICIT_PRINT_SOLVER_INPUT_OUTPUT
910 printf(
"==== dV ====\n");
912 printf(
"========\n");
925 result->iterations = conjgrad_loopcount;
926 result->error = bnorm2 > 0.0f ?
sqrtf(delta_new / bnorm2) : 0.0f;
928 return conjgrad_loopcount <
940 for (i = 0; i < lA[0].
vcount; i++) {
943 inverse_fmatrix(Pinv[i].m,
P[i].m);
949 static int cg_filtered_pre(
lfVector *dv,
957 unsigned int numverts = lA[0].
vcount, iterations = 0, conjgrad_looplimit = 100;
958 float delta0 = 0, deltaNew = 0, deltaOld = 0, alpha = 0;
959 float conjgrad_epsilon = 0.0001;
965 BuildPPinv(lA,
P, Pinv);
974 mul_prevfmatrix_lfvector(p, Pinv,
r);
979 delta0 = deltaNew *
sqrt(conjgrad_epsilon);
985 while ((deltaNew > delta0) && (iterations < conjgrad_looplimit)) {
997 mul_prevfmatrix_lfvector(h, Pinv,
r);
1000 deltaOld = deltaNew;
1011 printf(
"cg_filtered_pre time: %f\n", (
float)(end - start));
1019 printf(
"iterations: %d\n", iterations);
1021 return iterations < conjgrad_looplimit;
1026 static int cg_filtered_pre(
lfVector *dv,
1035 unsigned int numverts = lA[0].
vcount, iterations = 0, conjgrad_looplimit = 100;
1036 float delta0 = 0, deltaNew = 0, deltaOld = 0, alpha = 0, tol = 0;
1044 BuildPPinv(lA,
P, Pinv);
1047 sub_bfmatrix_Smatrix(bigI, bigI, S);
1064 mul_prevfmatrix_lfvector(p, Pinv,
r);
1068 mul_prevfmatrix_lfvector(btemp, Pinv, bhat);
1082 mul_prevfmatrix_lfvector(p, Pinv,
r);
1087 delta0 = deltaNew *
sqrt(conjgrad_epsilon);
1096 while ((deltaNew > delta0 * tol * tol) && (iterations < conjgrad_looplimit)) {
1108 mul_prevfmatrix_lfvector(h, Pinv,
r);
1111 deltaOld = deltaNew;
1122 printf(
"cg_filtered_pre time: %f\n", (
float)(end - start));
1134 return iterations < conjgrad_looplimit;
1140 unsigned int numverts =
data->dFdV[0].vcount;
1164 printf(
"cg_filtered calc time: %f\n", (
float)(end - start));
1177 int numverts =
data->M[0].vcount;
1187 int numverts =
data->M[0].vcount;
1200 # ifdef CLOTH_ROOT_FRAME
1274 int s =
data->M[0].vcount +
data->num_blocks;
1292 int i, numverts =
data->S[0].vcount;
1293 for (i = 0; i < numverts; i++) {
1307 Implicit_Data *
data,
int index,
const float c1[3],
const float c2[3],
const float dV[3])
1309 float m[3][3], p[3], q[3], u[3], cmat[3][3];
1332 float m[3][3], p[3], u[3], cmat[3][3];
1347 int numverts =
data->M[0].vcount;
1352 data->num_blocks = 0;
1357 const float acceleration[3],
1358 const float omega[3],
1359 const float domega_dt[3],
1362 # ifdef CLOTH_ROOT_FRAME
1363 float acc[3],
w[3], dwdt[3];
1364 float f[3], dfdx[3][3], dfdv[3][3];
1365 float euler[3], coriolis[3], centrifugal[3], rotvel[3];
1366 float deuler[3][3], dcoriolis[3][3], dcentrifugal[3][3], drotvel[3][3];
1422 int i, numverts =
data->M[0].vcount;
1423 for (i = 0; i < numverts; i++) {
1436 struct Implicit_Data *
data,
int i,
const float f[3],
float dfdx[3][3],
float dfdv[3][3])
1438 float tf[3], tdfdx[3][3], tdfdv[3][3];
1468 const float effector_scale = 0.02f;
1469 const int vs[3] = {
v1,
v2, v3};
1471 float factor, base_force;
1477 factor = effector_scale *
area / 3.0f;
1480 for (
int i = 0; i < 3; i++) {
1497 base_force = force[0] + force[1] + force[2];
1508 const float effector_scale = 0.02f;
1509 const int vs[3] = {
v1,
v2, v3};
1511 float factor, base_force[3];
1517 factor = effector_scale *
area / 3.0f;
1522 for (
int i = 0; i < 3; i++) {
1530 for (
int i = 0; i < 3; i++) {
1553 float common_pressure,
1554 const float *vertex_pressure,
1555 const float weights[3])
1558 float factor, base_force;
1564 factor =
area / 3.0f;
1565 base_force = common_pressure * factor;
1576 if (vertex_pressure) {
1577 copy_v3_fl3(force, vertex_pressure[
v1], vertex_pressure[
v2], vertex_pressure[v3]);
1580 base_force += force[0] + force[1] + force[2];
1595 const float wind[3],
1597 float UNUSED(dfdx[3][3]),
1598 float UNUSED(dfdv[3][3]))
1601 float cos_alpha, sin_alpha, cross_section;
1602 float windlen =
len_v3(wind);
1604 if (windlen == 0.0f) {
1610 cos_alpha =
dot_v3v3(wind, dir) / windlen;
1611 sin_alpha =
sqrtf(1.0f - cos_alpha * cos_alpha);
1612 cross_section = radius * ((
float)
M_PI * radius * sin_alpha +
length * cos_alpha);
1620 float win[3], dir[3],
length;
1621 float f[3], dfdx[3][3], dfdv[3][3];
1638 const float (*winvec)[3])
1691 float xxxx = xxx *
x;
1692 return (-11.541f * xxxx + 34.193f * xxx - 39.083f * xx + 23.116f *
x - 9.713f);
1700 return (-46.164f * xxx + 102.579f * xx - 78.166f *
x + 23.116f);
1706 float fbstar_fl = cb * (
length -
L);
1708 if (tempfb_fl < fbstar_fl) {
1719 float fbstar_fl = cb * (
length -
L);
1721 if (tempfb_fl < fbstar_fl) {
1739 *r_length =
len_v3(r_extent);
1744 if ((clmd->sim_parms->flags & CSIMSETT_FLAG_TEARING_ENABLED) &&
1745 (((
length -
L) * 100.0f /
L) > clmd->sim_parms->maxspringlen)) {
1747 s->flags |= CSPRING_FLAG_DEACTIVATE;
1765 const float dfdx[3][3],
1766 const float dfdv[3][3])
1786 float stiffness_tension,
1787 float damping_tension,
1788 float stiffness_compression,
1789 float damping_compression,
1790 bool resist_compress,
1794 float extent[3],
length, dir[3], vel[3];
1795 float f[3], dfdx[3][3], dfdv[3][3];
1804 if ((
length >= restlen &&
length > 0) || resist_compress) {
1805 float stretch_force;
1807 damping = damping_tension;
1809 stretch_force = stiffness_tension * (
length - restlen);
1810 if (clamp_force > 0.0f && stretch_force > clamp_force) {
1811 stretch_force = clamp_force;
1817 else if (new_compress) {
1820 float kb = stiffness_compression;
1823 damping = damping_compression;
1847 float extent[3],
length, dir[3], vel[3];
1853 float f[3], dfdx[3][3], dfdv[3][3];
1877 for (
int i = 0; i <
len; i++) {
1893 r_avg[0] = (
data[i][0] +
data[j][0]) * 0.5f;
1894 r_avg[1] = (
data[i][1] +
data[j][1]) * 0.5f;
1895 r_avg[2] = (
data[i][2] +
data[j][2]) * 0.5f;
1930 float dir_e[3], vel_e[3];
1937 *r_angle =
bend_angle(r_dir_a, r_dir_b, dir_e);
1959 float angle, dir_a[3], dir_b[3], vel_a[3], vel_b[3];
1960 float f_a[3], f_b[3], f_e[3];
1964 spring_angle(
data, i, j, i_a, i_b, len_a, len_b, dir_a, dir_b, &
angle, vel_a, vel_b);
1967 force = stiffness * (
angle - restang);
1975 for (
x = 0;
x < len_a;
x++) {
1979 for (
x = 0;
x < len_b;
x++) {
2001 Implicit_Data *
data,
int i,
int j,
float edge[3],
float dir[3],
float grad_dir[3][3])
2022 const float goal[3],
2030 float edge_ij[3], dir_ij[3];
2031 float edge_jk[3], dir_jk[3];
2032 float vel_ij[3], vel_jk[3], vel_ortho[3];
2033 float f_bend[3], f_damp[3];
2093 const float goal[3],
2099 const float delta = 0.00001f;
2100 float dvec_null[3][3], dvec_pos[3][3], dvec_neg[3][3];
2112 for (
a = 0;
a < 3;
a++) {
2114 data, i, j, k, goal, stiffness, damping, q, dvec_pos[
a], dvec_null[
a], f);
2118 data, i, j, k, goal, stiffness, damping, q, dvec_neg[
a], dvec_null[
a], f);
2121 for (
b = 0;
b < 3;
b++) {
2122 dfdx[
a][
b] /= delta;
2132 const float goal[3],
2138 const float delta = 0.00001f;
2139 float dvec_null[3][3], dvec_pos[3][3], dvec_neg[3][3];
2151 for (
a = 0;
a < 3;
a++) {
2153 data, i, j, k, goal, stiffness, damping, q, dvec_null[
a], dvec_pos[
a], f);
2157 data, i, j, k, goal, stiffness, damping, q, dvec_null[
a], dvec_neg[
a], f);
2160 for (
b = 0;
b < 3;
b++) {
2161 dfdv[
a][
b] /= delta;
2170 const float target[3],
2179 float dfj_dxi[3][3], dfj_dxj[3][3], dfk_dxi[3][3], dfk_dxj[3][3], dfk_dxk[3][3];
2180 float dfj_dvi[3][3], dfj_dvj[3][3], dfk_dvi[3][3], dfk_dvj[3][3], dfk_dvk[3][3];
2182 const float vecnull[3] = {0.0f, 0.0f, 0.0f};
2190 spring_hairbend_forces(
data, i, j, k, goal, stiffness, damping, k, vecnull, vecnull, fk);
2233 float edge_ij[3], dir_ij[3], grad_dir_ij[3][3];
2234 float edge_jk[3], dir_jk[3], grad_dir_jk[3][3];
2235 float dist[3], vel_jk[3], vel_jk_ortho[3], projvel[3];
2238 float fi[3], fj[3], fk[3];
2239 float dfi_dxi[3][3], dfj_dxi[3][3], dfj_dxj[3][3], dfk_dxi[3][3], dfk_dxj[3][3], dfk_dxk[3][3];
2281 madd_m3_m3fl(dfk_dxi, grad_dir_ij, stiffness * restlen);
2283 madd_m3_m3fl(dfk_dxj, grad_dir_ij, -stiffness * restlen);
2320 const float goal_x[3],
2321 const float goal_v[3],
2325 float root_goal_x[3], root_goal_v[3], extent[3],
length, dir[3], vel[3];
2326 float f[3], dfdx[3][3], dfdv[3][3];
typedef float(TangentPoint)[2]
#define VECADDS(v1, v2, v3, bS)
#define VECSUBS(v1, v2, v3, bS)
#define VECADDSS(v1, v2, aS, v3, bS)
#define VECSUBADDSS(v1, v2, aS, v3, bS)
#define VECSUBMUL(v1, v2, aS)
float volume_tri_tetrahedron_signed_v3_6x(const float v1[3], const float v2[3], const float v3[3])
float normal_tri_v3(float n[3], const float v1[3], const float v2[3], const float v3[3])
void sub_m3_m3m3(float R[3][3], const float A[3][3], const float B[3][3])
void negate_m3(float R[3][3])
void mul_m3_v3(const float M[3][3], float r[3])
void copy_m3_m3(float m1[3][3], const float m2[3][3])
void unit_m3(float m[3][3])
void mul_m3_fl(float R[3][3], float f)
void add_m3_m3m3(float R[3][3], const float A[3][3], const float B[3][3])
void zero_m3(float m[3][3])
void mul_v3_m3v3(float r[3], const float M[3][3], const float a[3])
void transpose_m3(float R[3][3])
void mul_transposed_m3_v3(const float M[3][3], float r[3])
void mul_m3_m3m3(float R[3][3], const float A[3][3], const float B[3][3])
MINLINE void madd_v3_v3fl(float r[3], const float a[3], float f)
MINLINE float normalize_v3(float r[3])
MINLINE void sub_v3_v3(float r[3], const float a[3])
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void negate_v3_v3(float r[3], const float a[3])
MINLINE void copy_v3_fl3(float v[3], float x, float y, float z)
MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void add_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void cross_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE float normalize_v3_v3(float r[3], const float a[3])
MINLINE void madd_v3_v3v3fl(float r[3], const float a[3], const float b[3], float f)
MINLINE void zero_v3(float r[3])
MINLINE void mul_v3_v3fl(float r[3], const float a[3], float f)
MINLINE void add_v3_v3(float r[3], const float a[3])
MINLINE float len_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT
Object is a sort of wrapper for general info.
_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 GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble z
_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 GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble GLdouble r _GL_VOID_RET _GL_VOID GLfloat GLfloat r _GL_VOID_RET _GL_VOID GLint GLint r _GL_VOID_RET _GL_VOID GLshort GLshort r _GL_VOID_RET _GL_VOID GLdouble GLdouble r
_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 GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint i1
_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 GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble t
_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 GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble v1
Read Guarded memory(de)allocation.
Platform independent time functions.
@ SIM_SOLVER_NO_CONVERGENCE
ATTR_WARN_UNUSED_RESULT const BMVert * v2
ATTR_WARN_UNUSED_RESULT const BMLoop * l
ATTR_WARN_UNUSED_RESULT const BMVert * v
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
SyclQueue void void size_t num_bytes void
BLI_INLINE void print_lvector(const lVector3f &v)
BLI_INLINE void implicit_print_matrix_elem(float v)
void SIM_mass_spring_force_gravity(Implicit_Data *data, int index, float mass, const float g[3])
void SIM_mass_spring_set_vertex_mass(Implicit_Data *data, int index, float mass)
void SIM_mass_spring_clear_forces(Implicit_Data *data)
BLI_INLINE void apply_spring(Implicit_Data *data, int i, int j, const float f[3], const float dfdx[3][3], const float dfdv[3][3])
DO_INLINE void add_lfvector_lfvector(float(*to)[3], float(*fLongVectorA)[3], float(*fLongVectorB)[3], unsigned int verts)
void SIM_mass_spring_clear_constraints(Implicit_Data *data)
BLI_INLINE float fbstar_jacobi(float length, float L, float kb, float cb)
void SIM_mass_spring_force_pressure(Implicit_Data *data, int v1, int v2, int v3, float common_pressure, const float *vertex_pressure, const float weights[3])
DO_INLINE void add_lfvector_lfvectorS(float(*to)[3], float(*fLongVectorA)[3], float(*fLongVectorB)[3], float bS, unsigned int verts)
DO_INLINE void add_fmatrix_fmatrix(float to[3][3], const float matrixA[3][3], const float matrixB[3][3])
void SIM_mass_spring_add_constraint_ndof0(Implicit_Data *data, int index, const float dV[3])
static void edge_wind_vertex(const float dir[3], float length, float radius, const float wind[3], float f[3], float UNUSED(dfdx[3][3]), float UNUSED(dfdv[3][3]))
DO_INLINE void mul_fvectorT_fvector(float to[3][3], const float vectorA[3], const float vectorB[3])
void SIM_mass_spring_get_motion_state(struct Implicit_Data *data, int index, float x[3], float v[3])
DO_INLINE void del_lfvector(float(*fLongVector)[3])
BLI_INLINE void cross_m3_v3m3(float r[3][3], const float v[3], const float m[3][3])
bool SIM_mass_spring_force_spring_bending_hair(Implicit_Data *data, int i, int j, int k, const float target[3], float stiffness, float damping)
BLI_INLINE float fb(float length, float L)
struct fmatrix3x3 fmatrix3x3
void SIM_mass_spring_set_velocity(Implicit_Data *data, int index, const float v[3])
DO_INLINE lfVector * create_lfvector(unsigned int verts)
DO_INLINE void mul_fvectorT_fvectorS(float to[3][3], float vectorA[3], float vectorB[3], float aS)
DO_INLINE void mul_fmatrix_S(float matrix[3][3], float scalar)
bool SIM_mass_spring_solve_positions(Implicit_Data *data, float dt)
DO_INLINE void initdiag_fmatrixS(float to[3][3], float aS)
Implicit_Data * SIM_mass_spring_solver_create(int numverts, int numsprings)
void SIM_mass_spring_set_new_velocity(struct Implicit_Data *data, int index, const float v[3])
BLI_INLINE float fbderiv(float length, float L)
BLI_INLINE void madd_m3_m3fl(float r[3][3], const float m[3][3], float f)
DO_INLINE void mul_lfvectorS(float(*to)[3], float(*fLongVector)[3], float scalar, unsigned int verts)
DO_INLINE void filter(lfVector *V, fmatrix3x3 *S)
DO_INLINE void muladd_fmatrix_fvector(float to[3], const float matrix[3][3], const float from[3])
DO_INLINE void zero_lfvector(float(*to)[3], unsigned int verts)
DO_INLINE void mul_bfmatrix_lfvector(float(*to)[3], fmatrix3x3 *from, lfVector *fLongVector)
BLI_INLINE void spring_hairbend_forces(Implicit_Data *data, int i, int j, int k, const float goal[3], float stiffness, float damping, int q, const float dx[3], const float dv[3], float r_f[3])
float SIM_tri_area(struct Implicit_Data *data, int v1, int v2, int v3)
bool SIM_mass_spring_force_spring_goal(Implicit_Data *data, int i, const float goal_x[3], const float goal_v[3], float stiffness, float damping)
void SIM_mass_spring_force_face_extern(Implicit_Data *data, int v1, int v2, int v3, const float(*forcevec)[3])
DO_INLINE void muladd_fmatrixT_fvector(float to[3], const float matrix[3][3], const float from[3])
bool SIM_mass_spring_solve_velocities(Implicit_Data *data, float dt, ImplicitSolverResult *result)
DO_INLINE void mul_fvector_fmatrix(float *to, const float *from, const float matrix[3][3])
void SIM_mass_spring_get_velocity(struct Implicit_Data *data, int index, float v[3])
BLI_INLINE void init_fmatrix(fmatrix3x3 *matrix, int r, int c)
void SIM_mass_spring_add_constraint_ndof2(Implicit_Data *data, int index, const float c1[3], const float dV[3])
BLI_INLINE bool spring_length(Implicit_Data *data, int i, int j, float r_extent[3], float r_dir[3], float *r_length, float r_vel[3])
void SIM_mass_spring_get_new_position(struct Implicit_Data *data, int index, float x[3])
static int SIM_mass_spring_add_block(Implicit_Data *data, int v1, int v2)
BLI_INLINE void edge_avg(lfVector *data, int i, int j, float r_avg[3])
void SIM_mass_spring_force_drag(Implicit_Data *data, float drag)
DO_INLINE fmatrix3x3 * create_bfmatrix(unsigned int verts, unsigned int springs)
DO_INLINE void subadd_fmatrixS_fmatrixS(float to[3][3], const float matrixA[3][3], float aS, const float matrixB[3][3], float bS)
BLI_INLINE void root_to_world_m3(Implicit_Data *data, int index, float r[3][3], const float m[3][3])
void SIM_mass_spring_solver_free(Implicit_Data *id)
BLI_INLINE void cross_v3_identity(float r[3][3], const float v[3])
DO_INLINE void init_lfvector(float(*fLongVector)[3], const float vector[3], unsigned int verts)
DO_INLINE void mul_fmatrix_fvector(float *to, const float matrix[3][3], const float from[3])
bool SIM_mass_spring_force_spring_linear(Implicit_Data *data, int i, int j, float restlen, float stiffness_tension, float damping_tension, float stiffness_compression, float damping_compression, bool resist_compress, bool new_compress, float clamp_force)
BLI_INLINE void outerproduct(float r[3][3], const float a[3], const float b[3])
bool SIM_mass_spring_force_spring_bending(Implicit_Data *data, int i, int j, float restlen, float kb, float cb)
DO_INLINE void mul_fvector_S(float to[3], const float from[3], float scalar)
DO_INLINE float dot_lfvector(float(*fLongVectorA)[3], float(*fLongVectorB)[3], unsigned int verts)
void SIM_mass_spring_set_motion_state(Implicit_Data *data, int index, const float x[3], const float v[3])
void SIM_mass_spring_set_position(Implicit_Data *data, int index, const float x[3])
DO_INLINE void sub_fmatrix_fmatrix(float to[3][3], const float matrixA[3][3], const float matrixB[3][3])
struct Implicit_Data Implicit_Data
DO_INLINE void add_lfvectorS_lfvectorS(float(*to)[3], float(*fLongVectorA)[3], float aS, float(*fLongVectorB)[3], float bS, unsigned int verts)
BLI_INLINE void dfdx_spring(float to[3][3], const float dir[3], float length, float L, float k)
void SIM_mass_spring_set_rest_transform(Implicit_Data *data, int index, float tfm[3][3])
void SIM_mass_spring_get_position(struct Implicit_Data *data, int index, float x[3])
static int cg_filtered(lfVector *ldV, fmatrix3x3 *lA, lfVector *lB, lfVector *z, fmatrix3x3 *S, ImplicitSolverResult *result)
DO_INLINE void cp_fmatrix(float to[3][3], const float from[3][3])
BLI_INLINE void poly_norm(lfVector *data, int i, int j, int *inds, int len, float r_dir[3])
void SIM_mass_spring_set_new_position(struct Implicit_Data *data, int index, const float x[3])
DO_INLINE void initdiag_bfmatrix(fmatrix3x3 *matrix, float m3[3][3])
void SIM_mass_spring_force_edge_wind(Implicit_Data *data, int v1, int v2, float radius1, float radius2, const float(*winvec)[3])
DO_INLINE void cp_bfmatrix(fmatrix3x3 *to, fmatrix3x3 *from)
BLI_INLINE void spring_grad_dir(Implicit_Data *data, int i, int j, float edge[3], float dir[3], float grad_dir[3][3])
void SIM_mass_spring_force_face_wind(Implicit_Data *data, int v1, int v2, int v3, const float(*winvec)[3])
static float calc_nor_area_tri(float nor[3], const float v1[3], const float v2[3], const float v3[3])
BLI_INLINE void root_to_world_v3(Implicit_Data *data, int index, float r[3], const float v[3])
BLI_INLINE void poly_avg(lfVector *data, const int *inds, int len, float r_avg[3])
void SIM_mass_spring_get_new_velocity(struct Implicit_Data *data, int index, float v[3])
DO_INLINE void subadd_bfmatrixS_bfmatrixS(fmatrix3x3 *to, fmatrix3x3 *from, float aS, fmatrix3x3 *matrix, float bS)
void SIM_mass_spring_add_constraint_ndof1(Implicit_Data *data, int index, const float c1[3], const float c2[3], const float dV[3])
BLI_INLINE void world_to_root_m3(Implicit_Data *data, int index, float r[3][3], const float m[3][3])
DO_INLINE void sub_lfvector_lfvector(float(*to)[3], float(*fLongVectorA)[3], float(*fLongVectorB)[3], unsigned int verts)
DO_INLINE void submul_lfvectorS(float(*to)[3], float(*fLongVector)[3], float scalar, unsigned int verts)
BLI_INLINE void edge_norm(lfVector *data, int i, int j, float r_dir[3])
DO_INLINE void sub_lfvector_lfvectorS(float(*to)[3], float(*fLongVectorA)[3], float(*fLongVectorB)[3], float bS, unsigned int verts)
BLI_INLINE void spring_hairbend_estimate_dfdv(Implicit_Data *data, int i, int j, int k, const float goal[3], float stiffness, float damping, int q, float dfdv[3][3])
BLI_INLINE float fbstar(float length, float L, float kb, float cb)
DO_INLINE void del_bfmatrix(fmatrix3x3 *matrix)
void SIM_mass_spring_force_reference_frame(Implicit_Data *data, int index, const float acceleration[3], const float omega[3], const float domega_dt[3], float mass)
float SIM_tri_tetra_volume_signed_6x(Implicit_Data *data, int v1, int v2, int v3)
bool SIM_mass_spring_force_spring_angular(Implicit_Data *data, int i, int j, int *i_a, int *i_b, int len_a, int len_b, float restang, float stiffness, float damping)
BLI_INLINE void spring_hairbend_estimate_dfdx(Implicit_Data *data, int i, int j, int k, const float goal[3], float stiffness, float damping, int q, float dfdx[3][3])
BLI_INLINE void world_to_root_v3(Implicit_Data *data, int index, float r[3], const float v[3])
BLI_INLINE void dfdv_damp(float to[3][3], const float dir[3], float damping)
void SIM_mass_spring_force_extern(struct Implicit_Data *data, int i, const float f[3], float dfdx[3][3], float dfdv[3][3])
void SIM_mass_spring_apply_result(Implicit_Data *data)
BLI_INLINE float bend_angle(const float dir_a[3], const float dir_b[3], const float dir_e[3])
BLI_INLINE void spring_angle(Implicit_Data *data, int i, int j, int *i_a, int *i_b, int len_a, int len_b, float r_dir_a[3], float r_dir_b[3], float *r_angle, float r_vel_a[3], float r_vel_b[3])
DO_INLINE void init_bfmatrix(fmatrix3x3 *matrix, float m3[3][3])
DO_INLINE void cp_lfvector(float(*to)[3], float(*from)[3], unsigned int verts)
void SIM_mass_spring_force_vertex_wind(Implicit_Data *data, int v, float UNUSED(radius), const float(*winvec)[3])
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
INLINE Rall1d< T, V, S > cos(const Rall1d< T, V, S > &arg)
INLINE Rall1d< T, V, S > sin(const Rall1d< T, V, S > &arg)
static void area(int d1, int d2, int e1, int e2, float weights[2])
T length(const vec_base< T, Size > &a)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
static const pxr::TfToken g("g", pxr::TfToken::Immortal)
static const pxr::TfToken density("density", pxr::TfToken::Immortal)
double PIL_check_seconds_timer(void)
CCL_NAMESPACE_BEGIN struct Window V