Blender  V3.3
Classes | Macros | Typedefs | Enumerations | Functions
BKE_cloth.h File Reference
#include "BLI_math_inline.h"
#include <float.h>

Go to the source code of this file.

Classes

struct  ClothHairData
 
struct  ClothSolverResult
 
struct  Cloth
 
struct  ClothVertex
 
struct  ClothSpring
 
struct  ColliderContacts
 

Macros

#define DO_INLINE   MALWAYS_INLINE
 
#define SOFTGOALSNAP   0.999f
 
#define ALMOST_ZERO   FLT_EPSILON
 
#define VECSUBADDSS(v1, v2, aS, v3, bS)
 
#define VECADDSS(v1, v2, aS, v3, bS)
 
#define VECADDS(v1, v2, v3, bS)
 
#define VECSUBMUL(v1, v2, aS)
 
#define VECSUBS(v1, v2, v3, bS)
 
#define VECADDMUL(v1, v2, aS)
 

Typedefs

typedef enum eClothVertexFlag eClothVertexFlag
 
typedef struct ClothHairData ClothHairData
 
typedef struct ClothSolverResult ClothSolverResult
 
typedef struct Cloth Cloth
 
typedef struct ClothVertex ClothVertex
 
typedef struct ClothSpring ClothSpring
 
typedef struct ColliderContacts ColliderContacts
 

Enumerations

enum  eClothVertexFlag { CLOTH_VERT_FLAG_PINNED = (1 << 0) , CLOTH_VERT_FLAG_NOSELFCOLL = (1 << 1) , CLOTH_VERT_FLAG_NOOBJCOLL = (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) ,
  CLOTH_SPRING_TYPE_SEWING = (1 << 5) , CLOTH_SPRING_TYPE_BENDING_HAIR = (1 << 6) , CLOTH_SPRING_TYPE_INTERNAL = (1 << 7)
}
 
enum  CLOTH_SPRINGS_FLAGS { CLOTH_SPRING_FLAG_DEACTIVATE = (1 << 1) , CLOTH_SPRING_FLAG_NEEDED = (1 << 2) }
 

Functions

int cloth_bvh_collision (struct Depsgraph *depsgraph, struct Object *ob, struct ClothModifierData *clmd, float step, float dt)
 
void cloth_free_modifier_extern (struct ClothModifierData *clmd)
 
void cloth_free_modifier (struct ClothModifierData *clmd)
 
void clothModifier_do (struct ClothModifierData *clmd, struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob, struct Mesh *me, float(*vertexCos)[3])
 
int cloth_uses_vgroup (struct ClothModifierData *clmd)
 
void bvhtree_update_from_cloth (struct ClothModifierData *clmd, bool moving, bool self)
 
void cloth_clear_cache (struct Object *ob, struct ClothModifierData *clmd, float framenr)
 
void cloth_parallel_transport_hair_frame (float mat[3][3], const float dir_old[3], const float dir_new[3])
 

Macro Definition Documentation

◆ ALMOST_ZERO

#define ALMOST_ZERO   FLT_EPSILON

Definition at line 31 of file BKE_cloth.h.

◆ DO_INLINE

#define DO_INLINE   MALWAYS_INLINE

Definition at line 24 of file BKE_cloth.h.

◆ SOFTGOALSNAP

#define SOFTGOALSNAP   0.999f

Definition at line 27 of file BKE_cloth.h.

◆ VECADDMUL

#define VECADDMUL (   v1,
  v2,
  aS 
)
Value:
{ \
*(v1) += *(v2)*aS; \
*(v1 + 1) += *(v2 + 1) * aS; \
*(v1 + 2) += *(v2 + 2) * aS; \
} \
((void)0)
_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
ATTR_WARN_UNUSED_RESULT const BMVert * v2
SyclQueue void void size_t num_bytes void

Definition at line 173 of file BKE_cloth.h.

◆ VECADDS

#define VECADDS (   v1,
  v2,
  v3,
  bS 
)
Value:
{ \
*(v1) = *(v2) + *(v3)*bS; \
*(v1 + 1) = *(v2 + 1) + *(v3 + 1) * bS; \
*(v1 + 2) = *(v2 + 2) + *(v3 + 2) * bS; \
} \
((void)0)

Definition at line 152 of file BKE_cloth.h.

◆ VECADDSS

#define VECADDSS (   v1,
  v2,
  aS,
  v3,
  bS 
)
Value:
{ \
*(v1) = *(v2)*aS + *(v3)*bS; \
*(v1 + 1) = *(v2 + 1) * aS + *(v3 + 1) * bS; \
*(v1 + 2) = *(v2 + 2) * aS + *(v3 + 2) * bS; \
} \
((void)0)

Definition at line 145 of file BKE_cloth.h.

◆ VECSUBADDSS

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

Definition at line 138 of file BKE_cloth.h.

◆ VECSUBMUL

#define VECSUBMUL (   v1,
  v2,
  aS 
)
Value:
{ \
*(v1) -= *(v2)*aS; \
*(v1 + 1) -= *(v2 + 1) * aS; \
*(v1 + 2) -= *(v2 + 2) * aS; \
} \
((void)0)

Definition at line 159 of file BKE_cloth.h.

◆ VECSUBS

#define VECSUBS (   v1,
  v2,
  v3,
  bS 
)
Value:
{ \
*(v1) = *(v2) - *(v3)*bS; \
*(v1 + 1) = *(v2 + 1) - *(v3 + 1) * bS; \
*(v1 + 2) = *(v2 + 2) - *(v3 + 2) * bS; \
} \
((void)0)

Definition at line 166 of file BKE_cloth.h.

Typedef Documentation

◆ Cloth

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.

◆ ClothHairData

typedef struct ClothHairData ClothHairData

◆ ClothSolverResult

◆ ClothSpring

typedef struct ClothSpring ClothSpring

The definition of a spring.

◆ ClothVertex

typedef struct ClothVertex ClothVertex

The definition of a cloth vertex.

◆ ColliderContacts

◆ eClothVertexFlag

Enumeration Type Documentation

◆ CLOTH_SPRING_TYPES

Enumerator
CLOTH_SPRING_TYPE_STRUCTURAL 
CLOTH_SPRING_TYPE_SHEAR 
CLOTH_SPRING_TYPE_BENDING 
CLOTH_SPRING_TYPE_GOAL 
CLOTH_SPRING_TYPE_SEWING 
CLOTH_SPRING_TYPE_BENDING_HAIR 
CLOTH_SPRING_TYPE_INTERNAL 

Definition at line 182 of file BKE_cloth.h.

◆ CLOTH_SPRINGS_FLAGS

Enumerator
CLOTH_SPRING_FLAG_DEACTIVATE 
CLOTH_SPRING_FLAG_NEEDED 

Definition at line 193 of file BKE_cloth.h.

◆ eClothVertexFlag

Enumerator
CLOTH_VERT_FLAG_PINNED 
CLOTH_VERT_FLAG_NOSELFCOLL 
CLOTH_VERT_FLAG_NOOBJCOLL 

Definition at line 34 of file BKE_cloth.h.

Function Documentation

◆ bvhtree_update_from_cloth()

void bvhtree_update_from_cloth ( struct ClothModifierData clmd,
bool  moving,
bool  self 
)

◆ cloth_bvh_collision()

int cloth_bvh_collision ( struct Depsgraph depsgraph,
struct Object ob,
struct ClothModifierData clmd,
float  step,
float  dt 
)

◆ cloth_clear_cache()

void cloth_clear_cache ( struct Object ob,
struct ClothModifierData clmd,
float  framenr 
)

◆ cloth_free_modifier()

void cloth_free_modifier ( struct ClothModifierData clmd)

◆ cloth_free_modifier_extern()

void cloth_free_modifier_extern ( struct ClothModifierData clmd)

◆ cloth_parallel_transport_hair_frame()

void cloth_parallel_transport_hair_frame ( float  mat[3][3],
const float  dir_old[3],
const float  dir_new[3] 
)

◆ cloth_uses_vgroup()

int cloth_uses_vgroup ( struct ClothModifierData clmd)

◆ clothModifier_do()

void clothModifier_do ( struct ClothModifierData clmd,
struct Depsgraph depsgraph,
struct Scene scene,
struct Object ob,
struct Mesh me,
float(*)  vertexCos[3] 
)