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_rigidbody.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_rigidbody.h')
-rw-r--r-- | source/blender/blenkernel/BKE_rigidbody.h | 52 |
1 files changed, 37 insertions, 15 deletions
diff --git a/source/blender/blenkernel/BKE_rigidbody.h b/source/blender/blenkernel/BKE_rigidbody.h index 4c644ee43fc..72bc95028da 100644 --- a/source/blender/blenkernel/BKE_rigidbody.h +++ b/source/blender/blenkernel/BKE_rigidbody.h @@ -22,7 +22,6 @@ * \brief API for Blender-side Rigid Body stuff */ - #ifndef __BKE_RIGIDBODY_H__ #define __BKE_RIGIDBODY_H__ @@ -48,31 +47,45 @@ struct RigidBodyOb *BKE_rigidbody_copy_object(const struct Object *ob, const int struct RigidBodyCon *BKE_rigidbody_copy_constraint(const struct Object *ob, const int flag); /* Callback format for performing operations on ID-pointers for rigidbody world. */ -typedef void (*RigidbodyWorldIDFunc)(struct RigidBodyWorld *rbw, struct ID **idpoin, void *userdata, int cb_flag); +typedef void (*RigidbodyWorldIDFunc)(struct RigidBodyWorld *rbw, + struct ID **idpoin, + void *userdata, + int cb_flag); -void BKE_rigidbody_world_id_loop(struct RigidBodyWorld *rbw, RigidbodyWorldIDFunc func, void *userdata); +void BKE_rigidbody_world_id_loop(struct RigidBodyWorld *rbw, + RigidbodyWorldIDFunc func, + void *userdata); /* -------------- */ /* Setup */ /* create Blender-side settings data - physics objects not initialized yet */ struct RigidBodyWorld *BKE_rigidbody_create_world(struct Scene *scene); -struct RigidBodyOb *BKE_rigidbody_create_object(struct Scene *scene, struct Object *ob, short type); -struct RigidBodyCon *BKE_rigidbody_create_constraint(struct Scene *scene, struct Object *ob, short type); +struct RigidBodyOb *BKE_rigidbody_create_object(struct Scene *scene, + struct Object *ob, + short type); +struct RigidBodyCon *BKE_rigidbody_create_constraint(struct Scene *scene, + struct Object *ob, + short type); /* Ensure newly set collections' objects all have required data. */ void BKE_rigidbody_objects_collection_validate(struct Scene *scene, struct RigidBodyWorld *rbw); -void BKE_rigidbody_constraints_collection_validate(struct Scene *scene, struct RigidBodyWorld *rbw); +void BKE_rigidbody_constraints_collection_validate(struct Scene *scene, + struct RigidBodyWorld *rbw); /* Ensure object added to collection gets RB data if that collection is a RB one. */ -void BKE_rigidbody_main_collection_object_add(struct Main *bmain, struct Collection *collection, struct Object *object); +void BKE_rigidbody_main_collection_object_add(struct Main *bmain, + struct Collection *collection, + struct Object *object); /* copy */ struct RigidBodyWorld *BKE_rigidbody_world_copy(struct RigidBodyWorld *rbw, const int flag); void BKE_rigidbody_world_groups_relink(struct RigidBodyWorld *rbw); /* 'validate' (i.e. make new or replace old) Physics-Engine objects */ -void BKE_rigidbody_validate_sim_world(struct Scene *scene, struct RigidBodyWorld *rbw, bool rebuild); +void BKE_rigidbody_validate_sim_world(struct Scene *scene, + struct RigidBodyWorld *rbw, + bool rebuild); void BKE_rigidbody_calc_volume(struct Object *ob, float *r_vol); void BKE_rigidbody_calc_center_of_mass(struct Object *ob, float r_center[3]); @@ -89,15 +102,26 @@ void BKE_rigidbody_remove_constraint(struct Scene *scene, struct Object *ob); /* get mass of Rigid Body Object to supply to RigidBody simulators */ #define RBO_GET_MASS(rbo) \ - ((rbo && ((rbo->type == RBO_TYPE_PASSIVE) || (rbo->flag & RBO_FLAG_KINEMATIC) || (rbo->flag & RBO_FLAG_DISABLED))) ? (0.0f) : (rbo->mass)) + ((rbo && ((rbo->type == RBO_TYPE_PASSIVE) || (rbo->flag & RBO_FLAG_KINEMATIC) || \ + (rbo->flag & RBO_FLAG_DISABLED))) ? \ + (0.0f) : \ + (rbo->mass)) /* get collision margin for Rigid Body Object, triangle mesh and cone shapes cannot embed margin, convex hull always uses custom margin */ #define RBO_GET_MARGIN(rbo) \ - ((rbo->flag & RBO_FLAG_USE_MARGIN || rbo->shape == RB_SHAPE_CONVEXH || rbo->shape == RB_SHAPE_TRIMESH || rbo->shape == RB_SHAPE_CONE) ? (rbo->margin) : (0.04f)) + ((rbo->flag & RBO_FLAG_USE_MARGIN || rbo->shape == RB_SHAPE_CONVEXH || \ + rbo->shape == RB_SHAPE_TRIMESH || rbo->shape == RB_SHAPE_CONE) ? \ + (rbo->margin) : \ + (0.04f)) /* -------------- */ /* Simulation */ -void BKE_rigidbody_aftertrans_update(struct Object *ob, float loc[3], float rot[3], float quat[4], float rotAxis[3], float rotAngle); +void BKE_rigidbody_aftertrans_update(struct Object *ob, + float loc[3], + float rot[3], + float quat[4], + float rotAxis[3], + float rotAngle); void BKE_rigidbody_sync_transforms(struct RigidBodyWorld *rbw, struct Object *ob, float ctime); bool BKE_rigidbody_check_sim_running(struct RigidBodyWorld *rbw, float ctime); void BKE_rigidbody_cache_reset(struct RigidBodyWorld *rbw); @@ -107,11 +131,9 @@ void BKE_rigidbody_do_simulation(struct Depsgraph *depsgraph, struct Scene *scen /* -------------------- */ /* Depsgraph evaluation */ -void BKE_rigidbody_rebuild_sim(struct Depsgraph *depsgraph, - struct Scene *scene); +void BKE_rigidbody_rebuild_sim(struct Depsgraph *depsgraph, struct Scene *scene); -void BKE_rigidbody_eval_simulation(struct Depsgraph *depsgraph, - struct Scene *scene); +void BKE_rigidbody_eval_simulation(struct Depsgraph *depsgraph, struct Scene *scene); void BKE_rigidbody_object_sync_transforms(struct Depsgraph *depsgraph, struct Scene *scene, |