|
Blender V4.5
|
#include "BLI_math_vector_types.hh"Go to the source code of this file.
Classes | |
| struct | CollPair |
| struct | EdgeCollPair |
| struct | FaceCollPair |
| struct | CollisionRelation |
| struct | ColliderCache |
Typedefs | |
| typedef struct CollPair | CollPair |
| typedef struct EdgeCollPair | EdgeCollPair |
| typedef struct FaceCollPair | FaceCollPair |
| typedef struct CollisionRelation | CollisionRelation |
| typedef struct ColliderCache | ColliderCache |
Enumerations | |
| enum | COLLISION_FLAGS { COLLISION_IN_FUTURE = (1 << 1) , COLLISION_INACTIVE = (1 << 4) } |
Functions | |
| struct BVHTree * | bvhtree_build_from_mvert (const float(*positions)[3], const blender::int3 *vert_tris, int tri_num, float epsilon) |
| void | bvhtree_update_from_mvert (struct BVHTree *bvhtree, const float(*positions)[3], const float(*positions_moving)[3], const blender::int3 *vert_tris, int tri_num, bool moving) |
| void | collision_move_object (struct CollisionModifierData *collmd, float step, float prevstep, bool moving_bvh) |
| void | collision_get_collider_velocity (float vel_old[3], float vel_new[3], struct CollisionModifierData *collmd, struct CollPair *collpair) |
| struct ListBase * | BKE_collision_relations_create (struct Depsgraph *depsgraph, struct Collection *collection, unsigned int modifier_type) |
| void | BKE_collision_relations_free (struct ListBase *relations) |
| 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) |
| struct ListBase * | BKE_collider_cache_create (struct Depsgraph *depsgraph, struct Object *self, struct Collection *collection) |
| void | BKE_collider_cache_free (struct ListBase **colliders) |
| typedef struct ColliderCache ColliderCache |
| typedef struct CollisionRelation CollisionRelation |
| typedef struct CollPair CollPair |
| typedef struct EdgeCollPair EdgeCollPair |
| typedef struct FaceCollPair FaceCollPair |
| enum COLLISION_FLAGS |
| Enumerator | |
|---|---|
| COLLISION_IN_FUTURE | |
| COLLISION_INACTIVE | |
Definition at line 23 of file BKE_collision.h.
| struct ListBase * BKE_collider_cache_create | ( | struct Depsgraph * | depsgraph, |
| struct Object * | self, | ||
| struct Collection * | collection ) |
Create effective list of colliders from relations built beforehand. Self will be excluded.
Definition at line 1328 of file collision.cc.
References BKE_collider_cache_create(), BKE_modifiers_findby_type(), BLI_addtail(), CollisionModifierData::bvhtree, collision_move_object(), ColliderCache::collmd, DEG_get_collision_relations(), DEG_get_evaluated(), eModifierType_Collision, LISTBASE_FOREACH, MEM_callocN(), and ColliderCache::ob.
Referenced by BKE_collider_cache_create(), dynamics_step(), and eff_calc_visibility().
| void BKE_collider_cache_free | ( | struct ListBase ** | colliders | ) |
Definition at line 1365 of file collision.cc.
References BKE_collider_cache_free(), BLI_freelistN(), and MEM_freeN().
Referenced by BKE_collider_cache_free(), dynamics_step(), and eff_calc_visibility().
| struct Object ** BKE_collision_objects_create | ( | struct Depsgraph * | depsgraph, |
| struct Object * | self, | ||
| struct Collection * | collection, | ||
| unsigned int * | numcollobj, | ||
| unsigned int | modifier_type ) |
Create effective list of colliders from relations built beforehand. Self will be excluded.
Definition at line 1281 of file collision.cc.
References BKE_collision_objects_create(), BLI_listbase_count(), PartDeflect::deflect, DEG_get_collision_relations(), DEG_get_evaluated(), eModifierType_Collision, LISTBASE_FOREACH, MEM_calloc_arrayN(), MEM_freeN(), num, and Object::pd.
Referenced by BKE_collision_objects_create(), ccd_build_deflector_hash(), ccd_update_deflector_hash(), cloth_bvh_collision(), dynamicPaint_doStep(), query_external_colliders(), and surface_getBrushFlags().
| void BKE_collision_objects_free | ( | struct Object ** | objects | ) |
Definition at line 1321 of file collision.cc.
References BKE_collision_objects_free(), and MEM_freeN().
Referenced by BKE_collision_objects_free(), ccd_build_deflector_hash(), ccd_update_deflector_hash(), cloth_bvh_collision(), dynamicPaint_doStep(), query_external_colliders(), and surface_getBrushFlags().
| struct ListBase * BKE_collision_relations_create | ( | struct Depsgraph * | depsgraph, |
| struct Collection * | collection, | ||
| unsigned int | modifier_type ) |
Create list of collision relations in the collection or entire scene. This is used by the depsgraph to build relations, as well as faster lookup of colliders during evaluation.
Definition at line 1252 of file collision.cc.
References add_collision_object(), BASE_ENABLED_RENDER, BASE_ENABLED_VIEWPORT, BKE_collection_or_layer_objects(), BKE_collision_relations_create(), DAG_EVAL_RENDER, DEG_get_input_scene(), DEG_get_input_view_layer(), DEG_get_mode(), Base::flag, MEM_callocN(), Base::next, and Base::object.
Referenced by BKE_collision_relations_create(), and blender::deg::build_collision_relations().
| void BKE_collision_relations_free | ( | struct ListBase * | relations | ) |
Definition at line 1273 of file collision.cc.
References BKE_collision_relations_free(), BLI_freelistN(), and MEM_freeN().
Referenced by BKE_collision_relations_free(), and blender::deg::clear_physics_relations().
| struct BVHTree * bvhtree_build_from_mvert | ( | const float(*) | positions[3], |
| const blender::int3 * | vert_tris, | ||
| int | tri_num, | ||
| float | epsilon ) |
Definition at line 89 of file collision.cc.
References BLI_bvhtree_balance(), BLI_bvhtree_insert(), BLI_bvhtree_new(), bvhtree_build_from_mvert(), copy_v3_v3(), and i.
Referenced by bvhtree_build_from_mvert(), and deform_verts().
| void bvhtree_update_from_mvert | ( | struct BVHTree * | bvhtree, |
| const float(*) | positions[3], | ||
| const float(*) | positions_moving[3], | ||
| const blender::int3 * | vert_tris, | ||
| int | tri_num, | ||
| bool | moving ) |
Definition at line 113 of file collision.cc.
References BLI_bvhtree_update_node(), BLI_bvhtree_update_tree(), bvhtree_update_from_mvert(), copy_v3_v3(), i, and ret.
Referenced by bvhtree_update_from_mvert(), collision_move_object(), and deform_verts().
| void collision_get_collider_velocity | ( | float | vel_old[3], |
| float | vel_new[3], | ||
| struct CollisionModifierData * | collmd, | ||
| struct CollPair * | collpair ) |
Definition at line 1720 of file collision.cc.
References CollPair::bp1, CollPair::bp2, CollPair::bp3, collision_compute_barycentric(), collision_get_collider_velocity(), collision_interpolateOnTriangle(), copy_v3_v3(), CollisionModifierData::current_v, CollisionModifierData::current_x, and CollPair::pb.
Referenced by collision_get_collider_velocity().
| void collision_move_object | ( | struct CollisionModifierData * | collmd, |
| float | step, | ||
| float | prevstep, | ||
| bool | moving_bvh ) |
Move Collision modifier object inter-frame with step = [0,1]
| step | is limited from 0 (frame start position) to 1 (frame end position). |
Definition at line 59 of file collision.cc.
References CollisionModifierData::bvhtree, bvhtree_update_from_mvert(), collision_move_object(), CollisionModifierData::current_v, CollisionModifierData::current_x, CollisionModifierData::current_xnew, i, interp_v3_v3v3(), CollisionModifierData::is_static, CollisionModifierData::mvert_num, step, sub_v3_v3v3(), CollisionModifierData::tri_num, CollisionModifierData::vert_tris, CollisionModifierData::x, CollisionModifierData::xnew, and zero_v3().
Referenced by BKE_collider_cache_create(), blender::ed::sculpt_paint::cloth::cloth_brush_collider_cache_create(), cloth_bvh_collision(), and collision_move_object().