Blender V2.61 - r43446
|
#include "MEM_guardedalloc.h"
#include "DNA_scene_types.h"
#include "DNA_object_types.h"
#include "DNA_object_force.h"
#include "DNA_meshdata_types.h"
#include "BLI_threads.h"
#include "BLI_math.h"
#include "BLI_linklist.h"
#include "BLI_utildefines.h"
#include "BKE_cloth.h"
#include "BKE_collision.h"
#include "BKE_effect.h"
#include "BKE_global.h"
#include <sys/time.h>
Go to the source code of this file.
Classes | |
struct | fmatrix3x3 |
struct | Implicit_Data |
struct | HairGridVert |
Defines | |
#define | CLOTH_OPENMP_LIMIT 512 |
#define | HAIR_GRID_INDEX(vec, min, max, axis) (int)( (vec[axis] - min[axis]) / (max[axis] - min[axis]) * 9.99f ); |
Typedefs | |
typedef float | lfVector [3] |
typedef struct fmatrix3x3 | fmatrix3x3 |
typedef struct Implicit_Data | Implicit_Data |
typedef struct HairGridVert | HairGridVert |
Functions | |
void | itstart (void) |
static void | itend (void) |
double | itval (void) |
DO_INLINE void | mul_fvector_S (float to[3], float from[3], float scalar) |
DO_INLINE void | cross_fvector (float to[3], float vectorA[3], float vectorB[3]) |
DO_INLINE void | mul_fvectorT_fvector (float to[3][3], float vectorA[3], float vectorB[3]) |
DO_INLINE void | mul_fvectorT_fvectorS (float to[3][3], float vectorA[3], float vectorB[3], float aS) |
static void | print_fvector (float m3[3]) |
DO_INLINE void | print_lfvector (float(*fLongVector)[3], unsigned int verts) |
DO_INLINE lfVector * | create_lfvector (unsigned int verts) |
DO_INLINE void | del_lfvector (float(*fLongVector)[3]) |
DO_INLINE void | cp_lfvector (float(*to)[3], float(*from)[3], unsigned int verts) |
DO_INLINE void | init_lfvector (float(*fLongVector)[3], float vector[3], unsigned int verts) |
DO_INLINE void | zero_lfvector (float(*to)[3], unsigned int verts) |
DO_INLINE void | mul_lfvectorS (float(*to)[3], float(*fLongVector)[3], float scalar, unsigned int verts) |
DO_INLINE void | submul_lfvectorS (float(*to)[3], float(*fLongVector)[3], float scalar, unsigned int verts) |
DO_INLINE float | dot_lfvector (float(*fLongVectorA)[3], float(*fLongVectorB)[3], unsigned int verts) |
DO_INLINE void | add_lfvector_lfvector (float(*to)[3], float(*fLongVectorA)[3], float(*fLongVectorB)[3], unsigned int verts) |
DO_INLINE void | add_lfvector_lfvectorS (float(*to)[3], float(*fLongVectorA)[3], float(*fLongVectorB)[3], float bS, unsigned int verts) |
DO_INLINE void | add_lfvectorS_lfvectorS (float(*to)[3], float(*fLongVectorA)[3], float aS, float(*fLongVectorB)[3], float bS, unsigned int verts) |
DO_INLINE void | sub_lfvector_lfvectorS (float(*to)[3], float(*fLongVectorA)[3], float(*fLongVectorB)[3], float bS, unsigned int verts) |
DO_INLINE void | sub_lfvector_lfvector (float(*to)[3], float(*fLongVectorA)[3], float(*fLongVectorB)[3], unsigned int verts) |
DO_INLINE void | cp_fmatrix (float to[3][3], float from[3][3]) |
DO_INLINE void | initdiag_fmatrixS (float to[3][3], float aS) |
DO_INLINE float | det_fmatrix (float m[3][3]) |
DO_INLINE void | inverse_fmatrix (float to[3][3], float from[3][3]) |
DO_INLINE void | mul_fmatrix_S (float matrix[3][3], float scalar) |
DO_INLINE void | mul_fvector_fmatrix (float *to, float *from, float matrix[3][3]) |
DO_INLINE void | mul_fmatrix_fvector (float *to, float matrix[3][3], float *from) |
DO_INLINE void | mul_fmatrix_fmatrix (float to[3][3], float matrixA[3][3], float matrixB[3][3]) |
DO_INLINE void | add_fmatrix_fmatrix (float to[3][3], float matrixA[3][3], float matrixB[3][3]) |
DO_INLINE void | addadd_fmatrix_fmatrix (float to[3][3], float matrixA[3][3], float matrixB[3][3]) |
DO_INLINE void | addsub_fmatrixS_fmatrixS (float to[3][3], float matrixA[3][3], float aS, float matrixB[3][3], float bS) |
DO_INLINE void | subadd_fmatrix_fmatrix (float to[3][3], float matrixA[3][3], float matrixB[3][3]) |
DO_INLINE void | subadd_fmatrixS_fmatrixS (float to[3][3], float matrixA[3][3], float aS, float matrixB[3][3], float bS) |
DO_INLINE void | sub_fmatrix_fmatrix (float to[3][3], float matrixA[3][3], float matrixB[3][3]) |
DO_INLINE void | addsub_fmatrix_fmatrix (float to[3][3], float matrixA[3][3], float matrixB[3][3]) |
DO_INLINE void | muladd_fvector_fmatrix (float to[3], float from[3], float matrix[3][3]) |
DO_INLINE void | muladd_fmatrix_fmatrix (float to[3][3], float matrixA[3][3], float matrixB[3][3]) |
DO_INLINE void | mulsub_fvector_fmatrix (float to[3], float from[3], float matrix[3][3]) |
DO_INLINE void | mulsub_fmatrix_fmatrix (float to[3][3], float matrixA[3][3], float matrixB[3][3]) |
DO_INLINE void | muladd_fmatrix_fvector (float to[3], float matrix[3][3], float from[3]) |
DO_INLINE void | mulsub_fmatrix_fvector (float to[3], float matrix[3][3], float from[3]) |
DO_INLINE fmatrix3x3 * | create_bfmatrix (unsigned int verts, unsigned int springs) |
DO_INLINE void | del_bfmatrix (fmatrix3x3 *matrix) |
DO_INLINE void | cp_bfmatrix (fmatrix3x3 *to, fmatrix3x3 *from) |
DO_INLINE void | init_bfmatrix (fmatrix3x3 *matrix, float m3[3][3]) |
DO_INLINE void | initdiag_bfmatrix (fmatrix3x3 *matrix, float m3[3][3]) |
DO_INLINE void | mul_bfmatrix_S (fmatrix3x3 *matrix, float scalar) |
DO_INLINE void | mul_bfmatrix_lfvector (float(*to)[3], fmatrix3x3 *from, lfVector *fLongVector) |
DO_INLINE void | mul_prevfmatrix_lfvector (float(*to)[3], fmatrix3x3 *from, lfVector *fLongVector) |
DO_INLINE void | add_bfmatrix_bfmatrix (fmatrix3x3 *to, fmatrix3x3 *from, fmatrix3x3 *matrix) |
DO_INLINE void | addadd_bfmatrix_bfmatrix (fmatrix3x3 *to, fmatrix3x3 *from, fmatrix3x3 *matrix) |
DO_INLINE void | subadd_bfmatrix_bfmatrix (fmatrix3x3 *to, fmatrix3x3 *from, fmatrix3x3 *matrix) |
DO_INLINE void | sub_bfmatrix_bfmatrix (fmatrix3x3 *to, fmatrix3x3 *from, fmatrix3x3 *matrix) |
DO_INLINE void | sub_bfmatrix_Smatrix (fmatrix3x3 *to, fmatrix3x3 *from, fmatrix3x3 *matrix) |
DO_INLINE void | addsub_bfmatrix_bfmatrix (fmatrix3x3 *to, fmatrix3x3 *from, fmatrix3x3 *matrix) |
DO_INLINE void | subadd_bfmatrixS_bfmatrixS (fmatrix3x3 *to, fmatrix3x3 *from, float aS, fmatrix3x3 *matrix, float bS) |
int | implicit_init (Object *UNUSED(ob), ClothModifierData *clmd) |
int | implicit_free (ClothModifierData *clmd) |
DO_INLINE float | fb (float length, float L) |
DO_INLINE float | fbderiv (float length, float L) |
DO_INLINE float | fbstar (float length, float L, float kb, float cb) |
DO_INLINE float | fbstar_jacobi (float length, float L, float kb, float cb) |
DO_INLINE void | filter (lfVector *V, fmatrix3x3 *S) |
static int | cg_filtered (lfVector *ldV, fmatrix3x3 *lA, lfVector *lB, lfVector *z, fmatrix3x3 *S) |
DO_INLINE void | BuildPPinv (fmatrix3x3 *lA, fmatrix3x3 *P, fmatrix3x3 *Pinv) |
DO_INLINE void | dfdx_spring_type1 (float to[3][3], float extent[3], float length, float L, float dot, float k) |
DO_INLINE void | dfdx_spring_type2 (float to[3][3], float dir[3], float length, float L, float k, float cb) |
DO_INLINE void | dfdv_damp (float to[3][3], float dir[3], float damping) |
DO_INLINE void | dfdx_spring (float to[3][3], float dir[3], float length, float L, float k) |
DO_INLINE void | dfdx_damp (float to[3][3], float dir[3], float length, const float vel[3], float rest, float damping) |
DO_INLINE void | cloth_calc_spring_force (ClothModifierData *clmd, ClothSpring *s, lfVector *UNUSED(lF), lfVector *X, lfVector *V, fmatrix3x3 *UNUSED(dFdV), fmatrix3x3 *UNUSED(dFdX), float time) |
DO_INLINE void | cloth_apply_spring_force (ClothModifierData *UNUSED(clmd), ClothSpring *s, lfVector *lF, lfVector *UNUSED(X), lfVector *UNUSED(V), fmatrix3x3 *dFdV, fmatrix3x3 *dFdX) |
static void | CalcFloat (float *v1, float *v2, float *v3, float *n) |
static void | CalcFloat4 (float *v1, float *v2, float *v3, float *v4, float *n) |
static float | calculateVertexWindForce (float wind[3], float vertexnormal[3]) |
static void | hair_velocity_smoothing (ClothModifierData *clmd, lfVector *lF, lfVector *lX, lfVector *lV, unsigned int numverts) |
static void | cloth_calc_force (ClothModifierData *clmd, float UNUSED(frame), lfVector *lF, lfVector *lX, lfVector *lV, fmatrix3x3 *dFdV, fmatrix3x3 *dFdX, ListBase *effectors, float time, fmatrix3x3 *M) |
static void | simulate_implicit_euler (lfVector *Vnew, lfVector *UNUSED(lX), lfVector *lV, lfVector *lF, fmatrix3x3 *dFdV, fmatrix3x3 *dFdX, float dt, fmatrix3x3 *A, lfVector *B, lfVector *dV, fmatrix3x3 *S, lfVector *z, lfVector *olddV, fmatrix3x3 *UNUSED(P), fmatrix3x3 *UNUSED(Pinv), fmatrix3x3 *M, fmatrix3x3 *UNUSED(bigI)) |
int | cloth_calc_helper_forces (Object *UNUSED(ob), ClothModifierData *clmd, float(*initial_cos)[3], float UNUSED(step), float dt) |
int | implicit_solver (Object *ob, float frame, ClothModifierData *clmd, ListBase *effectors) |
void | implicit_set_positions (ClothModifierData *clmd) |
Variables | |
static struct timeval _itstart | _itend |
static struct timezone | itz |
static float | I [3][3] = {{1,0,0},{0,1,0},{0,0,1}} |
static float | ZERO [3][3] = {{0,0,0}, {0,0,0}, {0,0,0}} |
Definition in file implicit.c.
#define CLOTH_OPENMP_LIMIT 512 |
Definition at line 51 of file implicit.c.
#define HAIR_GRID_INDEX | ( | vec, | |
min, | |||
max, | |||
axis | |||
) | (int)( (vec[axis] - min[axis]) / (max[axis] - min[axis]) * 9.99f ); |
Definition at line 1426 of file implicit.c.
Referenced by hair_velocity_smoothing().
typedef struct fmatrix3x3 fmatrix3x3 |
typedef struct HairGridVert HairGridVert |
typedef struct Implicit_Data Implicit_Data |
typedef float lfVector[3] |
Definition at line 112 of file implicit.c.
DO_INLINE void add_bfmatrix_bfmatrix | ( | fmatrix3x3 * | to, |
fmatrix3x3 * | from, | ||
fmatrix3x3 * | matrix | ||
) |
Definition at line 638 of file implicit.c.
References add_fmatrix_fmatrix(), fmatrix3x3::scount, and fmatrix3x3::vcount.
DO_INLINE void add_fmatrix_fmatrix | ( | float | to[3][3], |
float | matrixA[3][3], | ||
float | matrixB[3][3] | ||
) |
Definition at line 415 of file implicit.c.
References VECADD.
Referenced by add_bfmatrix_bfmatrix(), cloth_apply_spring_force(), and dfdx_spring_type1().
DO_INLINE void add_lfvector_lfvector | ( | float(*) | to[3], |
float(*) | fLongVectorA[3], | ||
float(*) | fLongVectorB[3], | ||
unsigned int | verts | ||
) |
Definition at line 258 of file implicit.c.
Referenced by cg_filtered(), mul_bfmatrix_lfvector(), and simulate_implicit_euler().
DO_INLINE void add_lfvector_lfvectorS | ( | float(*) | to[3], |
float(*) | fLongVectorA[3], | ||
float(*) | fLongVectorB[3], | ||
float | bS, | ||
unsigned int | verts | ||
) |
Definition at line 269 of file implicit.c.
Referenced by cg_filtered(), and implicit_solver().
DO_INLINE void add_lfvectorS_lfvectorS | ( | float(*) | to[3], |
float(*) | fLongVectorA[3], | ||
float | aS, | ||
float(*) | fLongVectorB[3], | ||
float | bS, | ||
unsigned int | verts | ||
) |
Definition at line 280 of file implicit.c.
Referenced by simulate_implicit_euler().
DO_INLINE void addadd_bfmatrix_bfmatrix | ( | fmatrix3x3 * | to, |
fmatrix3x3 * | from, | ||
fmatrix3x3 * | matrix | ||
) |
Definition at line 650 of file implicit.c.
References addadd_fmatrix_fmatrix(), fmatrix3x3::scount, and fmatrix3x3::vcount.
DO_INLINE void addadd_fmatrix_fmatrix | ( | float | to[3][3], |
float | matrixA[3][3], | ||
float | matrixB[3][3] | ||
) |
Definition at line 422 of file implicit.c.
References VECADDADD.
Referenced by addadd_bfmatrix_bfmatrix().
DO_INLINE void addsub_bfmatrix_bfmatrix | ( | fmatrix3x3 * | to, |
fmatrix3x3 * | from, | ||
fmatrix3x3 * | matrix | ||
) |
Definition at line 698 of file implicit.c.
References addsub_fmatrix_fmatrix(), fmatrix3x3::scount, and fmatrix3x3::vcount.
DO_INLINE void addsub_fmatrix_fmatrix | ( | float | to[3][3], |
float | matrixA[3][3], | ||
float | matrixB[3][3] | ||
) |
Definition at line 457 of file implicit.c.
References VECADDSUB.
Referenced by addsub_bfmatrix_bfmatrix().
DO_INLINE void addsub_fmatrixS_fmatrixS | ( | float | to[3][3], |
float | matrixA[3][3], | ||
float | aS, | ||
float | matrixB[3][3], | ||
float | bS | ||
) |
Definition at line 429 of file implicit.c.
References VECADDSUBSS.
DO_INLINE void BuildPPinv | ( | fmatrix3x3 * | lA, |
fmatrix3x3 * | P, | ||
fmatrix3x3 * | Pinv | ||
) |
Definition at line 977 of file implicit.c.
References cp_fmatrix(), inverse_fmatrix(), and fmatrix3x3::vcount.
static void CalcFloat | ( | float * | v1, |
float * | v2, | ||
float * | v3, | ||
float * | n | ||
) | [static] |
Definition at line 1384 of file implicit.c.
Referenced by cloth_calc_force().
static void CalcFloat4 | ( | float * | v1, |
float * | v2, | ||
float * | v3, | ||
float * | v4, | ||
float * | n | ||
) | [static] |
Definition at line 1399 of file implicit.c.
Referenced by cloth_calc_force().
static float calculateVertexWindForce | ( | float | wind[3], |
float | vertexnormal[3] | ||
) | [static] |
static int cg_filtered | ( | lfVector * | ldV, |
fmatrix3x3 * | lA, | ||
lfVector * | lB, | ||
lfVector * | z, | ||
fmatrix3x3 * | S | ||
) | [static] |
Definition at line 910 of file implicit.c.
References add_lfvector_lfvector(), add_lfvector_lfvectorS(), cp_lfvector(), create_lfvector(), simple_enum_gen::d, del_lfvector(), dot_lfvector(), filter(), mul_bfmatrix_lfvector(), sqrt(), sub_lfvector_lfvector(), sub_lfvector_lfvectorS(), and fmatrix3x3::vcount.
Referenced by simulate_implicit_euler().
DO_INLINE void cloth_apply_spring_force | ( | ClothModifierData * | UNUSEDclmd, |
ClothSpring * | s, | ||
lfVector * | lF, | ||
lfVector * | UNUSEDX, | ||
lfVector * | UNUSEDV, | ||
fmatrix3x3 * | dFdV, | ||
fmatrix3x3 * | dFdX | ||
) |
Definition at line 1361 of file implicit.c.
References add_fmatrix_fmatrix(), CLOTH_SPRING_FLAG_NEEDED, CLOTH_SPRING_TYPE_BENDING, CLOTH_SPRING_TYPE_GOAL, ClothSpring::dfdv, ClothSpring::dfdx, ClothSpring::f, ClothSpring::flags, ClothSpring::ij, ClothSpring::kl, fmatrix3x3::m, ClothSpring::matrix_index, sub_fmatrix_fmatrix(), ClothSpring::type, VECADD, and VECSUB.
Referenced by cloth_calc_force().
static void cloth_calc_force | ( | ClothModifierData * | clmd, |
float | UNUSEDframe, | ||
lfVector * | lF, | ||
lfVector * | lX, | ||
lfVector * | lV, | ||
fmatrix3x3 * | dFdV, | ||
fmatrix3x3 * | dFdX, | ||
ListBase * | effectors, | ||
float | time, | ||
fmatrix3x3 * | M | ||
) | [static] |
Definition at line 1563 of file implicit.c.
References CalcFloat(), CalcFloat4(), calculateVertexWindForce(), cloth_apply_spring_force(), cloth_calc_spring_force(), CLOTH_SPRING_TYPE_STRUCTURAL, ClothModifierData::clothObject, ClothSimSettings::collider_friction, create_lfvector(), ClothSimSettings::Cvi, del_lfvector(), ClothSimSettings::effector_weights, PhysicsSettings::flag, EffectorWeights::global_gravity, PhysicsSettings::gravity, hair_velocity_smoothing(), i, ClothSpring::ij, init_bfmatrix(), init_lfvector(), initdiag_bfmatrix(), ClothSpring::kl, LinkNode::link, Cloth::mfaces, mul_fmatrix_fvector(), mul_fvector_S(), mul_v3_fl(), LinkNode::next, normalize_v3_v3(), NULL, Cloth::numfaces, Cloth::numverts, pd_point_from_loc(), pdDoEffectors(), PHYS_GLOBAL_GRAVITY, Scene::physics_settings, project_v3_v3v3(), ClothSpring::restlen, ClothModifierData::scene, ClothModifierData::sim_parms, Cloth::springs, submul_lfvectorS(), ClothSpring::type, MFace::v4, VECADDS, VECCOPY, VECSUB, and ClothSimSettings::velocity_smooth.
Referenced by implicit_solver().
int cloth_calc_helper_forces | ( | Object * | UNUSEDob, |
ClothModifierData * | clmd, | ||
float(*) | initial_cos[3], | ||
float | UNUSEDstep, | ||
float | dt | ||
) |
Definition at line 1754 of file implicit.c.
References add_v3_v3(), CLOTH_SPRING_TYPE_SHEAR, CLOTH_SPRING_TYPE_STRUCTURAL, ClothModifierData::clothObject, copy_v3_v3(), cos(), credits_svn_gen::e, ClothVertex::goal, i, ClothSpring::ij, ClothSpring::kl, len(), len_v3v3(), LinkNode::link, ClothVertex::mass, MEM_callocN(), MEM_freeN(), mul_v3_fl(), LinkNode::next, normalize_v3(), Cloth::numverts, ClothSpring::restlen, Cloth::springs, sub_v3_v3v3(), ClothVertex::tv, ClothVertex::tx, ClothSpring::type, and Cloth::verts.
DO_INLINE void cloth_calc_spring_force | ( | ClothModifierData * | clmd, |
ClothSpring * | s, | ||
lfVector * | UNUSEDlF, | ||
lfVector * | X, | ||
lfVector * | V, | ||
fmatrix3x3 * | UNUSEDdFdV, | ||
fmatrix3x3 * | UNUSEDdFdX, | ||
float | time | ||
) |
Definition at line 1225 of file implicit.c.
References ABS, ALMOST_ZERO, ClothSimSettings::avg_spring_len, ClothSimSettings::bending, ClothSimSettings::Cdis, CLOTH_SIMSETTINGS_FLAG_NO_SPRING_COMPRESS, CLOTH_SPRING_FLAG_NEEDED, CLOTH_SPRING_TYPE_GOAL, CLOTH_SPRING_TYPE_SHEAR, CLOTH_SPRING_TYPE_STRUCTURAL, ClothModifierData::clothObject, cp_fmatrix(), ClothSpring::dfdv, dfdv_damp(), ClothSpring::dfdx, dfdx_spring(), dfdx_spring_type2(), dot(), ClothSpring::f, fbstar(), ClothSpring::flags, ClothSimSettings::flags, ClothVertex::goal, ClothSimSettings::goalfrict, ClothSimSettings::goalspring, ClothSpring::ij, INPR, ClothSpring::kl, L, length(), ClothSimSettings::max_bend, ClothSimSettings::max_struct, mul_fvector_S(), ClothSpring::restlen, ClothModifierData::sim_parms, sqrt(), ClothSpring::stiffness, ClothSimSettings::structural, ClothSpring::type, VECADD, VECADDS, VECCOPY, VECSUB, Cloth::verts, ClothVertex::xconst, and ClothVertex::xold.
Referenced by cloth_calc_force().
DO_INLINE void cp_bfmatrix | ( | fmatrix3x3 * | to, |
fmatrix3x3 * | from | ||
) |
Definition at line 546 of file implicit.c.
Referenced by simulate_implicit_euler().
DO_INLINE void cp_fmatrix | ( | float | to[3][3], |
float | from[3][3] | ||
) |
Definition at line 324 of file implicit.c.
References VECCOPY.
Referenced by BuildPPinv(), cloth_calc_spring_force(), init_bfmatrix(), initdiag_bfmatrix(), and initdiag_fmatrixS().
DO_INLINE void cp_lfvector | ( | float(*) | to[3], |
float(*) | from[3], | ||
unsigned int | verts | ||
) |
Definition at line 203 of file implicit.c.
Referenced by cg_filtered(), implicit_solver(), and simulate_implicit_euler().
DO_INLINE fmatrix3x3* create_bfmatrix | ( | unsigned int | verts, |
unsigned int | springs | ||
) |
Definition at line 528 of file implicit.c.
References MEM_callocN(), fmatrix3x3::scount, and fmatrix3x3::vcount.
Referenced by implicit_init().
DO_INLINE lfVector* create_lfvector | ( | unsigned int | verts | ) |
Definition at line 187 of file implicit.c.
References MEM_callocN().
Referenced by cg_filtered(), cloth_calc_force(), implicit_init(), mul_bfmatrix_lfvector(), and simulate_implicit_euler().
DO_INLINE void cross_fvector | ( | float | to[3], |
float | vectorA[3], | ||
float | vectorB[3] | ||
) |
Definition at line 142 of file implicit.c.
DO_INLINE void del_bfmatrix | ( | fmatrix3x3 * | matrix | ) |
Definition at line 537 of file implicit.c.
References MEM_freeN(), and NULL.
Referenced by implicit_free().
DO_INLINE void del_lfvector | ( | float(*) | fLongVector[3] | ) |
Definition at line 194 of file implicit.c.
References MEM_freeN(), and NULL.
Referenced by cg_filtered(), cloth_calc_force(), implicit_free(), mul_bfmatrix_lfvector(), and simulate_implicit_euler().
DO_INLINE float det_fmatrix | ( | float | m[3][3] | ) |
Definition at line 343 of file implicit.c.
Referenced by inverse_fmatrix().
DO_INLINE void dfdv_damp | ( | float | to[3][3], |
float | dir[3], | ||
float | damping | ||
) |
Definition at line 1195 of file implicit.c.
References mul_fvectorT_fvectorS().
Referenced by cloth_calc_spring_force().
DO_INLINE void dfdx_damp | ( | float | to[3][3], |
float | dir[3], | ||
float | length, | ||
const float | vel[3], | ||
float | rest, | ||
float | damping | ||
) |
Definition at line 1215 of file implicit.c.
References INPR, MAX2, mul_fmatrix_S(), mul_fvectorT_fvector(), and sub_fmatrix_fmatrix().
DO_INLINE void dfdx_spring | ( | float | to[3][3], |
float | dir[3], | ||
float | length, | ||
float | L, | ||
float | k | ||
) |
Definition at line 1202 of file implicit.c.
References mul_fmatrix_S(), mul_fvectorT_fvector(), and sub_fmatrix_fmatrix().
Referenced by cloth_calc_spring_force().
DO_INLINE void dfdx_spring_type1 | ( | float | to[3][3], |
float | extent[3], | ||
float | length, | ||
float | L, | ||
float | dot, | ||
float | k | ||
) |
Definition at line 1166 of file implicit.c.
References add_fmatrix_fmatrix(), length(), mul_fmatrix_S(), mul_fvectorT_fvectorS(), and sub_fmatrix_fmatrix().
DO_INLINE void dfdx_spring_type2 | ( | float | to[3][3], |
float | dir[3], | ||
float | length, | ||
float | L, | ||
float | k, | ||
float | cb | ||
) |
Definition at line 1189 of file implicit.c.
References fbstar_jacobi(), and mul_fvectorT_fvectorS().
Referenced by cloth_calc_spring_force().
DO_INLINE float dot_lfvector | ( | float(*) | fLongVectorA[3], |
float(*) | fLongVectorB[3], | ||
unsigned int | verts | ||
) |
DO_INLINE float fb | ( | float | length, |
float | L | ||
) |
Definition at line 859 of file implicit.c.
Referenced by addAlphaLight(), LbmFsgrSolver::advanceParticles(), gjkepa2_impl::EPA::bind(), buf_rectfill_area(), fbstar(), fbstar_jacobi(), GPU_framebuffer_create(), GPU_framebuffer_texture_attach(), ray_trace(), and traceray().
DO_INLINE float fbderiv | ( | float | length, |
float | L | ||
) |
DO_INLINE float fbstar | ( | float | length, |
float | L, | ||
float | kb, | ||
float | cb | ||
) |
Definition at line 872 of file implicit.c.
Referenced by cloth_calc_spring_force(), and fbstar_jacobi().
DO_INLINE float fbstar_jacobi | ( | float | length, |
float | L, | ||
float | kb, | ||
float | cb | ||
) |
Definition at line 885 of file implicit.c.
References fb(), fbderiv(), fbstar(), and L.
Referenced by dfdx_spring_type2().
DO_INLINE void filter | ( | lfVector * | V, |
fmatrix3x3 * | S | ||
) |
Definition at line 900 of file implicit.c.
References mul_fvector_fmatrix(), and fmatrix3x3::vcount.
Referenced by achannel_setting_flush_widget_cb(), actkeys_framejump_exec(), actkeys_mselect_column(), actkeys_select_leftright(), actkeys_select_linked_exec(), ANIM_deselect_anim_channels(), ANIM_editkeyframes_refresh(), ANIM_sync_animchannels_to_data(), animchannels_delete_exec(), animchannels_enable_exec(), animchannels_rearrange_exec(), animchannels_visibility_set_exec(), animchannels_visibility_toggle_exec(), bake_graph_curves(), borderselect_action(), borderselect_anim_channels(), borderselect_graphkeys(), borderselect_nla_strips(), cg_filtered(), clean_action_keys(), clean_graph_keys(), columnselect_action_keys(), columnselect_graph_keys(), copy_action_keys(), copy_graph_keys(), createTransActionData(), createTransNlaData(), delete_action_keys(), delete_graph_keys(), deselect_action_keys(), deselect_graph_keys(), deselect_nla_strips(), draw_channel_names(), draw_channel_strips(), draw_nla_channel_list(), draw_nla_main_data(), duplicate_action_keys(), duplicate_graph_keys(), ED_nla_postop_refresh(), filelist_setfilter(), get_active_fcurve_channel(), get_graph_keyframe_extents(), get_keyframe_extents(), get_nearest_fcurve_verts_list(), get_nlastrip_extents(), graph_draw_channel_names(), graph_draw_curves(), graph_fmodifier_add_exec(), graph_fmodifier_paste_exec(), graph_refresh(), graphkeys_euler_filter_exec(), graphkeys_framejump_exec(), graphkeys_mselect_column(), graphkeys_select_leftright(), graphkeys_select_linked_exec(), graphkeys_smooth_exec(), graphop_editable_keyframes_poll(), graphop_selected_fcurve_poll(), graphop_visible_keyframes_poll(), IMB_filter_extend(), insert_action_keys(), insert_graph_keys(), markers_selectkeys_between(), mirror_action_keys(), mirror_graph_keys(), mouse_action_keys(), mouse_anim_channels(), mouse_graph_keys(), mouse_nla_channels(), mouse_nla_strips(), nla_fmodifier_add_exec(), nla_fmodifier_copy_exec(), nla_fmodifier_paste_exec(), nla_panel_context(), nlaedit_add_actionclip_exec(), nlaedit_add_meta_exec(), nlaedit_add_sound_exec(), nlaedit_add_tracks_exec(), nlaedit_add_transition_exec(), nlaedit_apply_scale_exec(), nlaedit_bake_exec(), nlaedit_clear_scale_exec(), nlaedit_delete_exec(), nlaedit_delete_tracks_exec(), nlaedit_disable_tweakmode_exec(), nlaedit_duplicate_exec(), nlaedit_enable_tweakmode_exec(), nlaedit_move_down_exec(), nlaedit_move_up_exec(), nlaedit_remove_meta_exec(), nlaedit_select_leftright(), nlaedit_snap_exec(), nlaedit_split_exec(), nlaedit_swap_exec(), nlaedit_sync_actlen_exec(), nlaedit_toggle_mute_exec(), ob_keyframes_loop(), ob_to_keylist(), paste_action_keys(), paste_graph_keys(), posttrans_action_clean(), rename_anim_channels(), RVBlurBitmap2_byte(), RVBlurBitmap2_float(), sample_action_keys(), sample_graph_keys(), scene_keyframes_loop(), scene_to_keylist(), select_moreless_action_keys(), select_moreless_graph_keys(), setexpo_action_keys(), setexpo_graph_keys(), setflag_anim_channels(), sethandles_action_keys(), sethandles_graph_keys(), setipo_action_keys(), setipo_graph_keys(), setkeytype_action_keys(), snap_action_keys(), snap_graph_keys(), special_aftertrans_update(), summary_keyframes_loop(), summary_to_keylist(), and KX_ConstraintActuator::Update().
static void hair_velocity_smoothing | ( | ClothModifierData * | clmd, |
lfVector * | lF, | ||
lfVector * | lX, | ||
lfVector * | lV, | ||
unsigned int | numverts | ||
) | [static] |
Definition at line 1433 of file implicit.c.
References MVert::co, ClothSimSettings::collider_friction, ColliderCache::collmd, HairGridVert::density, DO_MINMAX, ListBase::first, free_collider_cache(), get_collider_cache(), HAIR_GRID_INDEX, i, INIT_MINMAX, ColliderCache::next, NULL, CollisionModifierData::numverts, ClothModifierData::scene, ClothModifierData::sim_parms, VECSUB, HairGridVert::velocity, ClothSimSettings::velocity_smooth, CollisionModifierData::x, and CollisionModifierData::xnew.
Referenced by cloth_calc_force().
int implicit_free | ( | ClothModifierData * | clmd | ) |
Definition at line 821 of file implicit.c.
References Implicit_Data::A, Implicit_Data::B, Implicit_Data::bigI, ClothModifierData::clothObject, del_bfmatrix(), del_lfvector(), Implicit_Data::dFdV, Implicit_Data::dFdX, Implicit_Data::dV, Implicit_Data::F, Cloth::implicit, Implicit_Data::M, MEM_freeN(), Implicit_Data::olddV, Implicit_Data::P, Implicit_Data::Pinv, Implicit_Data::S, Implicit_Data::V, Implicit_Data::Vnew, Implicit_Data::X, Implicit_Data::Xnew, and Implicit_Data::z.
int implicit_init | ( | Object * | UNUSEDob, |
ClothModifierData * | clmd | ||
) |
Definition at line 733 of file implicit.c.
References Implicit_Data::A, Implicit_Data::bigI, CLOTH_VERT_FLAG_PINNED, ClothModifierData::clothObject, create_bfmatrix(), create_lfvector(), G, i, ClothSpring::ij, Cloth::implicit, initdiag_bfmatrix(), initdiag_fmatrixS(), ClothSpring::kl, LinkNode::link, fmatrix3x3::m, Implicit_Data::M, ClothVertex::mass, ClothSpring::matrix_index, MEM_callocN(), LinkNode::next, NULL, Cloth::numsprings, Cloth::numverts, Implicit_Data::olddV, Cloth::springs, VECCOPY, Cloth::verts, ClothVertex::x, Implicit_Data::X, and zero_lfvector().
void implicit_set_positions | ( | ClothModifierData * | clmd | ) |
Definition at line 1981 of file implicit.c.
References ClothModifierData::clothObject, G, i, Cloth::implicit, Cloth::numverts, ClothVertex::v, Implicit_Data::V, VECCOPY, Cloth::verts, ClothVertex::x, and Implicit_Data::X.
Referenced by cloth_from_object(), clothModifier_do(), and do_init_cloth().
int implicit_solver | ( | Object * | ob, |
float | frame, | ||
ClothModifierData * | clmd, | ||
ListBase * | effectors | ||
) |
Definition at line 1827 of file implicit.c.
References Implicit_Data::A, add_lfvector_lfvectorS(), Implicit_Data::B, Implicit_Data::bigI, Cloth::bvhtree, cloth_bvh_objcollision(), cloth_calc_force(), CLOTH_COLLSETTINGS_FLAG_ENABLED, CLOTH_SIMSETTINGS_FLAG_GOAL, CLOTH_VERT_FLAG_PINNED, ClothModifierData::clothObject, ClothModifierData::coll_parms, copy_v3_v3(), cp_lfvector(), Implicit_Data::dFdV, Implicit_Data::dFdX, Implicit_Data::dV, Implicit_Data::F, ClothCollSettings::flags, ClothVertex::flags, ClothSimSettings::flags, Cloth::implicit, Implicit_Data::M, MEM_callocN(), MEM_freeN(), mul_fvector_S(), mul_v3_fl(), Cloth::numverts, Implicit_Data::olddV, Implicit_Data::P, Implicit_Data::Pinv, Implicit_Data::S, ClothModifierData::sim_parms, simulate_implicit_euler(), step(), ClothSimSettings::stepsPerFrame, ClothSimSettings::timescale, ClothVertex::tv, ClothVertex::tx, Implicit_Data::V, VECADD, VECCOPY, VECSUB, Cloth::verts, Implicit_Data::Vnew, Implicit_Data::X, ClothVertex::xconst, Implicit_Data::Xnew, ClothVertex::xold, and Implicit_Data::z.
DO_INLINE void init_bfmatrix | ( | fmatrix3x3 * | matrix, |
float | m3[3][3] | ||
) |
Definition at line 554 of file implicit.c.
References cp_fmatrix(), i, fmatrix3x3::scount, and fmatrix3x3::vcount.
Referenced by cloth_calc_force().
DO_INLINE void init_lfvector | ( | float(*) | fLongVector[3], |
float | vector[3], | ||
unsigned int | verts | ||
) |
Definition at line 208 of file implicit.c.
Referenced by cloth_calc_force().
DO_INLINE void initdiag_bfmatrix | ( | fmatrix3x3 * | matrix, |
float | m3[3][3] | ||
) |
Definition at line 566 of file implicit.c.
References cp_fmatrix(), i, fmatrix3x3::scount, and fmatrix3x3::vcount.
Referenced by cloth_calc_force(), and implicit_init().
DO_INLINE void initdiag_fmatrixS | ( | float | to[3][3], |
float | aS | ||
) |
DO_INLINE void inverse_fmatrix | ( | float | to[3][3], |
float | from[3][3] | ||
) |
Definition at line 349 of file implicit.c.
References simple_enum_gen::d, det_fmatrix(), and i.
Referenced by BuildPPinv().
static void itend | ( | void | ) | [static] |
Definition at line 88 of file implicit.c.
Referenced by simulate_implicit_euler().
void itstart | ( | void | ) |
double itval | ( | void | ) |
Definition at line 92 of file implicit.c.
References _itend.
DO_INLINE void mul_bfmatrix_lfvector | ( | float(*) | to[3], |
fmatrix3x3 * | from, | ||
lfVector * | fLongVector | ||
) |
Definition at line 593 of file implicit.c.
References add_lfvector_lfvector(), create_lfvector(), del_lfvector(), muladd_fmatrix_fvector(), fmatrix3x3::scount, fmatrix3x3::vcount, and zero_lfvector().
Referenced by cg_filtered(), and simulate_implicit_euler().
DO_INLINE void mul_bfmatrix_S | ( | fmatrix3x3 * | matrix, |
float | scalar | ||
) |
Definition at line 582 of file implicit.c.
References mul_fmatrix_S(), fmatrix3x3::scount, and fmatrix3x3::vcount.
DO_INLINE void mul_fmatrix_fmatrix | ( | float | to[3][3], |
float | matrixA[3][3], | ||
float | matrixB[3][3] | ||
) |
Definition at line 408 of file implicit.c.
References mul_fvector_fmatrix().
DO_INLINE void mul_fmatrix_fvector | ( | float * | to, |
float | matrix[3][3], | ||
float * | from | ||
) |
Definition at line 400 of file implicit.c.
References INPR.
Referenced by cloth_calc_force(), and mul_prevfmatrix_lfvector().
DO_INLINE void mul_fmatrix_S | ( | float | matrix[3][3], |
float | scalar | ||
) |
Definition at line 382 of file implicit.c.
References mul_fvector_S().
Referenced by dfdx_damp(), dfdx_spring(), dfdx_spring_type1(), and mul_bfmatrix_S().
DO_INLINE void mul_fvector_fmatrix | ( | float * | to, |
float * | from, | ||
float | matrix[3][3] | ||
) |
Definition at line 391 of file implicit.c.
Referenced by filter(), and mul_fmatrix_fmatrix().
DO_INLINE void mul_fvector_S | ( | float | to[3], |
float | from[3], | ||
float | scalar | ||
) |
Definition at line 134 of file implicit.c.
Referenced by cloth_calc_force(), cloth_calc_spring_force(), implicit_solver(), mul_fmatrix_S(), mul_fvectorT_fvector(), mul_fvectorT_fvectorS(), and mul_lfvectorS().
DO_INLINE void mul_fvectorT_fvector | ( | float | to[3][3], |
float | vectorA[3], | ||
float | vectorB[3] | ||
) |
Definition at line 150 of file implicit.c.
References mul_fvector_S().
Referenced by dfdx_damp(), dfdx_spring(), and mul_fvectorT_fvectorS().
DO_INLINE void mul_fvectorT_fvectorS | ( | float | to[3][3], |
float | vectorA[3], | ||
float | vectorB[3], | ||
float | aS | ||
) |
Definition at line 158 of file implicit.c.
References mul_fvector_S(), and mul_fvectorT_fvector().
Referenced by dfdv_damp(), dfdx_spring_type1(), and dfdx_spring_type2().
DO_INLINE void mul_lfvectorS | ( | float(*) | to[3], |
float(*) | fLongVector[3], | ||
float | scalar, | ||
unsigned int | verts | ||
) |
Definition at line 222 of file implicit.c.
References i, and mul_fvector_S().
DO_INLINE void mul_prevfmatrix_lfvector | ( | float(*) | to[3], |
fmatrix3x3 * | from, | ||
lfVector * | fLongVector | ||
) |
Definition at line 627 of file implicit.c.
References mul_fmatrix_fvector(), and fmatrix3x3::vcount.
DO_INLINE void muladd_fmatrix_fmatrix | ( | float | to[3][3], |
float | matrixA[3][3], | ||
float | matrixB[3][3] | ||
) |
Definition at line 474 of file implicit.c.
References muladd_fvector_fmatrix().
DO_INLINE void muladd_fmatrix_fvector | ( | float | to[3], |
float | matrix[3][3], | ||
float | from[3] | ||
) |
DO_INLINE void muladd_fvector_fmatrix | ( | float | to[3], |
float | from[3], | ||
float | matrix[3][3] | ||
) |
Definition at line 467 of file implicit.c.
Referenced by muladd_fmatrix_fmatrix().
DO_INLINE void mulsub_fmatrix_fmatrix | ( | float | to[3][3], |
float | matrixA[3][3], | ||
float | matrixB[3][3] | ||
) |
Definition at line 488 of file implicit.c.
References mulsub_fvector_fmatrix().
DO_INLINE void mulsub_fmatrix_fvector | ( | float | to[3], |
float | matrix[3][3], | ||
float | from[3] | ||
) |
Definition at line 503 of file implicit.c.
References INPR.
DO_INLINE void mulsub_fvector_fmatrix | ( | float | to[3], |
float | from[3], | ||
float | matrix[3][3] | ||
) |
Definition at line 481 of file implicit.c.
Referenced by mulsub_fmatrix_fmatrix().
static void print_fvector | ( | float | m3[3] | ) | [static] |
Definition at line 169 of file implicit.c.
Referenced by print_lfvector().
DO_INLINE void print_lfvector | ( | float(*) | fLongVector[3], |
unsigned int | verts | ||
) |
Definition at line 178 of file implicit.c.
References i, and print_fvector().
static void simulate_implicit_euler | ( | lfVector * | Vnew, |
lfVector * | UNUSEDlX, | ||
lfVector * | lV, | ||
lfVector * | lF, | ||
fmatrix3x3 * | dFdV, | ||
fmatrix3x3 * | dFdX, | ||
float | dt, | ||
fmatrix3x3 * | A, | ||
lfVector * | B, | ||
lfVector * | dV, | ||
fmatrix3x3 * | S, | ||
lfVector * | z, | ||
lfVector * | olddV, | ||
fmatrix3x3 * | UNUSEDP, | ||
fmatrix3x3 * | UNUSEDPinv, | ||
fmatrix3x3 * | M, | ||
fmatrix3x3 * | UNUSEDbigI | ||
) | [static] |
Definition at line 1718 of file implicit.c.
References add_lfvector_lfvector(), add_lfvectorS_lfvectorS(), cg_filtered(), cp_bfmatrix(), cp_lfvector(), create_lfvector(), del_lfvector(), itend(), itstart(), mul_bfmatrix_lfvector(), subadd_bfmatrixS_bfmatrixS(), fmatrix3x3::vcount, and zero_lfvector().
Referenced by implicit_solver().
DO_INLINE void sub_bfmatrix_bfmatrix | ( | fmatrix3x3 * | to, |
fmatrix3x3 * | from, | ||
fmatrix3x3 * | matrix | ||
) |
Definition at line 674 of file implicit.c.
References fmatrix3x3::scount, sub_fmatrix_fmatrix(), and fmatrix3x3::vcount.
DO_INLINE void sub_bfmatrix_Smatrix | ( | fmatrix3x3 * | to, |
fmatrix3x3 * | from, | ||
fmatrix3x3 * | matrix | ||
) |
Definition at line 686 of file implicit.c.
References sub_fmatrix_fmatrix(), and fmatrix3x3::vcount.
DO_INLINE void sub_fmatrix_fmatrix | ( | float | to[3][3], |
float | matrixA[3][3], | ||
float | matrixB[3][3] | ||
) |
Definition at line 450 of file implicit.c.
References VECSUB.
Referenced by cloth_apply_spring_force(), dfdx_damp(), dfdx_spring(), dfdx_spring_type1(), sub_bfmatrix_bfmatrix(), and sub_bfmatrix_Smatrix().
DO_INLINE void sub_lfvector_lfvector | ( | float(*) | to[3], |
float(*) | fLongVectorA[3], | ||
float(*) | fLongVectorB[3], | ||
unsigned int | verts | ||
) |
DO_INLINE void sub_lfvector_lfvectorS | ( | float(*) | to[3], |
float(*) | fLongVectorA[3], | ||
float(*) | fLongVectorB[3], | ||
float | bS, | ||
unsigned int | verts | ||
) |
DO_INLINE void subadd_bfmatrix_bfmatrix | ( | fmatrix3x3 * | to, |
fmatrix3x3 * | from, | ||
fmatrix3x3 * | matrix | ||
) |
Definition at line 662 of file implicit.c.
References fmatrix3x3::scount, subadd_fmatrix_fmatrix(), and fmatrix3x3::vcount.
DO_INLINE void subadd_bfmatrixS_bfmatrixS | ( | fmatrix3x3 * | to, |
fmatrix3x3 * | from, | ||
float | aS, | ||
fmatrix3x3 * | matrix, | ||
float | bS | ||
) |
Definition at line 712 of file implicit.c.
References fmatrix3x3::scount, subadd_fmatrixS_fmatrixS(), and fmatrix3x3::vcount.
Referenced by simulate_implicit_euler().
DO_INLINE void subadd_fmatrix_fmatrix | ( | float | to[3][3], |
float | matrixA[3][3], | ||
float | matrixB[3][3] | ||
) |
Definition at line 436 of file implicit.c.
References VECSUBADD.
Referenced by subadd_bfmatrix_bfmatrix().
DO_INLINE void subadd_fmatrixS_fmatrixS | ( | float | to[3][3], |
float | matrixA[3][3], | ||
float | aS, | ||
float | matrixB[3][3], | ||
float | bS | ||
) |
Definition at line 443 of file implicit.c.
References VECSUBADDSS.
Referenced by subadd_bfmatrixS_bfmatrixS().
DO_INLINE void submul_lfvectorS | ( | float(*) | to[3], |
float(*) | fLongVector[3], | ||
float | scalar, | ||
unsigned int | verts | ||
) |
Definition at line 233 of file implicit.c.
Referenced by cloth_calc_force().
DO_INLINE void zero_lfvector | ( | float(*) | to[3], |
unsigned int | verts | ||
) |
Definition at line 217 of file implicit.c.
Referenced by implicit_init(), mul_bfmatrix_lfvector(), and simulate_implicit_euler().
struct timeval _itstart _itend [static] |
Definition at line 82 of file implicit.c.
float I[3][3] = {{1,0,0},{0,1,0},{0,0,1}} [static] |
Definition at line 101 of file implicit.c.
struct timezone itz [static] |
Definition at line 83 of file implicit.c.
float ZERO[3][3] = {{0,0,0}, {0,0,0}, {0,0,0}} [static] |
Definition at line 102 of file implicit.c.