Blender V2.61 - r43446
Classes | Defines | Typedefs | Enumerations | Functions

BKE_cloth.h File Reference

#include <float.h>
#include "BLI_math_inline.h"

Go to the source code of this file.

Classes

struct  Cloth
struct  ClothVertex
struct  ClothSpring
struct  CM_SOLVER_DEF

Defines

#define DO_INLINE   MALWAYS_INLINE
#define CLOTH_MAX_THREAD   2
#define SOFTGOALSNAP   0.999f
#define ALMOST_ZERO   FLT_EPSILON
#define CLOTH_VERT_FLAG_PINNED   1
#define CLOTH_VERT_FLAG_COLLISION   2
#define CLOTH_VERT_FLAG_PINNED_EM   3
#define VECADDADD(v1, v2, v3)   {*(v1)+= *(v2) + *(v3); *(v1+1)+= *(v2+1) + *(v3+1); *(v1+2)+= *(v2+2) + *(v3+2);}
#define VECSUBADD(v1, v2, v3)   {*(v1)-= *(v2) + *(v3); *(v1+1)-= *(v2+1) + *(v3+1); *(v1+2)-= *(v2+2) + *(v3+2);}
#define VECADDSUB(v1, v2, v3)   {*(v1)+= *(v2) - *(v3); *(v1+1)+= *(v2+1) - *(v3+1); *(v1+2)+= *(v2+2) - *(v3+2);}
#define VECSUBADDSS(v1, v2, aS, v3, bS)   {*(v1)-= *(v2)*aS + *(v3)*bS; *(v1+1)-= *(v2+1)*aS + *(v3+1)*bS; *(v1+2)-= *(v2+2)*aS + *(v3+2)*bS;}
#define VECADDSUBSS(v1, v2, aS, v3, bS)   {*(v1)+= *(v2)*aS - *(v3)*bS; *(v1+1)+= *(v2+1)*aS - *(v3+1)*bS; *(v1+2)+= *(v2+2)*aS - *(v3+2)*bS;}
#define VECADDSS(v1, v2, aS, v3, bS)   {*(v1)= *(v2)*aS + *(v3)*bS; *(v1+1)= *(v2+1)*aS + *(v3+1)*bS; *(v1+2)= *(v2+2)*aS + *(v3+2)*bS;}
#define VECADDS(v1, v2, v3, bS)   {*(v1)= *(v2) + *(v3)*bS; *(v1+1)= *(v2+1) + *(v3+1)*bS; *(v1+2)= *(v2+2) + *(v3+2)*bS;}
#define VECSUBMUL(v1, v2, aS)   {*(v1)-= *(v2) * aS; *(v1+1)-= *(v2+1) * aS; *(v1+2)-= *(v2+2) * aS;}
#define VECSUBS(v1, v2, v3, bS)   {*(v1)= *(v2) - *(v3)*bS; *(v1+1)= *(v2+1) - *(v3+1)*bS; *(v1+2)= *(v2+2) - *(v3+2)*bS;}
#define VECSUBSB(v1, v2, v3, bS)   {*(v1)= (*(v2)- *(v3))*bS; *(v1+1)= (*(v2+1) - *(v3+1))*bS; *(v1+2)= (*(v2+2) - *(v3+2))*bS;}
#define VECMULS(v1, aS)   {*(v1)*= aS; *(v1+1)*= aS; *(v1+2)*= *aS;}
#define VECADDMUL(v1, v2, aS)   {*(v1)+= *(v2) * aS; *(v1+1)+= *(v2+1) * aS; *(v1+2)+= *(v2+2) * aS;}

Typedefs

typedef struct Cloth Cloth
typedef struct ClothVertex ClothVertex
typedef struct ClothSpring ClothSpring

Enumerations

enum  CLOTH_SIMSETTINGS_FLAGS {
  CLOTH_SIMSETTINGS_FLAG_COLLOBJ = ( 1 << 2 ), CLOTH_SIMSETTINGS_FLAG_GOAL = ( 1 << 3 ), CLOTH_SIMSETTINGS_FLAG_TEARING = ( 1 << 4 ), CLOTH_SIMSETTINGS_FLAG_SCALING = ( 1 << 8 ),
  CLOTH_SIMSETTINGS_FLAG_CCACHE_EDIT = (1 << 12), CLOTH_SIMSETTINGS_FLAG_NO_SPRING_COMPRESS = (1 << 13)
}
enum  CLOTH_COLLISIONSETTINGS_FLAGS { CLOTH_COLLSETTINGS_FLAG_ENABLED = ( 1 << 1 ), CLOTH_COLLSETTINGS_FLAG_SELF = ( 1 << 2 ) }
enum  CLOTH_SPRING_TYPES { CLOTH_SPRING_TYPE_STRUCTURAL = ( 1 << 1 ), CLOTH_SPRING_TYPE_SHEAR = ( 1 << 2 ), CLOTH_SPRING_TYPE_BENDING = ( 1 << 3 ), CLOTH_SPRING_TYPE_GOAL = ( 1 << 4 ) }
enum  CLOTH_SPRINGS_FLAGS { CLOTH_SPRING_FLAG_DEACTIVATE = ( 1 << 1 ), CLOTH_SPRING_FLAG_NEEDED = ( 1 << 2 ) }
enum  CM_SOLVER_ID { CM_IMPLICIT = 0 }

Functions

int cloth_bvh_objcollision (struct Object *ob, struct ClothModifierData *clmd, float step, float dt)
int implicit_init (struct Object *ob, struct ClothModifierData *clmd)
int implicit_free (struct ClothModifierData *clmd)
int implicit_solver (struct Object *ob, float frame, struct ClothModifierData *clmd, struct ListBase *effectors)
void implicit_set_positions (struct ClothModifierData *clmd)
void clmdSetInterruptCallBack (int(*f)(void))
void cloth_free_modifier_extern (struct ClothModifierData *clmd)
void cloth_free_modifier (struct ClothModifierData *clmd)
void cloth_init (struct ClothModifierData *clmd)
struct DerivedMeshclothModifier_do (struct ClothModifierData *clmd, struct Scene *scene, struct Object *ob, struct DerivedMesh *dm)
void cloth_update_normals (ClothVertex *verts, int nVerts, struct MFace *face, int totface)
int cloth_uses_vgroup (struct ClothModifierData *clmd)
void bvhtree_update_from_cloth (struct ClothModifierData *clmd, int moving)
void bvhselftree_update_from_cloth (struct ClothModifierData *clmd, int moving)
void cloth_clear_cache (struct Object *ob, struct ClothModifierData *clmd, float framenr)
int cloth_add_spring (struct ClothModifierData *clmd, unsigned int indexA, unsigned int indexB, float restlength, int spring_type)

Detailed Description

Author:
Daniel Genrich

Definition in file BKE_cloth.h.


Define Documentation

#define ALMOST_ZERO   FLT_EPSILON
#define CLOTH_MAX_THREAD   2

Definition at line 48 of file BKE_cloth.h.

#define CLOTH_VERT_FLAG_COLLISION   2

Definition at line 59 of file BKE_cloth.h.

#define CLOTH_VERT_FLAG_PINNED   1
#define CLOTH_VERT_FLAG_PINNED_EM   3

Definition at line 60 of file BKE_cloth.h.

#define DO_INLINE   MALWAYS_INLINE

Definition at line 46 of file BKE_cloth.h.

#define SOFTGOALSNAP   0.999f

Definition at line 51 of file BKE_cloth.h.

Referenced by cloth_apply_vgroup().

#define VECADDADD (   v1,
  v2,
  v3 
)    {*(v1)+= *(v2) + *(v3); *(v1+1)+= *(v2+1) + *(v3+1); *(v1+2)+= *(v2+2) + *(v3+2);}

Definition at line 137 of file BKE_cloth.h.

Referenced by addadd_fmatrix_fmatrix().

#define VECADDMUL (   v1,
  v2,
  aS 
)    {*(v1)+= *(v2) * aS; *(v1+1)+= *(v2+1) * aS; *(v1+2)+= *(v2+2) * aS;}
#define VECADDS (   v1,
  v2,
  v3,
  bS 
)    {*(v1)= *(v2) + *(v3)*bS; *(v1+1)= *(v2+1) + *(v3+1)*bS; *(v1+2)= *(v2+2) + *(v3+2)*bS;}
#define VECADDSS (   v1,
  v2,
  aS,
  v3,
  bS 
)    {*(v1)= *(v2)*aS + *(v3)*bS; *(v1+1)= *(v2+1)*aS + *(v3+1)*bS; *(v1+2)= *(v2+2)*aS + *(v3+2)*bS;}

Definition at line 142 of file BKE_cloth.h.

Referenced by add_lfvectorS_lfvectorS().

#define VECADDSUB (   v1,
  v2,
  v3 
)    {*(v1)+= *(v2) - *(v3); *(v1+1)+= *(v2+1) - *(v3+1); *(v1+2)+= *(v2+2) - *(v3+2);}

Definition at line 139 of file BKE_cloth.h.

Referenced by addsub_fmatrix_fmatrix().

#define VECADDSUBSS (   v1,
  v2,
  aS,
  v3,
  bS 
)    {*(v1)+= *(v2)*aS - *(v3)*bS; *(v1+1)+= *(v2+1)*aS - *(v3+1)*bS; *(v1+2)+= *(v2+2)*aS - *(v3+2)*bS;}

Definition at line 141 of file BKE_cloth.h.

Referenced by addsub_fmatrixS_fmatrixS().

#define VECMULS (   v1,
  aS 
)    {*(v1)*= aS; *(v1+1)*= aS; *(v1+2)*= *aS;}

Definition at line 147 of file BKE_cloth.h.

#define VECSUBADD (   v1,
  v2,
  v3 
)    {*(v1)-= *(v2) + *(v3); *(v1+1)-= *(v2+1) + *(v3+1); *(v1+2)-= *(v2+2) + *(v3+2);}

Definition at line 138 of file BKE_cloth.h.

Referenced by subadd_fmatrix_fmatrix().

#define VECSUBADDSS (   v1,
  v2,
  aS,
  v3,
  bS 
)    {*(v1)-= *(v2)*aS + *(v3)*bS; *(v1+1)-= *(v2+1)*aS + *(v3+1)*bS; *(v1+2)-= *(v2+2)*aS + *(v3+2)*bS;}

Definition at line 140 of file BKE_cloth.h.

Referenced by subadd_fmatrixS_fmatrixS().

#define VECSUBMUL (   v1,
  v2,
  aS 
)    {*(v1)-= *(v2) * aS; *(v1+1)-= *(v2+1) * aS; *(v1+2)-= *(v2+2) * aS;}

Definition at line 144 of file BKE_cloth.h.

Referenced by submul_lfvectorS().

#define VECSUBS (   v1,
  v2,
  v3,
  bS 
)    {*(v1)= *(v2) - *(v3)*bS; *(v1+1)= *(v2+1) - *(v3+1)*bS; *(v1+2)= *(v2+2) - *(v3+2)*bS;}

Definition at line 145 of file BKE_cloth.h.

Referenced by sub_lfvector_lfvectorS().

#define VECSUBSB (   v1,
  v2,
  v3,
  bS 
)    {*(v1)= (*(v2)- *(v3))*bS; *(v1+1)= (*(v2+1) - *(v3+1))*bS; *(v1+2)= (*(v2+2) - *(v3+2))*bS;}

Definition at line 146 of file BKE_cloth.h.


Typedef Documentation

typedef struct Cloth Cloth

This structure describes a cloth object against which the simulation can run.

The m and n members of this structure represent the assumed rectangular ordered grid for which the original paper is written. At some point they need to disappear and we need to determine out own connectivity of the mesh based on the actual edges in the mesh.

typedef struct ClothSpring ClothSpring

The definition of a spring.

typedef struct ClothVertex ClothVertex

The definition of a cloth vertex.


Enumeration Type Documentation

Enumerator:
CLOTH_COLLSETTINGS_FLAG_ENABLED 
CLOTH_COLLSETTINGS_FLAG_SELF 

Definition at line 163 of file BKE_cloth.h.

Enumerator:
CLOTH_SIMSETTINGS_FLAG_COLLOBJ 
CLOTH_SIMSETTINGS_FLAG_GOAL 
CLOTH_SIMSETTINGS_FLAG_TEARING 
CLOTH_SIMSETTINGS_FLAG_SCALING 
CLOTH_SIMSETTINGS_FLAG_CCACHE_EDIT 
CLOTH_SIMSETTINGS_FLAG_NO_SPRING_COMPRESS 

Definition at line 152 of file BKE_cloth.h.

Enumerator:
CLOTH_SPRING_TYPE_STRUCTURAL 
CLOTH_SPRING_TYPE_SHEAR 
CLOTH_SPRING_TYPE_BENDING 
CLOTH_SPRING_TYPE_GOAL 

Definition at line 170 of file BKE_cloth.h.

Enumerator:
CLOTH_SPRING_FLAG_DEACTIVATE 
CLOTH_SPRING_FLAG_NEEDED 

Definition at line 179 of file BKE_cloth.h.

Enumerator:
CM_IMPLICIT 

Definition at line 239 of file BKE_cloth.h.


Function Documentation

void bvhselftree_update_from_cloth ( struct ClothModifierData clmd,
int  moving 
)
void bvhtree_update_from_cloth ( struct ClothModifierData clmd,
int  moving 
)
void clmdSetInterruptCallBack ( int(*)(void)  f)
int cloth_add_spring ( struct ClothModifierData clmd,
unsigned int  indexA,
unsigned int  indexB,
float  restlength,
int  spring_type 
)
int cloth_bvh_objcollision ( struct Object ob,
struct ClothModifierData clmd,
float  step,
float  dt 
)
void cloth_clear_cache ( struct Object ob,
struct ClothModifierData clmd,
float  framenr 
)
void cloth_free_modifier ( struct ClothModifierData clmd)
void cloth_free_modifier_extern ( struct ClothModifierData clmd)
void cloth_init ( ClothModifierData clmd)
void cloth_update_normals ( ClothVertex verts,
int  nVerts,
struct MFace face,
int  totface 
)
int cloth_uses_vgroup ( struct ClothModifierData clmd)
struct DerivedMesh* clothModifier_do ( struct ClothModifierData clmd,
struct Scene scene,
struct Object ob,
struct DerivedMesh dm 
) [read]
int implicit_free ( struct ClothModifierData clmd)
int implicit_init ( struct Object ob,
struct ClothModifierData clmd 
)
void implicit_set_positions ( struct ClothModifierData clmd)
int implicit_solver ( struct Object ob,
float  frame,
struct ClothModifierData clmd,
struct ListBase effectors 
)