diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 07:17:24 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 07:21:24 +0300 |
commit | e12c08e8d170b7ca40f204a5b0423c23a9fbc2c1 (patch) | |
tree | 8cf3453d12edb177a218ef8009357518ec6cab6a /source/blender/blenkernel/BKE_collision.h | |
parent | b3dabc200a4b0399ec6b81f2ff2730d07b44fcaa (diff) |
ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211.
For details on usage and instructions for migrating branches
without conflicts, see:
https://wiki.blender.org/wiki/Tools/ClangFormat
Diffstat (limited to 'source/blender/blenkernel/BKE_collision.h')
-rw-r--r-- | source/blender/blenkernel/BKE_collision.h | 136 |
1 files changed, 64 insertions, 72 deletions
diff --git a/source/blender/blenkernel/BKE_collision.h b/source/blender/blenkernel/BKE_collision.h index 2acef14f766..291502a0c28 100644 --- a/source/blender/blenkernel/BKE_collision.h +++ b/source/blender/blenkernel/BKE_collision.h @@ -49,67 +49,61 @@ struct Scene; /* COLLISION FLAGS */ typedef enum { - COLLISION_IN_FUTURE = (1 << 1), + COLLISION_IN_FUTURE = (1 << 1), #ifdef WITH_ELTOPO - COLLISION_USE_COLLFACE = (1 << 2), - COLLISION_IS_EDGES = (1 << 3), + COLLISION_USE_COLLFACE = (1 << 2), + COLLISION_IS_EDGES = (1 << 3), #endif - COLLISION_INACTIVE = (1 << 4), + COLLISION_INACTIVE = (1 << 4), } COLLISION_FLAGS; - //////////////////////////////////////// // used for collisions in collision.c //////////////////////////////////////// /* used for collisions in collision.c */ typedef struct CollPair { - unsigned int face1; // cloth face - unsigned int face2; // object face - float distance; - float normal[3]; - float vector[3]; // unnormalized collision vector: p2-p1 - float pa[3], pb[3]; // collision point p1 on face1, p2 on face2 - int flag; - float time; // collision time, from 0 up to 1 - - /* mesh-mesh collision */ + unsigned int face1; // cloth face + unsigned int face2; // object face + float distance; + float normal[3]; + float vector[3]; // unnormalized collision vector: p2-p1 + float pa[3], pb[3]; // collision point p1 on face1, p2 on face2 + int flag; + float time; // collision time, from 0 up to 1 + + /* mesh-mesh collision */ #ifdef WITH_ELTOPO /*either ap* or bp* can be set, but not both*/ - float bary[3]; - int ap1, ap2, ap3, collp, bp1, bp2, bp3; - int collface; + float bary[3]; + int ap1, ap2, ap3, collp, bp1, bp2, bp3; + int collface; #else - int ap1, ap2, ap3, bp1, bp2, bp3; + int ap1, ap2, ap3, bp1, bp2, bp3; #endif - int pointsb[4]; -} -CollPair; + int pointsb[4]; +} CollPair; /* used for collisions in collision.c */ typedef struct EdgeCollPair { - unsigned int p11, p12, p21, p22; - float normal[3]; - float vector[3]; - float time; - int lastsign; - float pa[3], pb[3]; // collision point p1 on face1, p2 on face2 -} -EdgeCollPair; + unsigned int p11, p12, p21, p22; + float normal[3]; + float vector[3]; + float time; + int lastsign; + float pa[3], pb[3]; // collision point p1 on face1, p2 on face2 +} EdgeCollPair; /* used for collisions in collision.c */ typedef struct FaceCollPair { - unsigned int p11, p12, p13, p21; - float normal[3]; - float vector[3]; - float time; - int lastsign; - float pa[3], pb[3]; // collision point p1 on face1, p2 on face2 -} -FaceCollPair; + unsigned int p11, p12, p13, p21; + float normal[3]; + float vector[3]; + float time; + int lastsign; + float pa[3], pb[3]; // collision point p1 on face1, p2 on face2 +} FaceCollPair; //////////////////////////////////////// - - ///////////////////////////////////////////////// // forward declarations ///////////////////////////////////////////////// @@ -118,15 +112,16 @@ FaceCollPair; // used in modifier.c from collision.c ///////////////////////////////////////////////// -BVHTree *bvhtree_build_from_mvert( - const struct MVert *mvert, - const struct MVertTri *tri, int tri_num, - float epsilon); -void bvhtree_update_from_mvert( - BVHTree *bvhtree, - const struct MVert *mvert, const struct MVert *mvert_moving, - const struct MVertTri *tri, int tri_num, - bool moving); +BVHTree *bvhtree_build_from_mvert(const struct MVert *mvert, + const struct MVertTri *tri, + int tri_num, + float epsilon); +void bvhtree_update_from_mvert(BVHTree *bvhtree, + const struct MVert *mvert, + const struct MVert *mvert_moving, + const struct MVertTri *tri, + int tri_num, + bool moving); ///////////////////////////////////////////////// @@ -134,48 +129,45 @@ void bvhtree_update_from_mvert( // defined in collisions.c void collision_move_object(struct CollisionModifierData *collmd, float step, float prevstep); -void collision_get_collider_velocity(float vel_old[3], float vel_new[3], struct CollisionModifierData *collmd, struct CollPair *collpair); - +void collision_get_collider_velocity(float vel_old[3], + float vel_new[3], + struct CollisionModifierData *collmd, + struct CollPair *collpair); /* Collision relations for dependency graph build. */ typedef struct CollisionRelation { - struct CollisionRelation *next, *prev; - struct Object *ob; + struct CollisionRelation *next, *prev; + struct Object *ob; } CollisionRelation; -struct ListBase *BKE_collision_relations_create( - struct Depsgraph *depsgraph, - struct Collection *collection, - unsigned int modifier_type); +struct ListBase *BKE_collision_relations_create(struct Depsgraph *depsgraph, + struct Collection *collection, + unsigned int modifier_type); void BKE_collision_relations_free(struct ListBase *relations); /* Collision object lists for physics simulation evaluation. */ -struct Object **BKE_collision_objects_create( - struct Depsgraph *depsgraph, - struct Object *self, - struct Collection *collection, - unsigned int *numcollobj, - unsigned int modifier_type); +struct Object **BKE_collision_objects_create(struct Depsgraph *depsgraph, + struct Object *self, + struct Collection *collection, + unsigned int *numcollobj, + unsigned int modifier_type); void BKE_collision_objects_free(struct Object **objects); typedef struct ColliderCache { - struct ColliderCache *next, *prev; - struct Object *ob; - struct CollisionModifierData *collmd; + struct ColliderCache *next, *prev; + struct Object *ob; + struct CollisionModifierData *collmd; } ColliderCache; -struct ListBase *BKE_collider_cache_create( - struct Depsgraph *scene, - struct Object *self, - struct Collection *collection); +struct ListBase *BKE_collider_cache_create(struct Depsgraph *scene, + struct Object *self, + struct Collection *collection); void BKE_collider_cache_free(struct ListBase **colliders); ///////////////////////////////////////////////// - - ///////////////////////////////////////////////// #endif |