From 69ddc5eb99d36c7d2cf86a7537a3784d3c72777e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 23 Jan 2013 07:26:39 +0000 Subject: [PATCH] make bullet optional again --- source/blender/CMakeLists.txt | 5 +- source/blender/blenkernel/CMakeLists.txt | 6 +- source/blender/blenkernel/SConscript | 2 +- source/blender/blenkernel/intern/collision.c | 6 +- source/blender/blenkernel/intern/pointcache.c | 8 +- source/blender/blenkernel/intern/rigidbody.c | 39 +++- .../editors/interface/interface_templates.c | 6 +- source/blender/editors/physics/CMakeLists.txt | 8 +- .../blender/editors/physics/rigidbody_world.c | 7 +- source/blender/makesrna/intern/CMakeLists.txt | 8 +- .../blender/makesrna/intern/rna_rigidbody.c | 167 +++++++++++++----- source/blender/modifiers/intern/MOD_boolean.c | 2 +- source/creator/CMakeLists.txt | 5 +- .../gameengine/BlenderRoutines/CMakeLists.txt | 2 +- .../Converter/BL_BlenderDataConversion.cpp | 10 +- source/gameengine/Converter/CMakeLists.txt | 2 +- .../Converter/KX_BlenderSceneConverter.cpp | 10 +- .../Converter/KX_SoftBodyDeformer.cpp | 2 +- source/gameengine/Converter/SConscript | 2 +- source/gameengine/Ketsji/CMakeLists.txt | 2 +- .../Ketsji/KX_BulletPhysicsController.cpp | 4 +- .../Ketsji/KX_BulletPhysicsController.h | 4 +- .../Ketsji/KX_ConvertPhysicsObject.h | 2 +- .../Ketsji/KX_ConvertPhysicsObjects.cpp | 4 +- source/gameengine/Ketsji/KX_GameObject.cpp | 2 +- .../Ketsji/KX_PyConstraintBinding.cpp | 6 +- source/gameengine/Ketsji/KX_Scene.cpp | 24 +-- source/gameengine/Ketsji/SConscript | 2 +- .../gameengine/Physics/Bullet/CMakeLists.txt | 2 +- source/gameengine/Physics/Bullet/SConscript | 2 +- 30 files changed, 247 insertions(+), 104 deletions(-) diff --git a/source/blender/CMakeLists.txt b/source/blender/CMakeLists.txt index db3132132da..36b05fd31f4 100644 --- a/source/blender/CMakeLists.txt +++ b/source/blender/CMakeLists.txt @@ -106,7 +106,10 @@ add_subdirectory(nodes) add_subdirectory(modifiers) add_subdirectory(makesdna) add_subdirectory(makesrna) -add_subdirectory(rigidbody) + +if(WITH_BULLET) + add_subdirectory(rigidbody) +endif() if(WITH_COMPOSITOR) add_subdirectory(opencl) # later on this may be used more generally diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt index 846ed8a9bb4..fefd4c89fbe 100644 --- a/source/blender/blenkernel/CMakeLists.txt +++ b/source/blender/blenkernel/CMakeLists.txt @@ -37,7 +37,6 @@ set(INC ../modifiers ../nodes ../render/extern/include - ../rigidbody ../../../intern/guardedalloc ../../../intern/iksolver/extern ../../../intern/memutil @@ -264,7 +263,10 @@ if(WITH_BULLET) list(APPEND INC_SYS ${BULLET_INCLUDE_DIRS} ) - add_definitions(-DUSE_BULLET) + list(APPEND INC + ../rigidbody + ) + add_definitions(-DWITH_BULLET) endif() #if(WITH_MOD_CLOTH_ELTOPO) diff --git a/source/blender/blenkernel/SConscript b/source/blender/blenkernel/SConscript index b146235d63c..e53e4724071 100644 --- a/source/blender/blenkernel/SConscript +++ b/source/blender/blenkernel/SConscript @@ -111,7 +111,7 @@ if env['WITH_BF_QUICKTIME']: incs += ' ' + env['BF_QUICKTIME_INC'] if env['WITH_BF_BULLET']: - defs.append('USE_BULLET') + defs.append('WITH_BULLET') if env['OURPLATFORM'] == 'darwin': if env['WITH_BF_OPENMP']: diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c index 60bf67e19e3..061657c8f2d 100644 --- a/source/blender/blenkernel/intern/collision.c +++ b/source/blender/blenkernel/intern/collision.c @@ -59,7 +59,7 @@ #include "BKE_modifier.h" #include "BKE_DerivedMesh.h" -#ifdef USE_BULLET +#ifdef WITH_BULLET #include "Bullet-C-Api.h" #endif #include "BLI_kdopbvh.h" @@ -385,7 +385,7 @@ static CollPair* cloth_collision(ModifierData *md1, ModifierData *md2, CollisionModifierData *collmd = (CollisionModifierData *) md2; /* Cloth *cloth = clmd->clothObject; */ /* UNUSED */ MFace *face1=NULL, *face2 = NULL; -#ifdef USE_BULLET +#ifdef WITH_BULLET ClothVertex *verts1 = clmd->clothObject->verts; #endif double distance = 0; @@ -458,7 +458,7 @@ static CollPair* cloth_collision(ModifierData *md1, ModifierData *md2, } } -#ifdef USE_BULLET +#ifdef WITH_BULLET // calc distance + normal distance = plNearestPoints ( verts1[collpair->ap1].txold, verts1[collpair->ap2].txold, verts1[collpair->ap3].txold, collmd->current_x[collpair->bp1].co, collmd->current_x[collpair->bp2].co, collmd->current_x[collpair->bp3].co, collpair->pa, collpair->pb, collpair->vector ); diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index 1670389566e..ef096adc7a7 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -73,7 +73,9 @@ #include "BIK_api.h" -#include "RBI_api.h" +#ifdef WITH_BULLET +# include "RBI_api.h" +#endif /* both in intern */ #ifdef WITH_SMOKE @@ -883,10 +885,10 @@ static int ptcache_rigidbody_write(int index, void *rb_v, void **data, int UNUS RigidBodyOb *rbo = ob->rigidbody_object; if (rbo->type == RBO_TYPE_ACTIVE) { - +#ifdef WITH_BULLET RB_body_get_position(rbo->physics_object, rbo->pos); RB_body_get_orientation(rbo->physics_object, rbo->orn); - +#endif PTCACHE_DATA_FROM(data, BPHYS_DATA_LOCATION, rbo->pos); PTCACHE_DATA_FROM(data, BPHYS_DATA_ROTATION, rbo->orn); } diff --git a/source/blender/blenkernel/intern/rigidbody.c b/source/blender/blenkernel/intern/rigidbody.c index 4f154bce071..9feb6d43bce 100644 --- a/source/blender/blenkernel/intern/rigidbody.c +++ b/source/blender/blenkernel/intern/rigidbody.c @@ -42,7 +42,9 @@ #include "BLI_blenlib.h" #include "BLI_math.h" -#include "RBI_api.h" +#ifdef WITH_BULLET +# include "RBI_api.h" +#endif #include "DNA_anim_types.h" #include "DNA_group_types.h" @@ -66,6 +68,8 @@ #include "RNA_access.h" +#ifdef WITH_BULLET + /* ************************************** */ /* Memory Management */ @@ -1210,3 +1214,36 @@ void BKE_rigidbody_do_simulation(Scene *scene, float ctime) } } /* ************************************** */ + +#else /* WITH_BULLET */ + +/* stubs */ +#ifdef __GNUC__ +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wunused-parameter" +#endif + +void BKE_rigidbody_free_world(RigidBodyWorld *rbw) {} +void BKE_rigidbody_free_object(Object *ob) {} +void BKE_rigidbody_free_constraint(Object *ob) {} +struct RigidBodyOb *BKE_rigidbody_copy_object(Object *ob) { return NULL; } +struct RigidBodyCon *BKE_rigidbody_copy_constraint(Object *ob) { return NULL; } +void BKE_rigidbody_validate_sim_shape(Object *ob, short rebuild) {} +void BKE_rigidbody_validate_sim_object(RigidBodyWorld *rbw, Object *ob, short rebuild) {} +void BKE_rigidbody_validate_sim_constraint(RigidBodyWorld *rbw, Object *ob, short rebuild) {} +void BKE_rigidbody_validate_sim_world(Scene *scene, RigidBodyWorld *rbw, short rebuild) {} +struct RigidBodyWorld *BKE_rigidbody_create_world(Scene *scene) { return NULL; } +struct RigidBodyOb *BKE_rigidbody_create_object(Scene *scene, Object *ob, short type) { return NULL; } +struct RigidBodyCon *BKE_rigidbody_create_constraint(Scene *scene, Object *ob, short type) { return NULL; } +struct RigidBodyWorld *BKE_rigidbody_get_world(Scene *scene) { return NULL; } +void BKE_rigidbody_remove_object(Scene *scene, Object *ob) {} +void BKE_rigidbody_remove_constraint(Scene *scene, Object *ob) {} +void BKE_rigidbody_sync_transforms(Scene *scene, Object *ob, float ctime) {} +void BKE_rigidbody_cache_reset(RigidBodyWorld *rbw) {} +void BKE_rigidbody_do_simulation(Scene *scene, float ctime) {} + +#ifdef __GNUC__ +# pragma GCC diagnostic pop +#endif + +#endif /* WITH_BULLET */ diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 70a367256ed..bdff02c1551 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -1606,7 +1606,7 @@ void uiTemplateIconView(uiLayout *layout, PointerRNA *ptr, const char *propname) RNAUpdateCb *cb; uiBlock *block; uiBut *but; - rctf rect; +// rctf rect; /* UNUSED */ int icon; if (!prop || RNA_property_type(prop) != PROP_ENUM) @@ -1618,8 +1618,8 @@ void uiTemplateIconView(uiLayout *layout, PointerRNA *ptr, const char *propname) cb->ptr = *ptr; cb->prop = prop; - rect.xmin = 0; rect.xmax = 10.0f * UI_UNIT_X; - rect.ymin = 0; rect.ymax = 10.0f * UI_UNIT_X; +// rect.xmin = 0; rect.xmax = 10.0f * UI_UNIT_X; +// rect.ymin = 0; rect.ymax = 10.0f * UI_UNIT_X; block = uiLayoutAbsoluteBlock(layout); diff --git a/source/blender/editors/physics/CMakeLists.txt b/source/blender/editors/physics/CMakeLists.txt index 7f3eaa892d0..435327319aa 100644 --- a/source/blender/editors/physics/CMakeLists.txt +++ b/source/blender/editors/physics/CMakeLists.txt @@ -27,7 +27,6 @@ set(INC ../../makesdna ../../makesrna ../../windowmanager - ../../rigidbody ../../../../intern/elbeem/extern ../../../../intern/guardedalloc ) @@ -63,4 +62,11 @@ if(WITH_INTERNATIONAL) add_definitions(-DWITH_INTERNATIONAL) endif() +if(WITH_BULLET) + list(APPEND INC + ../../rigidbody + ) + add_definitions(-DWITH_BULLET) +endif() + blender_add_lib(bf_editor_physics "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blender/editors/physics/rigidbody_world.c b/source/blender/editors/physics/rigidbody_world.c index 068f8decef5..5ab8e7697c5 100644 --- a/source/blender/editors/physics/rigidbody_world.c +++ b/source/blender/editors/physics/rigidbody_world.c @@ -40,7 +40,9 @@ #include "BLI_blenlib.h" #include "BLI_math.h" -#include "RBI_api.h" +#ifdef WITH_BULLET +# include "RBI_api.h" +#endif #include "BKE_context.h" #include "BKE_depsgraph.h" @@ -170,8 +172,9 @@ static int rigidbody_world_export_exec(bContext *C, wmOperator *op) } RNA_string_get(op->ptr, "filepath", path); +#ifdef WITH_BULLET RB_dworld_export(rbw->physics_world, path); - +#endif return OPERATOR_FINISHED; } diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt index 83e7a19572d..210857a4690 100644 --- a/source/blender/makesrna/intern/CMakeLists.txt +++ b/source/blender/makesrna/intern/CMakeLists.txt @@ -238,6 +238,13 @@ if(WITH_INTERNATIONAL) add_definitions(-DWITH_INTERNATIONAL) endif() +if(WITH_BULLET) + list(APPEND INC + ../../rigidbody + ) + add_definitions(-DWITH_BULLET) +endif() + # Build makesrna executable blender_include_dirs( . @@ -254,7 +261,6 @@ blender_include_dirs( ../../windowmanager ../../editors/include ../../render/extern/include - ../../rigidbody ../../../../intern/audaspace/intern ../../../../intern/cycles/blender ../../../../intern/guardedalloc diff --git a/source/blender/makesrna/intern/rna_rigidbody.c b/source/blender/makesrna/intern/rna_rigidbody.c index 2c8eafb4aac..7f487a646eb 100644 --- a/source/blender/makesrna/intern/rna_rigidbody.c +++ b/source/blender/makesrna/intern/rna_rigidbody.c @@ -73,7 +73,9 @@ EnumPropertyItem rigidbody_con_type_items[] = { #ifdef RNA_RUNTIME -#include "RBI_api.h" +#ifdef WITH_BULLET +# include "RBI_api.h" +#endif #include "BKE_depsgraph.h" #include "BKE_rigidbody.h" @@ -105,9 +107,12 @@ static void rna_RigidBodyWorld_num_solver_iterations_set(PointerRNA *ptr, int va RigidBodyWorld *rbw = (RigidBodyWorld *)ptr->data; rbw->num_solver_iterations = value; - - if (rbw->physics_world) + +#ifdef WITH_BULLET + if (rbw->physics_world) { RB_dworld_set_solver_iterations(rbw->physics_world, value); + } +#endif } static void rna_RigidBodyWorld_split_impulse_set(PointerRNA *ptr, int value) @@ -115,9 +120,12 @@ static void rna_RigidBodyWorld_split_impulse_set(PointerRNA *ptr, int value) RigidBodyWorld *rbw = (RigidBodyWorld *)ptr->data; RB_FLAG_SET(rbw->flag, value, RBW_FLAG_USE_SPLIT_IMPULSE); - - if (rbw->physics_world) + +#ifdef WITH_BULLET + if (rbw->physics_world) { RB_dworld_set_split_impulse(rbw->physics_world, value); + } +#endif } /* ******************************** */ @@ -152,9 +160,12 @@ static void rna_RigidBodyOb_type_set(PointerRNA *ptr, int value) rbo->type = value; rbo->flag |= RBO_FLAG_NEEDS_VALIDATE; +#ifdef WITH_BULLET /* do physics sim updates */ - if (rbo->physics_object) + if (rbo->physics_object) { RB_body_set_mass(rbo->physics_object, RBO_GET_MASS(rbo)); + } +#endif } static void rna_RigidBodyOb_disabled_set(PointerRNA *ptr, int value) @@ -162,13 +173,15 @@ static void rna_RigidBodyOb_disabled_set(PointerRNA *ptr, int value) RigidBodyOb *rbo = (RigidBodyOb *)ptr->data; RB_FLAG_SET(rbo->flag, !value, RBO_FLAG_DISABLED); - + +#ifdef WITH_BULLET /* update kinematic state if necessary - only needed for active bodies */ if ((rbo->physics_object) && (rbo->type == RBO_TYPE_ACTIVE)) { RB_body_set_mass(rbo->physics_object, RBO_GET_MASS(rbo)); RB_body_set_kinematic_state(rbo->physics_object, !value); rbo->flag |= RBO_FLAG_NEEDS_VALIDATE; } +#endif } static void rna_RigidBodyOb_shape_set(PointerRNA *ptr, int value) @@ -180,10 +193,13 @@ static void rna_RigidBodyOb_shape_set(PointerRNA *ptr, int value) /* force creation of new collision shape reflecting this */ BKE_rigidbody_validate_sim_shape(ob, TRUE); - + +#ifdef WITH_BULLET /* now tell RB sim about it */ - if (rbo->physics_object && rbo->physics_shape) + if (rbo->physics_object && rbo->physics_shape) { RB_body_set_collision_shape(rbo->physics_object, rbo->physics_shape); + } +#endif } @@ -192,10 +208,13 @@ static void rna_RigidBodyOb_mass_set(PointerRNA *ptr, float value) RigidBodyOb *rbo = (RigidBodyOb *)ptr->data; rbo->mass = value; - + +#ifdef WITH_BULLET /* only active bodies need mass update */ - if ((rbo->physics_object) && (rbo->type == RBO_TYPE_ACTIVE)) + if ((rbo->physics_object) && (rbo->type == RBO_TYPE_ACTIVE)) { RB_body_set_mass(rbo->physics_object, RBO_GET_MASS(rbo)); + } +#endif } static void rna_RigidBodyOb_friction_set(PointerRNA *ptr, float value) @@ -203,9 +222,12 @@ static void rna_RigidBodyOb_friction_set(PointerRNA *ptr, float value) RigidBodyOb *rbo = (RigidBodyOb *)ptr->data; rbo->friction = value; - - if (rbo->physics_object) + +#ifdef WITH_BULLET + if (rbo->physics_object) { RB_body_set_friction(rbo->physics_object, value); + } +#endif } static void rna_RigidBodyOb_restitution_set(PointerRNA *ptr, float value) @@ -213,9 +235,11 @@ static void rna_RigidBodyOb_restitution_set(PointerRNA *ptr, float value) RigidBodyOb *rbo = (RigidBodyOb *)ptr->data; rbo->restitution = value; - - if (rbo->physics_object) +#ifdef WITH_BULLET + if (rbo->physics_object) { RB_body_set_restitution(rbo->physics_object, value); + } +#endif } static void rna_RigidBodyOb_collision_margin_set(PointerRNA *ptr, float value) @@ -223,9 +247,12 @@ static void rna_RigidBodyOb_collision_margin_set(PointerRNA *ptr, float value) RigidBodyOb *rbo = (RigidBodyOb *)ptr->data; rbo->margin = value; - - if (rbo->physics_shape) + +#ifdef WITH_BULLET + if (rbo->physics_shape) { RB_shape_set_margin(rbo->physics_shape, RBO_GET_MARGIN(rbo)); + } +#endif } static void rna_RigidBodyOb_kinematic_state_set(PointerRNA *ptr, int value) @@ -233,13 +260,15 @@ static void rna_RigidBodyOb_kinematic_state_set(PointerRNA *ptr, int value) RigidBodyOb *rbo = (RigidBodyOb *)ptr->data; RB_FLAG_SET(rbo->flag, value, RBO_FLAG_KINEMATIC); - + +#ifdef WITH_BULLET /* update kinematic state if necessary */ if (rbo->physics_object) { RB_body_set_mass(rbo->physics_object, RBO_GET_MASS(rbo)); RB_body_set_kinematic_state(rbo->physics_object, value); rbo->flag |= RBO_FLAG_NEEDS_VALIDATE; } +#endif } static void rna_RigidBodyOb_activation_state_set(PointerRNA *ptr, int value) @@ -247,10 +276,13 @@ static void rna_RigidBodyOb_activation_state_set(PointerRNA *ptr, int value) RigidBodyOb *rbo = (RigidBodyOb *)ptr->data; RB_FLAG_SET(rbo->flag, value, RBO_FLAG_USE_DEACTIVATION); - + +#ifdef WITH_BULLET /* update activation state if necessary - only active bodies can be deactivated */ - if ((rbo->physics_object) && (rbo->type == RBO_TYPE_ACTIVE)) + if ((rbo->physics_object) && (rbo->type == RBO_TYPE_ACTIVE)) { RB_body_set_activation_state(rbo->physics_object, value); + } +#endif } static void rna_RigidBodyOb_linear_sleepThresh_set(PointerRNA *ptr, float value) @@ -258,10 +290,13 @@ static void rna_RigidBodyOb_linear_sleepThresh_set(PointerRNA *ptr, float value) RigidBodyOb *rbo = (RigidBodyOb *)ptr->data; rbo->lin_sleep_thresh = value; - + +#ifdef WITH_BULLET /* only active bodies need sleep threshold update */ - if ((rbo->physics_object) && (rbo->type == RBO_TYPE_ACTIVE)) + if ((rbo->physics_object) && (rbo->type == RBO_TYPE_ACTIVE)) { RB_body_set_linear_sleep_thresh(rbo->physics_object, value); + } +#endif } static void rna_RigidBodyOb_angular_sleepThresh_set(PointerRNA *ptr, float value) @@ -269,10 +304,13 @@ static void rna_RigidBodyOb_angular_sleepThresh_set(PointerRNA *ptr, float value RigidBodyOb *rbo = (RigidBodyOb *)ptr->data; rbo->ang_sleep_thresh = value; - + +#ifdef WITH_BULLET /* only active bodies need sleep threshold update */ - if ((rbo->physics_object) && (rbo->type == RBO_TYPE_ACTIVE)) + if ((rbo->physics_object) && (rbo->type == RBO_TYPE_ACTIVE)) { RB_body_set_angular_sleep_thresh(rbo->physics_object, value); + } +#endif } static void rna_RigidBodyOb_linear_damping_set(PointerRNA *ptr, float value) @@ -280,10 +318,13 @@ static void rna_RigidBodyOb_linear_damping_set(PointerRNA *ptr, float value) RigidBodyOb *rbo = (RigidBodyOb *)ptr->data; rbo->lin_damping = value; - + +#ifdef WITH_BULLET /* only active bodies need damping update */ - if ((rbo->physics_object) && (rbo->type == RBO_TYPE_ACTIVE)) + if ((rbo->physics_object) && (rbo->type == RBO_TYPE_ACTIVE)) { RB_body_set_linear_damping(rbo->physics_object, value); + } +#endif } static void rna_RigidBodyOb_angular_damping_set(PointerRNA *ptr, float value) @@ -291,10 +332,13 @@ static void rna_RigidBodyOb_angular_damping_set(PointerRNA *ptr, float value) RigidBodyOb *rbo = (RigidBodyOb *)ptr->data; rbo->ang_damping = value; - + +#ifdef WITH_BULLET /* only active bodies need damping update */ - if ((rbo->physics_object) && (rbo->type == RBO_TYPE_ACTIVE)) + if ((rbo->physics_object) && (rbo->type == RBO_TYPE_ACTIVE)) { RB_body_set_angular_damping(rbo->physics_object, value); + } +#endif } static char *rna_RigidBodyCon_path(PointerRNA *ptr) @@ -317,8 +361,11 @@ static void rna_RigidBodyCon_enabled_set(PointerRNA *ptr, int value) RB_FLAG_SET(rbc->flag, value, RBC_FLAG_ENABLED); - if (rbc->physics_constraint) +#ifdef WITH_BULLET + if (rbc->physics_constraint) { RB_constraint_set_enabled(rbc->physics_constraint, value); + } +#endif } static void rna_RigidBodyCon_disable_collisions_set(PointerRNA *ptr, int value) @@ -336,13 +383,19 @@ static void rna_RigidBodyCon_use_breaking_set(PointerRNA *ptr, int value) if (value) { rbc->flag |= RBC_FLAG_USE_BREAKING; - if (rbc->physics_constraint) +#ifdef WITH_BULLET + if (rbc->physics_constraint) { RB_constraint_set_breaking_threshold(rbc->physics_constraint, rbc->breaking_threshold); + } +#endif } else { rbc->flag &= ~RBC_FLAG_USE_BREAKING; - if (rbc->physics_constraint) +#ifdef WITH_BULLET + if (rbc->physics_constraint) { RB_constraint_set_breaking_threshold(rbc->physics_constraint, FLT_MAX); + } +#endif } } @@ -352,8 +405,11 @@ static void rna_RigidBodyCon_breaking_threshold_set(PointerRNA *ptr, float value rbc->breaking_threshold = value; - if (rbc->physics_constraint && (rbc->flag & RBC_FLAG_USE_BREAKING)) +#ifdef WITH_BULLET + if (rbc->physics_constraint && (rbc->flag & RBC_FLAG_USE_BREAKING)) { RB_constraint_set_breaking_threshold(rbc->physics_constraint, value); + } +#endif } static void rna_RigidBodyCon_override_solver_iterations_set(PointerRNA *ptr, int value) @@ -362,13 +418,19 @@ static void rna_RigidBodyCon_override_solver_iterations_set(PointerRNA *ptr, int if (value) { rbc->flag |= RBC_FLAG_OVERRIDE_SOLVER_ITERATIONS; - if (rbc->physics_constraint) +#ifdef WITH_BULLET + if (rbc->physics_constraint) { RB_constraint_set_solver_iterations(rbc->physics_constraint, rbc->num_solver_iterations); + } +#endif } else { rbc->flag &= ~RBC_FLAG_OVERRIDE_SOLVER_ITERATIONS; - if (rbc->physics_constraint) +#ifdef WITH_BULLET + if (rbc->physics_constraint) { RB_constraint_set_solver_iterations(rbc->physics_constraint, -1); + } +#endif } } @@ -378,8 +440,11 @@ static void rna_RigidBodyCon_num_solver_iterations_set(PointerRNA *ptr, int valu rbc->num_solver_iterations = value; - if (rbc->physics_constraint && (rbc->flag & RBC_FLAG_OVERRIDE_SOLVER_ITERATIONS)) +#ifdef WITH_BULLET + if (rbc->physics_constraint && (rbc->flag & RBC_FLAG_OVERRIDE_SOLVER_ITERATIONS)) { RB_constraint_set_solver_iterations(rbc->physics_constraint, value); + } +#endif } static void rna_RigidBodyCon_spring_stiffness_x_set(PointerRNA *ptr, float value) @@ -388,8 +453,11 @@ static void rna_RigidBodyCon_spring_stiffness_x_set(PointerRNA *ptr, float value rbc->spring_stiffness_x = value; - if (rbc->physics_constraint && rbc->type == RBC_TYPE_6DOF_SPRING && (rbc->flag & RBC_FLAG_USE_SPRING_X)) +#ifdef WITH_BULLET + if (rbc->physics_constraint && rbc->type == RBC_TYPE_6DOF_SPRING && (rbc->flag & RBC_FLAG_USE_SPRING_X)) { RB_constraint_set_stiffness_6dof_spring(rbc->physics_constraint, RB_LIMIT_LIN_X, value); + } +#endif } static void rna_RigidBodyCon_spring_stiffness_y_set(PointerRNA *ptr, float value) @@ -398,8 +466,11 @@ static void rna_RigidBodyCon_spring_stiffness_y_set(PointerRNA *ptr, float value rbc->spring_stiffness_y = value; - if (rbc->physics_constraint && rbc->type == RBC_TYPE_6DOF_SPRING && (rbc->flag & RBC_FLAG_USE_SPRING_Y)) +#ifdef WITH_BULLET + if (rbc->physics_constraint && rbc->type == RBC_TYPE_6DOF_SPRING && (rbc->flag & RBC_FLAG_USE_SPRING_Y)) { RB_constraint_set_stiffness_6dof_spring(rbc->physics_constraint, RB_LIMIT_LIN_Y, value); + } +#endif } static void rna_RigidBodyCon_spring_stiffness_z_set(PointerRNA *ptr, float value) @@ -408,8 +479,11 @@ static void rna_RigidBodyCon_spring_stiffness_z_set(PointerRNA *ptr, float value rbc->spring_stiffness_z = value; - if (rbc->physics_constraint && rbc->type == RBC_TYPE_6DOF_SPRING && (rbc->flag & RBC_FLAG_USE_SPRING_Z)) +#ifdef WITH_BULLET + if (rbc->physics_constraint && rbc->type == RBC_TYPE_6DOF_SPRING && (rbc->flag & RBC_FLAG_USE_SPRING_Z)) { RB_constraint_set_stiffness_6dof_spring(rbc->physics_constraint, RB_LIMIT_LIN_Z, value); + } +#endif } static void rna_RigidBodyCon_spring_damping_x_set(PointerRNA *ptr, float value) @@ -418,8 +492,11 @@ static void rna_RigidBodyCon_spring_damping_x_set(PointerRNA *ptr, float value) rbc->spring_damping_x = value; - if (rbc->physics_constraint && rbc->type == RBC_TYPE_6DOF_SPRING && (rbc->flag & RBC_FLAG_USE_SPRING_X)) +#ifdef WITH_BULLET + if (rbc->physics_constraint && rbc->type == RBC_TYPE_6DOF_SPRING && (rbc->flag & RBC_FLAG_USE_SPRING_X)) { RB_constraint_set_damping_6dof_spring(rbc->physics_constraint, RB_LIMIT_LIN_X, value); + } +#endif } static void rna_RigidBodyCon_spring_damping_y_set(PointerRNA *ptr, float value) @@ -427,9 +504,11 @@ static void rna_RigidBodyCon_spring_damping_y_set(PointerRNA *ptr, float value) RigidBodyCon *rbc = (RigidBodyCon *)ptr->data; rbc->spring_damping_y = value; - - if (rbc->physics_constraint && rbc->type == RBC_TYPE_6DOF_SPRING && (rbc->flag & RBC_FLAG_USE_SPRING_Y)) +#ifdef WITH_BULLET + if (rbc->physics_constraint && rbc->type == RBC_TYPE_6DOF_SPRING && (rbc->flag & RBC_FLAG_USE_SPRING_Y)) { RB_constraint_set_damping_6dof_spring(rbc->physics_constraint, RB_LIMIT_LIN_Y, value); + } +#endif } static void rna_RigidBodyCon_spring_damping_z_set(PointerRNA *ptr, float value) @@ -437,9 +516,11 @@ static void rna_RigidBodyCon_spring_damping_z_set(PointerRNA *ptr, float value) RigidBodyCon *rbc = (RigidBodyCon *)ptr->data; rbc->spring_damping_z = value; - - if (rbc->physics_constraint && rbc->type == RBC_TYPE_6DOF_SPRING && (rbc->flag & RBC_FLAG_USE_SPRING_Z)) +#ifdef WITH_BULLET + if (rbc->physics_constraint && rbc->type == RBC_TYPE_6DOF_SPRING && (rbc->flag & RBC_FLAG_USE_SPRING_Z)) { RB_constraint_set_damping_6dof_spring(rbc->physics_constraint, RB_LIMIT_LIN_Z, value); + } +#endif } #else diff --git a/source/blender/modifiers/intern/MOD_boolean.c b/source/blender/modifiers/intern/MOD_boolean.c index a97ca2f9243..04198d9feb9 100644 --- a/source/blender/modifiers/intern/MOD_boolean.c +++ b/source/blender/modifiers/intern/MOD_boolean.c @@ -136,7 +136,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, * in other scenes when compositing */ if (bmd->object != ob) { /* weak! - but we can too easy end up with circular dep crash otherwise */ - if (modifiers_findByType(bmd->object, eModifierType_Boolean) == false) { + if (modifiers_findByType(bmd->object, eModifierType_Boolean) == NULL) { dm = mesh_get_derived_final(md->scene, bmd->object, CD_MASK_MESH); } else { diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index 7362745f412..2115b2a5ff6 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -856,7 +856,6 @@ endif() bf_modifiers bf_bmesh bf_blenkernel - bf_rigidbody bf_nodes bf_gpu bf_blenloader @@ -971,6 +970,10 @@ endif() list(APPEND BLENDER_SORTED_LIBS bf_intern_locale) endif() + if(WITH_BULLET) + list_insert_after(BLENDER_SORTED_LIBS "bf_blenkernel" "bf_rigidbody") + endif() + if(WITH_BULLET AND NOT WITH_BULLET_SYSTEM) list_insert_after(BLENDER_SORTED_LIBS "ge_logic_ngnetwork" "extern_bullet") endif() diff --git a/source/gameengine/BlenderRoutines/CMakeLists.txt b/source/gameengine/BlenderRoutines/CMakeLists.txt index d833534605b..32efc5bde21 100644 --- a/source/gameengine/BlenderRoutines/CMakeLists.txt +++ b/source/gameengine/BlenderRoutines/CMakeLists.txt @@ -73,7 +73,7 @@ if(WITH_BULLET) list(APPEND INC_SYS ${BULLET_INCLUDE_DIRS} ) - add_definitions(-DUSE_BULLET) + add_definitions(-DWITH_BULLET) endif() diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index 9267b2b9fed..409a3bfec8f 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -164,7 +164,7 @@ extern Material defmaterial; /* material.c */ #include "SG_Tree.h" #include "KX_ConvertPhysicsObject.h" -#ifdef USE_BULLET +#ifdef WITH_BULLET #include "CcdPhysicsEnvironment.h" #include "CcdGraphicController.h" #endif @@ -1526,7 +1526,7 @@ static void BL_CreateGraphicObjectNew(KX_GameObject* gameobj, { switch (physics_engine) { -#ifdef USE_BULLET +#ifdef WITH_BULLET case UseBullet: { CcdPhysicsEnvironment* env = (CcdPhysicsEnvironment*)kxscene->GetPhysicsEnvironment(); @@ -1829,7 +1829,7 @@ static void BL_CreatePhysicsObjectNew(KX_GameObject* gameobj, switch (physics_engine) { -#ifdef USE_BULLET +#ifdef WITH_BULLET case UseBullet: KX_ConvertBulletObject(gameobj, meshobj, dm, kxscene, shapeprops, smmaterial, &objprop); break; @@ -1980,7 +1980,7 @@ static KX_GameObject *gameobject_from_blenderobject( bool bHasDvert = mesh->dvert != NULL && ob->defbase.first; bool bHasArmature = (BL_ModifierDeformer::HasArmatureDeformer(ob) && ob->parent && ob->parent->type == OB_ARMATURE && bHasDvert); bool bHasModifier = BL_ModifierDeformer::HasCompatibleDeformer(ob); -#ifdef USE_BULLET +#ifdef WITH_BULLET bool bHasSoftBody = (!ob->parent && (ob->gameflag & OB_SOFT_BODY)); #endif if (bHasModifier) { @@ -2007,7 +2007,7 @@ static KX_GameObject *gameobject_from_blenderobject( BL_MeshDeformer *dcont = new BL_MeshDeformer((BL_DeformableGameObject*)gameobj, ob, meshobj); ((BL_DeformableGameObject*)gameobj)->SetDeformer(dcont); -#ifdef USE_BULLET +#ifdef WITH_BULLET } else if (bHasSoftBody) { KX_SoftBodyDeformer *dcont = new KX_SoftBodyDeformer(meshobj, (BL_DeformableGameObject*)gameobj); ((BL_DeformableGameObject*)gameobj)->SetDeformer(dcont); diff --git a/source/gameengine/Converter/CMakeLists.txt b/source/gameengine/Converter/CMakeLists.txt index 8ac9e523d5d..38c0d71d24d 100644 --- a/source/gameengine/Converter/CMakeLists.txt +++ b/source/gameengine/Converter/CMakeLists.txt @@ -114,7 +114,7 @@ if(WITH_BULLET) list(APPEND INC_SYS ${BULLET_INCLUDE_DIRS} ) - add_definitions(-DUSE_BULLET) + add_definitions(-DWITH_BULLET) endif() if(WITH_AUDASPACE) diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp index 5524612f707..376f75959ed 100644 --- a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp +++ b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp @@ -55,7 +55,7 @@ #include "KX_ConvertPhysicsObject.h" -#ifdef USE_BULLET +#ifdef WITH_BULLET #include "CcdPhysicsEnvironment.h" #endif @@ -193,7 +193,7 @@ KX_BlenderSceneConverter::~KX_BlenderSceneConverter() itm++; } -#ifdef USE_BULLET +#ifdef WITH_BULLET KX_ClearBulletSharedShapes(); #endif @@ -254,7 +254,7 @@ Scene *KX_BlenderSceneConverter::GetBlenderSceneForName(const STR_String& name) } #include "KX_PythonInit.h" -#ifdef USE_BULLET +#ifdef WITH_BULLET #include "LinearMath/btIDebugDraw.h" @@ -348,7 +348,7 @@ void KX_BlenderSceneConverter::ConvertScene(class KX_Scene* destinationscene, switch (physics_engine) { -#ifdef USE_BULLET +#ifdef WITH_BULLET case UseBullet: { CcdPhysicsEnvironment* ccdPhysEnv = new CcdPhysicsEnvironment(useDbvtCulling); @@ -398,7 +398,7 @@ void KX_BlenderSceneConverter::ConvertScene(class KX_Scene* destinationscene, //that would result from this is fixed in RemoveScene() m_map_mesh_to_gamemesh.clear(); -#ifndef USE_BULLET +#ifndef WITH_BULLET /* quiet compiler warning */ (void)useDbvtCulling; #endif diff --git a/source/gameengine/Converter/KX_SoftBodyDeformer.cpp b/source/gameengine/Converter/KX_SoftBodyDeformer.cpp index 72d0c8733f2..d860b2ee694 100644 --- a/source/gameengine/Converter/KX_SoftBodyDeformer.cpp +++ b/source/gameengine/Converter/KX_SoftBodyDeformer.cpp @@ -42,7 +42,7 @@ #include "CTR_Map.h" #include "CTR_HashedPtr.h" -#ifdef USE_BULLET +#ifdef WITH_BULLET #include "CcdPhysicsEnvironment.h" #include "CcdPhysicsController.h" diff --git a/source/gameengine/Converter/SConscript b/source/gameengine/Converter/SConscript index 28ad742545e..ef546ce1b19 100644 --- a/source/gameengine/Converter/SConscript +++ b/source/gameengine/Converter/SConscript @@ -64,7 +64,7 @@ if env['WITH_BF_CXX_GUARDEDALLOC']: defs.append('WITH_CXX_GUARDEDALLOC') if env['WITH_BF_BULLET']: - defs.append('USE_BULLET') + defs.append('WITH_BULLET') if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'): incs += ' ' + env['BF_PTHREADS_INC'] diff --git a/source/gameengine/Ketsji/CMakeLists.txt b/source/gameengine/Ketsji/CMakeLists.txt index e42c2a74a8e..fc322d80cd0 100644 --- a/source/gameengine/Ketsji/CMakeLists.txt +++ b/source/gameengine/Ketsji/CMakeLists.txt @@ -254,7 +254,7 @@ if(WITH_BULLET) list(APPEND INC ${BULLET_INCLUDE_DIRS} ) - add_definitions(-DUSE_BULLET) + add_definitions(-DWITH_BULLET) endif() blender_add_lib(ge_logic_ketsji "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp b/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp index 20c41b95dd3..6ef0aed9fe2 100644 --- a/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp +++ b/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp @@ -4,7 +4,7 @@ //under visual studio the #define in KX_ConvertPhysicsObject.h is quicker for recompilation #include "KX_ConvertPhysicsObject.h" -#ifdef USE_BULLET +#ifdef WITH_BULLET #include "KX_BulletPhysicsController.h" @@ -536,4 +536,4 @@ const char* KX_BulletPhysicsController::getName() return 0; } -#endif // USE_BULLET +#endif // WITH_BULLET diff --git a/source/gameengine/Ketsji/KX_BulletPhysicsController.h b/source/gameengine/Ketsji/KX_BulletPhysicsController.h index 4813b39a34e..aa42bf61a78 100644 --- a/source/gameengine/Ketsji/KX_BulletPhysicsController.h +++ b/source/gameengine/Ketsji/KX_BulletPhysicsController.h @@ -8,7 +8,7 @@ #include "KX_IPhysicsController.h" -#ifdef USE_BULLET +#ifdef WITH_BULLET #include "CcdPhysicsController.h" #endif @@ -25,7 +25,7 @@ private: btCollisionShape* m_bulletChildShape; public: -#ifdef USE_BULLET +#ifdef WITH_BULLET KX_BulletPhysicsController (const CcdConstructionInfo& ci, bool dyna, bool sensor, bool character, bool compound); virtual ~KX_BulletPhysicsController (); #endif diff --git a/source/gameengine/Ketsji/KX_ConvertPhysicsObject.h b/source/gameengine/Ketsji/KX_ConvertPhysicsObject.h index e71037d08a0..903966b79be 100644 --- a/source/gameengine/Ketsji/KX_ConvertPhysicsObject.h +++ b/source/gameengine/Ketsji/KX_ConvertPhysicsObject.h @@ -145,7 +145,7 @@ void KX_ConvertDynamoObject(KX_GameObject* gameobj, struct KX_ObjectProperties* objprop); -#ifdef USE_BULLET +#ifdef WITH_BULLET void KX_ConvertBulletObject( class KX_GameObject* gameobj, class RAS_MeshObject* meshobj, diff --git a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp index ff3c46cb8ab..4a5a1704979 100644 --- a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp +++ b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp @@ -58,7 +58,7 @@ extern "C"{ #include "BKE_DerivedMesh.h" } -#ifdef USE_BULLET +#ifdef WITH_BULLET #include "BulletSoftBody/btSoftBody.h" #include "CcdPhysicsEnvironment.h" @@ -574,4 +574,4 @@ bool KX_ReInstanceBulletShapeFromMesh(KX_GameObject *gameobj, KX_GameObject *fro spc->ReplaceControllerShape(bm); return true; } -#endif // USE_BULLET +#endif // WITH_BULLET diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index eec45669e04..63854c6aebd 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -1777,7 +1777,7 @@ PyObject *KX_GameObject::PyReinstancePhysicsMesh(PyObject *args) ) { return NULL; } -#ifdef USE_BULLET +#ifdef WITH_BULLET /* gameobj and mesh can be NULL */ if (KX_ReInstanceBulletShapeFromMesh(this, gameobj, mesh)) Py_RETURN_TRUE; diff --git a/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp b/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp index 9bb09d56de6..2e9b988dff1 100644 --- a/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp +++ b/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp @@ -43,7 +43,7 @@ #include "PyObjectPlus.h" -#ifdef USE_BULLET +#ifdef WITH_BULLET # include "LinearMath/btIDebugDraw.h" #endif @@ -716,7 +716,7 @@ PyObject *initPythonConstraintBinding() PyDict_SetItemString(d, "error", ErrorObject); Py_DECREF(ErrorObject); -#ifdef USE_BULLET +#ifdef WITH_BULLET //Debug Modes constants to be used with setDebugMode() python function KX_MACRO_addTypesToDict(d, DBG_NODEBUG, btIDebugDraw::DBG_NoDebug); KX_MACRO_addTypesToDict(d, DBG_DRAWWIREFRAME, btIDebugDraw::DBG_DrawWireframe); @@ -732,7 +732,7 @@ PyObject *initPythonConstraintBinding() KX_MACRO_addTypesToDict(d, DBG_DRAWCONSTRAINTS, btIDebugDraw::DBG_DrawConstraints); KX_MACRO_addTypesToDict(d, DBG_DRAWCONSTRAINTLIMITS, btIDebugDraw::DBG_DrawConstraintLimits); KX_MACRO_addTypesToDict(d, DBG_FASTWIREFRAME, btIDebugDraw::DBG_FastWireframe); -#endif // USE_BULLET +#endif // WITH_BULLET //Constraint types to be used with createConstraint() python function KX_MACRO_addTypesToDict(d, POINTTOPOINT_CONSTRAINT, PHY_POINT2POINT_CONSTRAINT); diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index 55c9ff5307f..bb2f9a8354a 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -88,7 +88,7 @@ #include "BL_DeformableGameObject.h" #include "KX_ObstacleSimulation.h" -#ifdef USE_BULLET +#ifdef WITH_BULLET #include "KX_SoftBodyDeformer.h" #include "KX_ConvertPhysicsObject.h" #include "CcdPhysicsEnvironment.h" @@ -1131,7 +1131,7 @@ void KX_Scene::ReplaceMesh(class CValue* obj,void* meshobj, bool use_gfx, bool u blendobj->parent && // original object had armature (not sure this test is needed) blendobj->parent->type == OB_ARMATURE && blendmesh->dvert!=NULL; // mesh has vertex group -#ifdef USE_BULLET +#ifdef WITH_BULLET bool bHasSoftBody = (!parentobj && (blendobj->gameflag & OB_SOFT_BODY)); #endif bool releaseParent = true; @@ -1222,7 +1222,7 @@ void KX_Scene::ReplaceMesh(class CValue* obj,void* meshobj, bool use_gfx, bool u ); newobj->SetDeformer(meshdeformer); } -#ifdef USE_BULLET +#ifdef WITH_BULLET else if (bHasSoftBody) { KX_SoftBodyDeformer *softdeformer = new KX_SoftBodyDeformer(mesh, newobj); @@ -1239,7 +1239,7 @@ void KX_Scene::ReplaceMesh(class CValue* obj,void* meshobj, bool use_gfx, bool u gameobj->AddMeshUser(); } -#ifdef USE_BULLET +#ifdef WITH_BULLET if (use_phys) { /* update the new assigned mesh with the physics mesh */ KX_ReInstanceBulletShapeFromMesh(gameobj, NULL, use_gfx?NULL:mesh); } @@ -1756,7 +1756,7 @@ short KX_Scene::GetAnimationFPS() return m_blenderScene->r.frs_sec; } -#ifdef USE_BULLET +#ifdef WITH_BULLET #include "KX_BulletPhysicsController.h" #endif @@ -1768,7 +1768,7 @@ static void MergeScene_LogicBrick(SCA_ILogicBrick* brick, KX_Scene *to) brick->Replace_NetworkScene(to->GetNetworkScene()); /* near sensors have physics controllers */ -#ifdef USE_BULLET +#ifdef WITH_BULLET KX_TouchSensor *touch_sensor = dynamic_cast(brick); if (touch_sensor) { touch_sensor->GetPhysicsController()->SetPhysicsEnvironment(to->GetPhysicsEnvironment()); @@ -1789,7 +1789,7 @@ static void MergeScene_LogicBrick(SCA_ILogicBrick* brick, KX_Scene *to) } } -#ifdef USE_BULLET +#ifdef WITH_BULLET #include "CcdGraphicController.h" // XXX ctrl->SetPhysicsEnvironment(to->GetPhysicsEnvironment()); #include "CcdPhysicsEnvironment.h" // XXX ctrl->SetPhysicsEnvironment(to->GetPhysicsEnvironment()); #include "KX_BulletPhysicsController.h" @@ -1858,7 +1858,7 @@ static void MergeScene_GameObject(KX_GameObject* gameobj, KX_Scene *to, KX_Scene for (int i=0; iSetSGClientInfo(to); } -#ifdef USE_BULLET +#ifdef WITH_BULLET SGControllerList::iterator contit; SGControllerList& controllers = sg->GetSGControllerList(); for (contit = controllers.begin();contit!=controllers.end();++contit) @@ -1867,7 +1867,7 @@ static void MergeScene_GameObject(KX_GameObject* gameobj, KX_Scene *to, KX_Scene if (phys_ctrl) phys_ctrl->SetPhysicsEnvironment(to->GetPhysicsEnvironment()); } -#endif // USE_BULLET +#endif // WITH_BULLET } /* If the object is a light, update it's scene */ if (gameobj->GetGameObjectType() == SCA_IObject::OBJ_LIGHT) @@ -1886,7 +1886,7 @@ static void MergeScene_GameObject(KX_GameObject* gameobj, KX_Scene *to, KX_Scene bool KX_Scene::MergeScene(KX_Scene *other) { -#ifdef USE_BULLET +#ifdef WITH_BULLET CcdPhysicsEnvironment *env= dynamic_cast(this->GetPhysicsEnvironment()); CcdPhysicsEnvironment *env_other= dynamic_cast(other->GetPhysicsEnvironment()); @@ -1896,7 +1896,7 @@ bool KX_Scene::MergeScene(KX_Scene *other) printf("\tsource %d, terget %d\n", (int)(env!=NULL), (int)(env_other!=NULL)); return false; } -#endif // USE_BULLET +#endif // WITH_BULLET if (GetSceneConverter() != other->GetSceneConverter()) { printf("KX_Scene::MergeScene: converters differ, aborting\n"); @@ -1939,7 +1939,7 @@ bool KX_Scene::MergeScene(KX_Scene *other) GetLightList()->MergeList(other->GetLightList()); other->GetLightList()->ReleaseAndRemoveAll(); -#ifdef USE_BULLET +#ifdef WITH_BULLET if (env) /* bullet scene? - dummy scenes don't need touching */ env->MergeEnvironment(env_other); #endif diff --git a/source/gameengine/Ketsji/SConscript b/source/gameengine/Ketsji/SConscript index da1a72b4758..0690bdd6538 100644 --- a/source/gameengine/Ketsji/SConscript +++ b/source/gameengine/Ketsji/SConscript @@ -71,7 +71,7 @@ if env['WITH_BF_CXX_GUARDEDALLOC']: defs.append('WITH_CXX_GUARDEDALLOC') if env['WITH_BF_BULLET']: - defs.append('USE_BULLET') + defs.append('WITH_BULLET') incs += ' #source/gameengine/Physics/Bullet' if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'): diff --git a/source/gameengine/Physics/Bullet/CMakeLists.txt b/source/gameengine/Physics/Bullet/CMakeLists.txt index afb166eee57..c5b601361d9 100644 --- a/source/gameengine/Physics/Bullet/CMakeLists.txt +++ b/source/gameengine/Physics/Bullet/CMakeLists.txt @@ -62,7 +62,7 @@ if(WITH_BULLET) list(APPEND INC ${BULLET_INCLUDE_DIRS} ) - add_definitions(-DUSE_BULLET) + add_definitions(-DWITH_BULLET) endif() blender_add_lib(ge_phys_bullet "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/gameengine/Physics/Bullet/SConscript b/source/gameengine/Physics/Bullet/SConscript index 83239cf979a..6ef2750e8d6 100644 --- a/source/gameengine/Physics/Bullet/SConscript +++ b/source/gameengine/Physics/Bullet/SConscript @@ -56,6 +56,6 @@ if env['WITH_BF_CXX_GUARDEDALLOC']: defs.append('WITH_CXX_GUARDEDALLOC') if env['WITH_BF_BULLET']: - defs.append('USE_BULLET') + defs.append('WITH_BULLET') env.BlenderLib ( 'ge_phys_bullet', Split(sources), Split(incs), defs, libtype=['core','player'], priority=[350,50], cxx_compileflags=env['BGE_CXXFLAGS'])