Forráskód Böngészése

Add bullet3 submodule

Daniele Bartolini 10 éve
szülő
commit
dc83bc9720
6 módosított fájl, 129 hozzáadás és 4 törlés
  1. 3 0
      .gitmodules
  2. 70 0
      genie/bullet.lua
  3. 43 1
      genie/crown.lua
  4. 9 0
      genie/genie.lua
  5. 3 3
      makefile
  6. 1 0
      third/bullet3

+ 3 - 0
.gitmodules

@@ -4,3 +4,6 @@
 [submodule "third/bgfx"]
 	path = third/bgfx
 	url = https://github.com/taylor001/bgfx.git
+[submodule "third/bullet3"]
+	path = third/bullet3
+	url = https://github.com/taylor001/bullet3.git

+ 70 - 0
genie/bullet.lua

@@ -0,0 +1,70 @@
+--
+-- Copyright (c) 2012-2016 Daniele Bartolini and individual contributors.
+-- License: https://github.com/taylor001/crown/blob/master/LICENSE
+--
+
+local BULLET_DIR = (CROWN_DIR .. "third/bullet3/")
+
+project "bullet"
+	kind "StaticLib"
+	language "C++"
+
+	configuration {}
+
+	configuration { "development or release", "linux-*" }
+		buildoptions {
+			"-O2",
+			"-fomit-frame-pointer",
+		}
+
+	configuration { "linux-*" }
+		links { "dl" }
+		defines { "B3_USE_CLEW" }
+
+	includedirs {
+		BULLET_DIR .. "src",
+		BULLET_DIR .. "src/Bullet3OpenCL",
+		BULLET_DIR .. "src/clew",
+	}
+
+	files {
+		BULLET_DIR .. "src/*.cpp",
+		BULLET_DIR .. "src/BulletCollision/*.cpp",
+		BULLET_DIR .. "src/BulletCollision/BroadphaseCollision/*.cpp",
+		BULLET_DIR .. "src/BulletCollision/CollisionDispatch/*.cpp",
+		BULLET_DIR .. "src/BulletCollision/CollisionShapes/*.cpp",
+		BULLET_DIR .. "src/BulletCollision/Gimpact/*.cpp",
+		BULLET_DIR .. "src/BulletCollision/NarrowPhaseCollision/*.cpp",
+
+		BULLET_DIR .. "src/BulletDynamics/Character/*.cpp",
+		BULLET_DIR .. "src/BulletDynamics/ConstraintSolver/*.cpp",
+		BULLET_DIR .. "src/BulletDynamics/Dynamics/*.cpp",
+		BULLET_DIR .. "src/BulletDynamics/Featherstone/*.cpp",
+		BULLET_DIR .. "src/BulletDynamics/MLCPSolvers/*.cpp",
+		BULLET_DIR .. "src/BulletDynamics/Vehicle/*.cpp",
+
+		BULLET_DIR .. "src/BulletSoftBody/*.cpp",
+
+		BULLET_DIR .. "src/LinearMath/*.cpp",
+
+		BULLET_DIR .. "src/Bullet3Collision/BroadphaseCollision/*.cpp",
+		BULLET_DIR .. "src/Bullet3Collision/NarrowPhaseCollision/*.cpp",
+
+		BULLET_DIR .. "src/Bullet3Common/*.cpp",
+		BULLET_DIR .. "src/Bullet3Common/shared/*.cpp",
+
+		BULLET_DIR .. "src/Bullet3Dynamics/*.cpp",
+		BULLET_DIR .. "src/Bullet3Dynamics/ConstraintSolver/*.cpp",
+		BULLET_DIR .. "src/Bullet3Dynamics/shared/*.cpp",
+
+		BULLET_DIR .. "src/Bullet3Geometry/*.cpp",
+
+		BULLET_DIR .. "src/Bullet3Serialize/**.cpp",
+
+		BULLET_DIR .. "src/clew/clew.c",
+		BULLET_DIR .. "src/clew/clew.h",
+
+		BULLET_DIR .. "src/Bullet3OpenCL/**.cpp",
+	}
+
+	configuration {}

+ 43 - 1
genie/crown.lua

@@ -38,12 +38,54 @@ function crown_project(_name, _kind, _defines)
 			CROWN_DIR .. "third/stb_vorbis",
 		}
 
+		if _OPTIONS["with-bullet"] then
+			includedirs {
+				CROWN_DIR .. "third/bullet3/src",
+				CROWN_DIR .. "third/bullet3/src/Bullet3Collision",
+				CROWN_DIR .. "third/bullet3/src/Bullet3Collision/BroadPhaseCollision",
+				CROWN_DIR .. "third/bullet3/src/Bullet3Collision/NarrowPhaseCollision",
+				CROWN_DIR .. "third/bullet3/src/Bullet3Common",
+				CROWN_DIR .. "third/bullet3/src/Bullet3Dynamics",
+				CROWN_DIR .. "third/bullet3/src/Bullet3Dynamics/ConstraintSover",
+				CROWN_DIR .. "third/bullet3/src/Bullet3Geometry",
+				CROWN_DIR .. "third/bullet3/src/Bullet3OpenCL",
+				CROWN_DIR .. "third/bullet3/src/Bullet3OpenCL/BroadphaseCollision",
+				CROWN_DIR .. "third/bullet3/src/Bullet3OpenCL/initialize",
+				CROWN_DIR .. "third/bullet3/src/Bullet3OpenCL/NarrowPhaseCollision",
+				CROWN_DIR .. "third/bullet3/src/Bullet3OpenCL/ParallelPrimitives",
+				CROWN_DIR .. "third/bullet3/src/Bullet3OpenCL/Raycast",
+				CROWN_DIR .. "third/bullet3/src/Bullet3OpenCL/RigidBody",
+				CROWN_DIR .. "third/bullet3/src/Bullet3Serialize",
+				CROWN_DIR .. "third/bullet3/src/Bullet3Serialize/Bullet2FileLoader",
+				CROWN_DIR .. "third/bullet3/src/BulletCollision",
+				CROWN_DIR .. "third/bullet3/src/BulletCollision/BroadphaseCollision",
+				CROWN_DIR .. "third/bullet3/src/BulletCollision/CollisionDispatch",
+				CROWN_DIR .. "third/bullet3/src/BulletCollision/CollisionShapes",
+				CROWN_DIR .. "third/bullet3/src/BulletCollision/Gimpact",
+				CROWN_DIR .. "third/bullet3/src/BulletCollision/NarrowPhaseCollision",
+				CROWN_DIR .. "third/bullet3/src/BulletDynamics",
+				CROWN_DIR .. "third/bullet3/src/BulletDynamics/Character",
+				CROWN_DIR .. "third/bullet3/src/BulletDynamics/ConstraintSolver",
+				CROWN_DIR .. "third/bullet3/src/BulletDynamics/Dynamics",
+				CROWN_DIR .. "third/bullet3/src/BulletDynamics/Featherstone",
+				CROWN_DIR .. "third/bullet3/src/BulletDynamics/MLCPSolvers",
+				CROWN_DIR .. "third/bullet3/src/BulletDynamics/Vehicle",
+				CROWN_DIR .. "third/bullet3/src/BulletSoftBody",
+				CROWN_DIR .. "third/bullet3/src/LinearMath",
+				CROWN_DIR .. "third/bullet3/src/clew",
+			}
+
+			links {
+				"bullet",
+			}
+		end
+
 		defines {
 			_defines,
 		}
 
 		links {
-			"bgfx"
+			"bgfx",
 		}
 
 		if _OPTIONS["with-luajit"] then

+ 9 - 0
genie/genie.lua

@@ -22,6 +22,11 @@ newoption {
 	description = "Build with luajit support."
 }
 
+newoption {
+	trigger = "with-bullet",
+	description = "Build with Bullet support."
+}
+
 newoption {
 	trigger = "with-tools",
 	description = "Build with tools."
@@ -61,6 +66,10 @@ if _OPTIONS["with-openal"] then
 	dofile ("openal.lua")
 end
 
+if _OPTIONS["with-bullet"] then
+	dofile ("bullet.lua")
+end
+
 group "engine"
 crown_project("", "ConsoleApp", {})
 

+ 3 - 3
makefile

@@ -13,7 +13,7 @@ endif
 GENIE=third/bx/tools/bin/$(OS)/genie
 
 android-build:
-	$(GENIE) --file=genie/genie.lua --with-luajit --compiler=android-arm gmake
+	$(GENIE) --file=genie/genie.lua --with-luajit --with-bullet --compiler=android-arm gmake
 android-arm-debug: android-build
 	make -R -C build/projects/android config=debug
 android-arm-development: android-build
@@ -23,7 +23,7 @@ android-arm-release: android-build
 android-arm: android-arm-debug android-arm-development android-arm-release
 
 linux-build:
-	$(GENIE) --file=genie/genie.lua --with-luajit --with-openal --with-tools --compiler=linux-gcc gmake
+	$(GENIE) --file=genie/genie.lua --with-luajit --with-openal --with-bullet --with-tools --compiler=linux-gcc gmake
 linux-debug32: linux-build
 	make -R -C build/projects/linux config=debug32
 linux-development32: linux-build
@@ -39,7 +39,7 @@ linux-release64: linux-build
 linux: linux-debug32 linux-development32 linux-release32 linux-debug64 linux-development64 linux-release64
 
 windows-build:
-	$(GENIE) --file=genie\genie.lua --with-luajit --with-openal --with-tools vs2013
+	$(GENIE) --file=genie\genie.lua --with-luajit --with-openal --with-bullet --with-tools vs2013
 windows-debug32: windows-build
 	devenv build/projects/vs2013/crown.sln /Build "debug|Win32"
 windows-development32: windows-build

+ 1 - 0
third/bullet3

@@ -0,0 +1 @@
+Subproject commit 571a6ba9c486f30133f66d5e6c87f68b96b34b8a