diff options
author | Simon Clitherow <aphex@nildram.co.uk> | 2005-08-02 01:19:41 +0400 |
---|---|---|
committer | Simon Clitherow <aphex@nildram.co.uk> | 2005-08-02 01:19:41 +0400 |
commit | 208da2a5d0eaf2f64f7b73d0b24b619d7546bf8d (patch) | |
tree | 242fcb58abef2c0e2af01cc1d9f03dbed6308fae | |
parent | bc865d6d2098d82f9a00655b8aa89a326244db0a (diff) |
Added support for compiling BULLET with scons on windows
using bandoler's patch as a basis (thanks!).
A couple of notes:
- This is for windows only, I did not have a chance to try linux yet.
- SConscript for PHY_Bullet may need tweaking (plus support
for other platforms), but at least it's in there :)
Any problems, shout :)
-rw-r--r-- | SConstruct | 19 | ||||
-rw-r--r-- | extern/SConscript | 3 | ||||
-rw-r--r-- | extern/bullet/SConscript | 4 | ||||
-rw-r--r-- | source/blender/makesdna/intern/SConscript | 2 | ||||
-rwxr-xr-x | source/gameengine/BlenderRoutines/SConscript | 2 | ||||
-rwxr-xr-x | source/gameengine/Converter/SConscript | 2 | ||||
-rw-r--r-- | source/gameengine/Ketsji/SConscript | 6 | ||||
-rw-r--r-- | source/gameengine/Physics/Bullet/SConscript | 22 | ||||
-rw-r--r-- | source/gameengine/SConscript | 2 | ||||
-rw-r--r-- | tools/scons/bs/bs_libs.py | 2 |
10 files changed, 58 insertions, 6 deletions
diff --git a/SConstruct b/SConstruct index 1ff6d4a5747..73d506405a4 100644 --- a/SConstruct +++ b/SConstruct @@ -331,8 +331,9 @@ elif sys.platform == 'win32': use_openal = 'true' use_fmod = 'false' use_quicktime = 'true' - use_sumo = 'true' + use_sumo = 'false' use_ode = 'false' + use_bullet = 'true' use_buildinfo = 'true' build_blender_dynamic = 'true' build_blender_static = 'false' @@ -402,6 +403,10 @@ elif sys.platform == 'win32': qhull_lib = ['qhull'] qhull_libpath = ['#../lib/windows/qhull/lib'] qhull_include = ['#extern/qhull/include'] + # Bullet library information + bullet_lib = [] + bullet_libpath = [] + bullet_include = ['#extern/bullet','#extern/bullet/LinearMath','#extern/bullet/Bullet','#extern/bullet/BulletDynamics'] # ODE library information ode_lib = [] # TODO ode_libpath = ['#../lib/windows/ode/lib'] @@ -794,6 +799,8 @@ else: config.write ("BUILD_GAMEENGINE = %r\n"%(use_gameengine)) if use_ode == 'true': config.write ("USE_PHYSICS = 'ode'\n") + elif use_bullet == 'true': + config.write("USE_PHYSICS = 'bullet'\n") else: config.write ("USE_PHYSICS = 'solid'\n") config.write ("USE_OPENAL = %r\n"%(use_openal)) @@ -842,6 +849,9 @@ else: config.write ("ODE_INCLUDE = %r\n"%(ode_include)) config.write ("ODE_LIBPATH = %r\n"%(ode_libpath)) config.write ("ODE_LIBRARY = %r\n"%(ode_lib)) + config.write ("BULLET_INCLUDE = %r\n"%(bullet_include)) + config.write ("BULLET_LIBPATH = %r\n"%(bullet_libpath)) + config.write ("BULLET_LIBRARY = %r\n"%(bullet_lib)) config.write ("OPENAL_INCLUDE = %r\n"%(openal_include)) config.write ("OPENAL_LIBPATH = %r\n"%(openal_libpath)) config.write ("OPENAL_LIBRARY = %r\n"%(openal_lib)) @@ -891,7 +901,7 @@ user_options.AddOptions ( 'false')), (EnumOption ('USE_PHYSICS', 'solid', 'Select which physics engine to use.', - allowed_values = ('ode', 'solid'))), + allowed_values = ('ode', 'solid', 'bullet'))), (BoolOption ('BUILD_GAMEENGINE', 'Set to 1 to build blender with game engine support.', 'false')), @@ -943,6 +953,9 @@ user_options.AddOptions ( ('ODE_INCLUDE', 'Include directory for ODE header files.'), ('ODE_LIBPATH', 'Library path where the ODE library is located.'), ('ODE_LIBRARY', 'ODE library name.'), + ('BULLET_INCLUDE', 'Include directory for BULLET header files.'), + ('BULLET_LIBPATH', 'Library path where the BULLET library is located.'), + ('BULLET_LIBRARY', 'BULLET library name'), ('OPENAL_INCLUDE', 'Include directory for OpenAL header files.'), ('OPENAL_LIBPATH', 'Library path where the OpenAL library is located.'), ('OPENAL_LIBRARY', 'OpenAL library name.'), @@ -980,6 +993,8 @@ if user_options_dict['BUILD_GAMEENGINE'] == 1: defines += ['GAMEBLENDER=1'] if user_options_dict['USE_PHYSICS'] == 'ode': defines += ['USE_ODE'] + elif user_options_dict['USE_PHYSICS'] == 'bullet': + defines += ['USE_BULLET'] else: defines += ['USE_SUMO_SOLID'] else: diff --git a/extern/SConscript b/extern/SConscript index f5f4267988d..d11db23ab7a 100644 --- a/extern/SConscript +++ b/extern/SConscript @@ -5,7 +5,8 @@ Import('user_options_dict') print "externs..." SConscript(['qhull/SConscript', - 'solid/SConscript']) + 'solid/SConscript', + 'bullet/SConscript']) if user_options_dict['USE_INTERNATIONAL'] == 1: diff --git a/extern/bullet/SConscript b/extern/bullet/SConscript index b32d43c0705..ae3763d6e45 100644 --- a/extern/bullet/SConscript +++ b/extern/bullet/SConscript @@ -83,7 +83,7 @@ bullet_sources = ['Bullet/BroadphaseCollision/BroadphaseProxy.cpp', 'BulletDynamics/ConstraintSolver/ContactConstraint.cpp', 'BulletDynamics/ConstraintSolver/OdeConstraintSolver.cpp', - 'BulletDynamics/ConstraintSolver/OdeConstraintSolver2.cpp', + #'BulletDynamics/ConstraintSolver/OdeConstraintSolver2.cpp', 'BulletDynamics/ConstraintSolver/Point2PointConstraint.cpp', 'BulletDynamics/ConstraintSolver/SimpleConstraintSolver.cpp', 'BulletDynamics/ConstraintSolver/Solve2LinearConstraint.cpp', @@ -101,4 +101,4 @@ bullet_env.Append (CPPPATH = ['.', ]) source_files = bullet_sources -bullet_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/extern_bullet', source=source_files) +bullet_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/extern_bullet', source=bullet_sources) diff --git a/source/blender/makesdna/intern/SConscript b/source/blender/makesdna/intern/SConscript index 10c7eda9730..378f2492e3c 100644 --- a/source/blender/makesdna/intern/SConscript +++ b/source/blender/makesdna/intern/SConscript @@ -25,7 +25,7 @@ makesdna_tool.Append (LIBPATH = '#'+user_options_dict['BUILD_DIR']+'/lib') makesdna_tool.Append (LIBS = 'blender_guardedalloc') makesdna_tool.Program (target = '#'+user_options_dict['BUILD_DIR']+'makesdna', source = source_files) -dna = Environment () +dna = Environment (ENV = os.environ) dna_dict = dna.Dictionary() makesdna_name = user_options_dict['BUILD_DIR']+'makesdna' + dna_dict['PROGSUFFIX'] dna.Depends ('dna.c', '#'+makesdna_name) diff --git a/source/gameengine/BlenderRoutines/SConscript b/source/gameengine/BlenderRoutines/SConscript index 6427c7c155f..f586e72ad44 100755 --- a/source/gameengine/BlenderRoutines/SConscript +++ b/source/gameengine/BlenderRoutines/SConscript @@ -35,6 +35,7 @@ kx_blenderhook_env.Append (CPPPATH=['.', '#source/gameengine/Network', '#source/gameengine/SceneGraph', '#source/gameengine/Physics/common', + '#source/gameengine/Physics/Bullet', '#source/gameengine/Physics/Sumo', '#source/gameengine/Physics/Sumo/Fuzzics/include', '#source/gameengine/Network/LoopBackNetwork', @@ -45,6 +46,7 @@ kx_blenderhook_env.Append (CPPPATH=['.', kx_blenderhook_env.Append (CPPPATH = user_options_dict['PYTHON_INCLUDE']) kx_blenderhook_env.Append (CPPPATH = user_options_dict['SOLID_INCLUDE']) +kx_blenderhook_env.Append (CPPPATH = user_options_dict['BULLET_INCLUDE']) kx_blenderhook_env.Append (CPPPATH = user_options_dict['OPENGL_INCLUDE']) if sys.platform=='win32': diff --git a/source/gameengine/Converter/SConscript b/source/gameengine/Converter/SConscript index 780295783d1..00908defdff 100755 --- a/source/gameengine/Converter/SConscript +++ b/source/gameengine/Converter/SConscript @@ -49,6 +49,7 @@ kx_converter_env.Append (CPPPATH = ['.', '#source/gameengine/Network', '#source/gameengine/SceneGraph', '#source/gameengine/Physics/common', + '#source/gameengine/Physics/Bullet', '#source/gameengine/Physics/BlOde', '#source/gameengine/Physics/Dummy', '#source/gameengine/Physics/Sumo', @@ -60,5 +61,6 @@ kx_converter_env.Append (CPPPATH = ['.', kx_converter_env.Append (CPPPATH = user_options_dict['PYTHON_INCLUDE']) kx_converter_env.Append (CPPPATH = user_options_dict['SOLID_INCLUDE']) +kx_converter_env.Append (CPPPATH = user_options_dict['BULLET_INCLUDE']) kx_converter_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/KX_converter', source=source_files) diff --git a/source/gameengine/Ketsji/SConscript b/source/gameengine/Ketsji/SConscript index 1b22231f3f9..aa74e4e29c7 100644 --- a/source/gameengine/Ketsji/SConscript +++ b/source/gameengine/Ketsji/SConscript @@ -68,6 +68,11 @@ if user_options_dict['USE_PHYSICS'] == 'ode': source_files += ['KX_OdePhysicsController.cpp'] ketsji_env.Append (CPPPATH = user_options_dict['SOLID_INCLUDE']) +if user_options_dict['USE_PHYSICS'] == 'bullet': + source_files += ['KX_BulletPhysicsController.cpp'] + ketsji_env.Append (CPPPATH = user_options_dict['BULLET_INCLUDE']) + ketsji_env.Append (CPPPATH = user_options_dict['SOLID_INCLUDE']) + ketsji_env.Append (CPPPATH = ['.', '#source/kernel/gen_system', '#intern/string', @@ -97,6 +102,7 @@ ketsji_env.Append (CPPPATH = ['.', '#source/gameengine/Network', '#source/gameengine/SceneGraph', '#source/gameengine/Physics/common', + '#source/gameengine/Physics/Bullet', '#source/gameengine/Physics/BlOde', '#source/gameengine/Physics/Dummy', '#source/gameengine/Physics/Sumo', diff --git a/source/gameengine/Physics/Bullet/SConscript b/source/gameengine/Physics/Bullet/SConscript new file mode 100644 index 00000000000..8d82f346757 --- /dev/null +++ b/source/gameengine/Physics/Bullet/SConscript @@ -0,0 +1,22 @@ +#!/usr/bin/python +import sys +Import ('user_options_dict') +Import ('library_env') + +phy_bullet_env = library_env.Copy () + +source_files = ['CcdPhysicsEnvironment.cpp', + 'CcdPhysicsController.cpp' + ] + +phy_bullet_env.Append (CPPPATH=['.', + '../common']) + +phy_bullet_env.Append (CPPPATH = user_options_dict['BULLET_INCLUDE']) + + +if sys.platform=='win32': + phy_bullet_env.Append (CXXFLAGS = ['/GR']) + phy_bullet_env.Append (CCFLAGS =['/O2']) + +phy_bullet_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/PHY_Bullet', source=source_files) diff --git a/source/gameengine/SConscript b/source/gameengine/SConscript index 1b2c6316c61..496d9dc8f3c 100644 --- a/source/gameengine/SConscript +++ b/source/gameengine/SConscript @@ -22,3 +22,5 @@ if user_options_dict['USE_PHYSICS'] == 'solid': SConscript(['Physics/Sumo/SConscript']) elif user_options_dict['USE_PHYSICS'] == 'ode': SConscript(['Physics/BlOde/SConscript']) +elif user_options_dict['USE_PHYSICS'] == 'bullet': + SConscript(['Physics/Bullet/SConscript']) diff --git a/tools/scons/bs/bs_libs.py b/tools/scons/bs/bs_libs.py index a2ed8a002c5..83cf6f1c243 100644 --- a/tools/scons/bs/bs_libs.py +++ b/tools/scons/bs/bs_libs.py @@ -87,6 +87,8 @@ def ketsji_libs(env): 'NG_loopbacknetwork']) if bs_globals.user_options_dict['USE_PHYSICS'] == 'solid': env.Append (LIBS=['PHY_Sumo', 'PHY_Physics', 'blender_MT', 'extern_solid', 'extern_qhull']) + elif bs_globals.user_options_dict['USE_PHYSICS'] == 'bullet': + env.Append (LIBS=['PHY_Bullet', 'PHY_Physics', 'blender_MT','extern_bullet']) else: env.Append (LIBS=['PHY_Ode', 'PHY_Physics']) |