bullet: Rebuild with new freeglut.
This commit is contained in:
@@ -3,29 +3,33 @@
|
||||
_realname=bullet
|
||||
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}" "${MINGW_PACKAGE_PREFIX}-${_realname}-debug")
|
||||
pkgver=2.83
|
||||
pkgrel=1
|
||||
pkgrel=2
|
||||
pkgdesc="A 3D Collision Detection and Rigid Body Dynamics Library for games and animation (mingw-w64)"
|
||||
arch=('any')
|
||||
url="http://www.bulletphysics.com/Bullet/"
|
||||
license=('custom:zlib')
|
||||
options=('!strip' 'staticlibs')
|
||||
#optdepends=('bullet-docs: documentation')
|
||||
makedepends=("${MINGW_PACKAGE_PREFIX}-cmake" "${MINGW_PACKAGE_PREFIX}-freeglut")
|
||||
makedepends=("${MINGW_PACKAGE_PREFIX}-cmake"
|
||||
"${MINGW_PACKAGE_PREFIX}-gcc"
|
||||
"${MINGW_PACKAGE_PREFIX}-freeglut")
|
||||
source=(#"http://bullet.googlecode.com/files/bullet-${pkgver}-${_rev}.tgz"
|
||||
https://github.com/bulletphysics/bullet3/archive/Bullet-${pkgver}-alpha.tar.gz
|
||||
remove-absent-demo.patch
|
||||
install-pkgconfig-files-mingw.patch
|
||||
cast-error.patch)
|
||||
cast-error.patch
|
||||
promit-bulletcollisions.patch)
|
||||
md5sums=('f459bb08387eb5696467109f44c1d4fd'
|
||||
'70eda7f29f87cc3b65b58cb417e14201'
|
||||
'2c243be67782ceb32a96aad61e668e83'
|
||||
'8db1300cf01a0fb244cb4b3ea5eb102e')
|
||||
'8db1300cf01a0fb244cb4b3ea5eb102e'
|
||||
'1340ed3f23915dcaf8e29d0eedc5e8c3')
|
||||
|
||||
prepare () {
|
||||
cd ${srcdir}/bullet3-Bullet-${pkgver}-alpha
|
||||
patch -p1 -i ${srcdir}/remove-absent-demo.patch
|
||||
patch -p1 -i ${srcdir}/install-pkgconfig-files-mingw.patch
|
||||
patch -p1 -i ${srcdir}/cast-error.patch
|
||||
patch -p0 -i ${srcdir}/promit-bulletcollisions.patch
|
||||
}
|
||||
|
||||
build() {
|
||||
@@ -103,16 +107,3 @@ package_mingw-w64-x86_64-bullet() {
|
||||
package_mingw-w64-x86_64-bullet-debug() {
|
||||
build_debug
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "${srcdir}/bullet-${pkgver}-${_rev}/build-${MINGW_CHOST}"
|
||||
make install # DESTDIR="${pkgdir}${MINGW_PREFIX}"
|
||||
install -d "${pkgdir}${MINGW_PREFIX}"/bin
|
||||
mv "${pkgdir}${MINGW_PREFIX}"/lib/*.dll "${pkgdir}${MINGW_PREFIX}"/bin/
|
||||
|
||||
pushd ${pkgdir}${MINGW_PREFIX} > /dev/null
|
||||
export PREFIX_WIN=`pwd -W`
|
||||
popd > /dev/null
|
||||
sed -s "s|${PREFIX_WIN}|${MINGW_PREFIX}|g" \
|
||||
-i ${pkgdir}${MINGW_PREFIX}/lib/pkgconfig/bullet.pc
|
||||
}
|
||||
|
||||
63
mingw-w64-bullet/promit-bulletcollisions.patch
Normal file
63
mingw-w64-bullet/promit-bulletcollisions.patch
Normal file
@@ -0,0 +1,63 @@
|
||||
Index: src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp
|
||||
===================================================================
|
||||
--- src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp (revision 45)
|
||||
+++ src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp (working copy)
|
||||
@@ -22,6 +22,8 @@
|
||||
ContactDestroyedCallback gContactDestroyedCallback = 0;
|
||||
ContactProcessedCallback gContactProcessedCallback = 0;
|
||||
|
||||
+CollisionStartedCallback gCollisionStartedCallback = 0;
|
||||
+CollisionEndedCallback gCollisionEndedCallback = 0;
|
||||
|
||||
|
||||
btPersistentManifold::btPersistentManifold()
|
||||
Index: src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.h
|
||||
===================================================================
|
||||
--- src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.h (revision 45)
|
||||
+++ src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.h (working copy)
|
||||
@@ -32,6 +32,11 @@
|
||||
extern ContactDestroyedCallback gContactDestroyedCallback;
|
||||
extern ContactProcessedCallback gContactProcessedCallback;
|
||||
|
||||
+typedef void (*CollisionStartedCallback)(class btPersistentManifold* manifold);
|
||||
+typedef void (*CollisionEndedCallback)(class btPersistentManifold* manifold);
|
||||
+extern CollisionStartedCallback gCollisionStartedCallback;
|
||||
+extern CollisionEndedCallback gCollisionEndedCallback;
|
||||
+
|
||||
//the enum starts at 1024 to avoid type conflicts with btTypedConstraint
|
||||
enum btContactManifoldTypes
|
||||
{
|
||||
@@ -159,6 +164,11 @@
|
||||
|
||||
btAssert(m_pointCache[lastUsedIndex].m_userPersistentData==0);
|
||||
m_cachedPoints--;
|
||||
+
|
||||
+ if(gCollisionEndedCallback && m_cachedPoints == 0)
|
||||
+ {
|
||||
+ gCollisionEndedCallback(this);
|
||||
+ }
|
||||
}
|
||||
void replaceContactPoint(const btManifoldPoint& newPoint,int insertIndex)
|
||||
{
|
||||
Index: src/BulletCollision/CollisionDispatch/btManifoldResult.cpp
|
||||
===================================================================
|
||||
--- src/BulletCollision/CollisionDispatch/btManifoldResult.cpp (revision 45)
|
||||
+++ src/BulletCollision/CollisionDispatch/btManifoldResult.cpp (working copy)
|
||||
@@ -68,6 +68,7 @@
|
||||
// if (depth > m_manifoldPtr->getContactProcessingThreshold())
|
||||
return;
|
||||
|
||||
+ bool isNewCollision = m_manifoldPtr->getNumContacts() == 0;
|
||||
bool isSwapped = m_manifoldPtr->getBody0() != m_body0Wrap->getCollisionObject();
|
||||
|
||||
btVector3 pointA = pointInWorld + normalOnBInWorld * depth;
|
||||
@@ -131,5 +132,9 @@
|
||||
(*gContactAddedCallback)(m_manifoldPtr->getContactPoint(insertIndex),obj0,newPt.m_partId0,newPt.m_index0,obj1,newPt.m_partId1,newPt.m_index1);
|
||||
}
|
||||
|
||||
+ if (gCollisionStartedCallback && isNewCollision)
|
||||
+ {
|
||||
+ gCollisionStartedCallback(m_manifoldPtr);
|
||||
+ }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user