11#ifdef IMPLICIT_SOLVER_EIGEN
14# define USE_EIGEN_CONSTRAINED_CG
17# pragma GCC diagnostic push
22# ifndef IMPLICIT_ENABLE_EIGEN_DEBUG
24# define IMPLICIT_NDEBUG
29# include <Eigen/Sparse>
30# include <Eigen/src/Core/util/DisableStupidWarnings.h>
32# ifdef USE_EIGEN_CONSTRAINED_CG
36# ifndef IMPLICIT_ENABLE_EIGEN_DEBUG
37# ifndef IMPLICIT_NDEBUG
40# undef IMPLICIT_NDEBUG
45# pragma GCC diagnostic pop
69static float I[3][3] = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}};
74class fVector :
public Eigen::Vector3f {
80 fVector(
const ctype &
v)
82 for (
int k = 0; k < 3; k++) {
89 for (
int k = 0; k < 3; k++) {
104class fMatrix :
public Eigen::Matrix3f {
106 typedef float (*ctype)[3];
110 fMatrix(
const ctype &
v)
112 for (
int k = 0; k < 3; k++) {
113 for (
int l = 0;
l < 3;
l++) {
114 coeffRef(
l, k) =
v[k][
l];
121 for (
int k = 0; k < 3; k++) {
122 for (
int l = 0;
l < 3;
l++) {
123 coeffRef(
l, k) =
v[k][
l];
131 return (ctype)
data();
138class lVector :
public Eigen::VectorXf {
140 typedef Eigen::VectorXf base_t;
146 base_t::operator=(
rhs);
150 float *v3(
int vertex)
152 return &coeffRef(3 * vertex);
155 const float *v3(
int vertex)
const
157 return &coeffRef(3 * vertex);
161typedef Eigen::Triplet<Scalar>
Triplet;
164typedef Eigen::SparseMatrix<Scalar>
lMatrix;
180 void reserve(
int numverts)
183 m_trips.reserve(numverts * 9);
186 void add(
int i,
int j,
const fMatrix &m)
190 for (
int k = 0; k < 3; k++) {
191 for (
int l = 0;
l < 3;
l++) {
192 m_trips.push_back(
Triplet(i + k, j +
l, m.coeff(
l, k)));
197 void sub(
int i,
int j,
const fMatrix &m)
201 for (
int k = 0; k < 3; k++) {
202 for (
int l = 0;
l < 3;
l++) {
203 m_trips.push_back(
Triplet(i + k, j +
l, -m.coeff(
l, k)));
208 inline void construct(
lMatrix &m)
210 m.setFromTriplets(m_trips.begin(), m_trips.end());
218# ifdef USE_EIGEN_CORE
219typedef Eigen::ConjugateGradient<lMatrix, Eigen::Lower, Eigen::DiagonalPreconditioner<Scalar>>
222# ifdef USE_EIGEN_CONSTRAINED_CG
226 Eigen::DiagonalPreconditioner<Scalar>>
229using Eigen::ComputationInfo;
233 for (
int i = 0; i <
v.rows(); i++) {
234 if (i > 0 && i % 3 == 0) {
244 for (
int j = 0; j < m.rows(); j++) {
245 if (j > 0 && j % 3 == 0) {
249 for (
int i = 0; i < m.cols(); i++) {
250 if (i > 0 && i % 3 == 0) {
262 m.reserve(Eigen::VectorXi::Constant(m.cols(), num));
267 return v.data() + 3 * vertex;
272 return v.data() + 3 * vertex;
280 for (
int l = 0;
l < 3;
l++) {
281 for (
int k = 0; k < 3; k++) {
282 tlist.push_back(
Triplet(i + k, j +
l, m[k][
l]));
291 for (
int l = 0;
l < 3;
l++) {
292 for (
int k = 0; k < 3; k++) {
293 tlist.push_back(
Triplet(i + k, j +
l, m[k][
l] * factor));
301 t.setFromTriplets(tlist.begin(), tlist.end());
308 t.setFromTriplets(tlist.begin(), tlist.end());
315 t.setFromTriplets(tlist.begin(), tlist.end());
349 r[0][0] += m[0][0] * f;
350 r[0][1] += m[0][1] * f;
351 r[0][2] += m[0][2] * f;
352 r[1][0] += m[1][0] * f;
353 r[1][1] += m[1][1] * f;
354 r[1][2] += m[1][2] * f;
355 r[2][0] += m[2][0] * f;
356 r[2][1] += m[2][1] * f;
357 r[2][2] += m[2][2] * f;
362 r[0][0] = a[0][0] +
b[0][0] * f;
363 r[0][1] = a[0][1] +
b[0][1] * f;
364 r[0][2] = a[0][2] +
b[0][2] * f;
365 r[1][0] = a[1][0] +
b[1][0] * f;
366 r[1][1] = a[1][1] +
b[1][1] * f;
367 r[1][2] = a[1][2] +
b[1][2] * f;
368 r[2][0] = a[2][0] +
b[2][0] * f;
369 r[2][1] = a[2][1] +
b[2][1] * f;
370 r[2][2] = a[2][2] +
b[2][2] * f;
374 typedef std::vector<fMatrix> fMatrixVector;
381 void resize(
int numverts)
383 this->numverts = numverts;
384 int tot = 3 * numverts;
388 dFdX.resize(tot, tot);
389 dFdV.resize(tot, tot);
391 tfm.resize(numverts,
I);
405 iM.reserve(numverts);
406 idFdX.reserve(numverts);
407 idFdV.reserve(numverts);
408 iS.reserve(numverts);
434 lMatrixCtor idFdX, idFdV;
491# ifdef USE_EIGEN_CORE
494# ifdef USE_EIGEN_CONSTRAINED_CG
495 typedef ConstraintConjGrad solver_t;
498 data->iM.construct(data->M);
499 data->idFdX.construct(data->dFdX);
500 data->idFdV.construct(data->dFdV);
501 data->iS.construct(data->S);
504 cg.setMaxIterations(100);
505 cg.setTolerance(0.01f);
507# ifdef USE_EIGEN_CONSTRAINED_CG
508 cg.filter() = data->S;
511 data->A = data->M - dt * data->dFdV - dt * dt * data->dFdX;
514 data->B = dt * data->F + dt * dt * data->dFdX * data->V;
516# ifdef IMPLICIT_PRINT_SOLVER_INPUT_OUTPUT
527# ifdef USE_EIGEN_CORE
528 data->dV = cg.solve(data->B);
530# ifdef USE_EIGEN_CONSTRAINED_CG
531 data->dV = cg.solveWithGuess(data->B, data->z);
534# ifdef IMPLICIT_PRINT_SOLVER_INPUT_OUTPUT
540 data->Vnew = data->V + data->dV;
546 case Eigen::NoConvergence:
549 case Eigen::InvalidInput:
552 case Eigen::NumericalIssue:
557 result->iterations = cg.iterations();
558 result->error = cg.error();
560 return cg.info() == Eigen::Success;
565 data->Xnew = data->X + data->Vnew * dt;
573 data->X = data->Xnew;
574 data->V = data->Vnew;
582 data->iM.add(index, index, m);
587# ifdef CLOTH_ROOT_FRAME
644 int numverts = data->numverts;
645 for (
int i = 0; i < numverts; i++) {
646 data->iS.add(i, i,
I);
653 data->iS.sub(index, index,
I);
659 Implicit_Data *data,
int index,
const float c1[3],
const float c2[3],
const float dV[3])
661 float m[3][3], p[3], q[3], u[3], cmat[3][3];
672 data->iS.sub(index, index, m);
684 float m[3][3], p[3], u[3], cmat[3][3];
690 data->iS.sub(index, index, m);
700 data->dFdX.setZero();
701 data->dFdV.setZero();
706 const float acceleration[3],
707 const float omega[3],
708 const float domega_dt[3],
711# ifdef CLOTH_ROOT_FRAME
712 float acc[3],
w[3], dwdt[3];
713 float f[3], dfdx[3][3], dfdv[3][3];
714 float euler[3], coriolis[3], centrifugal[3], rotvel[3];
715 float deuler[3][3], dcoriolis[3][3], dcentrifugal[3][3], drotvel[3][3];
748 data->idFdX.add(index, index, dfdx);
749 data->idFdV.add(index, index, dfdv);
771 int numverts = data->numverts;
772 for (
int i = 0; i < numverts; i++) {
780 data->idFdV.add(i, i, tmp);
785 struct Implicit_Data *data,
int i,
const float f[3],
float dfdx[3][3],
float dfdv[3][3])
787 float tf[3], tdfdx[3][3], tdfdv[3][3];
793 data->idFdX.add(i, i, tdfdx);
794 data->idFdV.add(i, i, tdfdv);
816 const float effector_scale = 0.02f;
817 float win[3],
nor[3], area;
822 factor = effector_scale * area / 3.0f;
836 const float effector_scale = 0.01;
889 float x = length /
L;
890 return (-11.541f *
powf(x, 4) + 34.193f *
powf(x, 3) - 39.083f *
powf(x, 2) + 23.116f * x -
896 float x = length /
L;
898 return (-46.164f *
powf(x, 3) + 102.579f *
powf(x, 2) - 78.166f * x + 23.116f);
903 float tempfb_fl = kb *
fb(length,
L);
904 float fbstar_fl = cb * (length -
L);
906 if (tempfb_fl < fbstar_fl) {
917 float tempfb_fl = kb *
fb(length,
L);
918 float fbstar_fl = cb * (length -
L);
920 if (tempfb_fl < fbstar_fl) {
937 sub_v3_v3v3(r_extent, data->X.v3(j), data->X.v3(i));
939 *r_length =
len_v3(r_extent);
944 if ((clmd->sim_parms->flags & CSIMSETT_FLAG_TEARING_ENABLED) &&
945 (((length -
L) * 100.0f /
L) > clmd->sim_parms->maxspringlen))
948 s->flags |= CSPRING_FLAG_DEACTIVATE;
963 Implicit_Data *data,
int i,
int j,
const float f[3],
float dfdx[3][3],
float dfdv[3][3])
968 data->idFdX.add(i, i, dfdx);
969 data->idFdX.add(j, j, dfdx);
970 data->idFdX.sub(i, j, dfdx);
971 data->idFdX.sub(j, i, dfdx);
973 data->idFdV.add(i, i, dfdv);
974 data->idFdV.add(j, j, dfdv);
975 data->idFdV.sub(i, j, dfdv);
976 data->idFdV.sub(j, i, dfdv);
991 float extent[3],
length, dir[3], vel[3];
996 if (length > restlen || no_compress) {
997 float stretch_force, f[3], dfdx[3][3], dfdv[3][3];
999 stretch_force = stiffness * (length - restlen);
1000 if (clamp_force > 0.0f && stretch_force > clamp_force) {
1001 stretch_force = clamp_force;
1009 dfdx_spring(dfdx, dir, length, restlen, stiffness);
1052 float extent[3],
length, dir[3], vel[3];
1057 if (length < restlen) {
1058 float f[3], dfdx[3][3], dfdv[3][3];
1104 Implicit_Data *data,
int i,
int j,
float edge[3],
float dir[3],
float grad_dir[3][3])
1125 const float goal[3],
1133 float edge_ij[3], dir_ij[3];
1134 float edge_jk[3], dir_jk[3];
1135 float vel_ij[3], vel_jk[3], vel_ortho[3];
1136 float f_bend[3], f_damp[3];
1142 sub_v3_v3v3(edge_ij, data->X.v3(j), data->X.v3(i));
1151 sub_v3_v3v3(edge_jk, data->X.v3(k), data->X.v3(j));
1160 sub_v3_v3v3(vel_ij, data->V.v3(j), data->V.v3(i));
1168 sub_v3_v3v3(vel_jk, data->V.v3(k), data->V.v3(j));
1196 const float goal[3],
1202 const float delta = 0.00001f;
1203 float dvec_null[3][3], dvec_pos[3][3], dvec_neg[3][3];
1215 for (a = 0; a < 3; a++) {
1216 spring_angbend_forces(
1217 data, i, j, k, goal, stiffness, damping, q, dvec_pos[a], dvec_null[a], f);
1220 spring_angbend_forces(
1221 data, i, j, k, goal, stiffness, damping, q, dvec_neg[a], dvec_null[a], f);
1224 for (
b = 0;
b < 3;
b++) {
1225 dfdx[a][
b] /= delta;
1235 const float goal[3],
1241 const float delta = 0.00001f;
1242 float dvec_null[3][3], dvec_pos[3][3], dvec_neg[3][3];
1254 for (a = 0; a < 3; a++) {
1255 spring_angbend_forces(
1256 data, i, j, k, goal, stiffness, damping, q, dvec_null[a], dvec_pos[a], f);
1259 spring_angbend_forces(
1260 data, i, j, k, goal, stiffness, damping, q, dvec_null[a], dvec_neg[a], f);
1263 for (
b = 0;
b < 3;
b++) {
1264 dfdv[a][
b] /= delta;
1272bool SIM_mass_spring_force_spring_bending_angular(
Implicit_Data *data,
1276 const float target[3],
1282 float dfj_dxi[3][3], dfj_dxj[3][3], dfk_dxi[3][3], dfk_dxj[3][3], dfk_dxk[3][3];
1283 float dfj_dvi[3][3], dfj_dvj[3][3], dfk_dvi[3][3], dfk_dvj[3][3], dfk_dvk[3][3];
1285 const float vecnull[3] = {0.0f, 0.0f, 0.0f};
1289 spring_angbend_forces(data, i, j, k, goal, stiffness, damping, k, vecnull, vecnull, fk);
1292 spring_angbend_estimate_dfdx(data, i, j, k, goal, stiffness, damping, i, dfk_dxi);
1293 spring_angbend_estimate_dfdx(data, i, j, k, goal, stiffness, damping, j, dfk_dxj);
1294 spring_angbend_estimate_dfdx(data, i, j, k, goal, stiffness, damping, k, dfk_dxk);
1300 spring_angbend_estimate_dfdv(data, i, j, k, goal, stiffness, damping, i, dfk_dvi);
1301 spring_angbend_estimate_dfdv(data, i, j, k, goal, stiffness, damping, j, dfk_dvj);
1302 spring_angbend_estimate_dfdv(data, i, j, k, goal, stiffness, damping, k, dfk_dvk);
1313 data->idFdX.add(j, j, dfj_dxj);
1314 data->idFdX.add(k, k, dfk_dxk);
1316 data->idFdX.add(i, j, dfj_dxi);
1317 data->idFdX.add(j, i, dfj_dxi);
1318 data->idFdX.add(j, k, dfk_dxj);
1319 data->idFdX.add(k, j, dfk_dxj);
1320 data->idFdX.add(i, k, dfk_dxi);
1321 data->idFdX.add(k, i, dfk_dxi);
1323 data->idFdV.add(j, j, dfj_dvj);
1324 data->idFdV.add(k, k, dfk_dvk);
1326 data->idFdV.add(i, j, dfj_dvi);
1327 data->idFdV.add(j, i, dfj_dvi);
1328 data->idFdV.add(j, k, dfk_dvj);
1329 data->idFdV.add(k, j, dfk_dvj);
1330 data->idFdV.add(i, k, dfk_dvi);
1331 data->idFdV.add(k, i, dfk_dvi);
1338 float edge_ij[3], dir_ij[3], grad_dir_ij[3][3];
1339 float edge_jk[3], dir_jk[3], grad_dir_jk[3][3];
1340 float dist[3], vel_jk[3], vel_jk_ortho[3], projvel[3];
1343 float fi[3], fj[3], fk[3];
1344 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];
1386 madd_m3_m3fl(dfk_dxi, grad_dir_ij, stiffness * restlen);
1388 madd_m3_m3fl(dfk_dxj, grad_dir_ij, -stiffness * restlen);
1411 add_m3_m3m3(data->dFdX[i].m, data->dFdX[i].m, dfi_dxi);
1412 add_m3_m3m3(data->dFdX[j].m, data->dFdX[j].m, dfj_dxj);
1413 add_m3_m3m3(data->dFdX[k].m, data->dFdX[k].m, dfk_dxk);
1415 add_m3_m3m3(data->dFdX[block_ij].m, data->dFdX[block_ij].m, dfj_dxi);
1416 add_m3_m3m3(data->dFdX[block_jk].m, data->dFdX[block_jk].m, dfk_dxj);
1417 add_m3_m3m3(data->dFdX[block_ik].m, data->dFdX[block_ik].m, dfk_dxi);
1425 const float goal_x[3],
1426 const float goal_v[3],
1433 float root_goal_x[3], root_goal_v[3], extent[3],
length, dir[3], vel[3];
1434 float f[3], dfdx[3][3], dfdv[3][3];
1455 data->idFdX.add(i, i, dfdx);
1456 data->idFdV.add(i, i, dfdv);
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 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 madd_m3_m3m3fl(float R[3][3], const float A[3][3], const float B[3][3], float f)
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 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 float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
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 normalize_v3(float n[3])
MINLINE float len_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT
Object is a sort of wrapper for general info.
Read Guarded memory(de)allocation.
int SIM_mass_spring_solver_numvert(struct Implicit_Data *id)
@ SIM_SOLVER_INVALID_INPUT
@ SIM_SOLVER_NUMERICAL_ISSUE
@ 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
btGeneric6DofConstraint & operator=(btGeneric6DofConstraint &other)
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
void reset()
clear internal cached data and reset random seed
SIMD_FORCE_INLINE btScalar length() const
Return the length of the vector.
A conjugate gradient solver for sparse self-adjoint problems with additional constraints.
BLI_INLINE void madd_m3_m3fl(float r[3][3], const float m[3][3], float f)
local_group_size(16, 16) .push_constant(Type b
local_group_size(16, 16) .push_constant(Type rhs
draw_view in_light_buf[] float
Eigen::ConjugateGradient< lMatrix, Eigen::Lower, Eigen::DiagonalPreconditioner< Scalar > > ConjugateGradient
std::vector< Triplet > TripletList
BLI_INLINE void print_lmatrix(const lMatrix &m)
Eigen::SparseMatrix< Scalar > lMatrix
BLI_INLINE void print_lvector(const lVector3f &v)
Eigen::Triplet< Scalar > Triplet
void SIM_mass_spring_add_constraint_ndof1(struct Implicit_Data *data, int index, const float c1[3], const float c2[3], const float dV[3])
void SIM_mass_spring_get_motion_state(struct Implicit_Data *data, int index, float x[3], float v[3])
void SIM_mass_spring_add_constraint_ndof0(struct Implicit_Data *data, int index, const float dV[3])
void SIM_mass_spring_force_reference_frame(struct Implicit_Data *data, int index, const float acceleration[3], const float omega[3], const float domega_dt[3], float mass)
void SIM_mass_spring_force_edge_wind(struct Implicit_Data *data, int v1, int v2, float radius1, float radius2, const float(*winvec)[3])
void SIM_mass_spring_set_new_velocity(struct Implicit_Data *data, int index, const float v[3])
bool SIM_mass_spring_force_spring_goal(struct Implicit_Data *data, int i, const float goal_x[3], const float goal_v[3], float stiffness, float damping)
void SIM_mass_spring_set_vertex_mass(struct Implicit_Data *data, int index, float mass)
void SIM_mass_spring_set_motion_state(struct Implicit_Data *data, int index, const float x[3], const float v[3])
bool SIM_mass_spring_force_spring_linear(struct 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)
bool SIM_mass_spring_force_spring_bending(struct Implicit_Data *data, int i, int j, float restlen, float kb, float cb)
void SIM_mass_spring_apply_result(struct Implicit_Data *data)
void SIM_mass_spring_set_position(struct Implicit_Data *data, int index, const float x[3])
void SIM_mass_spring_add_constraint_ndof2(struct Implicit_Data *data, int index, const float c1[3], const float dV[3])
BLI_INLINE void implicit_print_matrix_elem(float v)
void SIM_mass_spring_force_face_wind(struct Implicit_Data *data, int v1, int v2, int v3, const float(*winvec)[3])
void SIM_mass_spring_get_position(struct Implicit_Data *data, int index, float x[3])
bool SIM_mass_spring_solve_velocities(struct Implicit_Data *data, float dt, struct ImplicitSolverResult *result)
void SIM_mass_spring_force_drag(struct Implicit_Data *data, float drag)
void SIM_mass_spring_clear_constraints(struct Implicit_Data *data)
bool SIM_mass_spring_solve_positions(struct Implicit_Data *data, float dt)
void SIM_mass_spring_get_new_velocity(struct Implicit_Data *data, int index, float v[3])
void SIM_mass_spring_set_velocity(struct Implicit_Data *data, int index, const float v[3])
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_force_gravity(struct Implicit_Data *data, int index, float mass, const float g[3])
void SIM_mass_spring_set_rest_transform(struct Implicit_Data *data, int index, float tfm[3][3])
void SIM_mass_spring_clear_forces(struct 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])
BLI_INLINE float fbstar_jacobi(float length, float L, float kb, float cb)
Implicit_Data * SIM_mass_spring_solver_create(int numverts, int numsprings)
DO_INLINE void mul_fvectorT_fvector(float to[3][3], const float vectorA[3], const float vectorB[3])
BLI_INLINE void cross_m3_v3m3(float r[3][3], const float v[3], const float m[3][3])
BLI_INLINE float fb(float length, float L)
DO_INLINE void mul_fmatrix_S(float matrix[3][3], float scalar)
BLI_INLINE float fbderiv(float length, float L)
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])
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])
BLI_INLINE void outerproduct(float r[3][3], const float a[3], const float b[3])
DO_INLINE void sub_fmatrix_fmatrix(float to[3][3], const float matrixA[3][3], const float matrixB[3][3])
BLI_INLINE void dfdx_spring(float to[3][3], const float dir[3], float length, float L, float k)
BLI_INLINE void spring_grad_dir(Implicit_Data *data, int i, int j, float edge[3], float dir[3], float grad_dir[3][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 world_to_root_m3(Implicit_Data *data, int index, float r[3][3], const float m[3][3])
BLI_INLINE float fbstar(float length, float L, float kb, float cb)
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)
static void add(blender::Map< std::string, std::string > &messages, Message &msg)
Frequency::GEOMETRY nor[]