From 350e2e03935861a72215f984f9707f08bcf4dbd3 Mon Sep 17 00:00:00 2001 From: "erwin.coumans" Date: Thu, 11 Sep 2008 20:20:31 +0000 Subject: [PATCH] btDbvtVolume needs to be 16-byte aligned, otherwise SIMD version crashes. --- .../CollisionDispatch/btCompoundCollisionAlgorithm.cpp | 2 +- src/BulletSoftBody/btSoftBody.cpp | 4 ++-- src/BulletSoftBody/btSoftBodyInternals.h | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp b/src/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp index d26482e03..da9336c55 100644 --- a/src/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp +++ b/src/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp @@ -183,7 +183,7 @@ void btCompoundCollisionAlgorithm::processCollision (btCollisionObject* body0,bt otherInCompoundSpace = colObj->getWorldTransform().inverse() * otherObj->getWorldTransform(); otherObj->getCollisionShape()->getAabb(otherInCompoundSpace,localAabbMin,localAabbMax); - const btDbvtVolume bounds=btDbvtVolume::FromMM(localAabbMin,localAabbMax); + const ATTRIBUTE_ALIGNED16(btDbvtVolume) bounds=btDbvtVolume::FromMM(localAabbMin,localAabbMax); //process all children, that overlap with the given AABB bounds tree->collideTV(tree->m_root,bounds,callback); diff --git a/src/BulletSoftBody/btSoftBody.cpp b/src/BulletSoftBody/btSoftBody.cpp index 6320258aa..036022379 100644 --- a/src/BulletSoftBody/btSoftBody.cpp +++ b/src/BulletSoftBody/btSoftBody.cpp @@ -2002,7 +2002,7 @@ for(i=0;im_x); mx.setMax(c.m_nodes[j]->m_x); } - const btDbvtVolume bounds=btDbvtVolume::FromMM(mi,mx); + const ATTRIBUTE_ALIGNED16(btDbvtVolume) bounds=btDbvtVolume::FromMM(mi,mx); if(c.m_leaf) m_cdbvt.update(c.m_leaf,bounds,c.m_lv*m_sst.sdt*3,m_sst.radmrg); else @@ -2532,7 +2532,7 @@ switch(m_cfg.collisions&fCollision::RVSmask) const btScalar basemargin=getCollisionShape()->getMargin(); btVector3 mins; btVector3 maxs; - btDbvtVolume volume; + ATTRIBUTE_ALIGNED16(btDbvtVolume) volume; pco->getCollisionShape()->getAabb( pco->getInterpolationWorldTransform(), mins, maxs); diff --git a/src/BulletSoftBody/btSoftBodyInternals.h b/src/BulletSoftBody/btSoftBodyInternals.h index fd8e8b71c..7466bdb4c 100644 --- a/src/BulletSoftBody/btSoftBodyInternals.h +++ b/src/BulletSoftBody/btSoftBodyInternals.h @@ -750,7 +750,8 @@ struct btSoftColliders friction = btMin(psb->m_cfg.kDF,prb->getFriction()); btVector3 mins; btVector3 maxs; - btDbvtVolume volume; + + ATTRIBUTE_ALIGNED16(btDbvtVolume) volume; pr->getCollisionShape()->getAabb(pr->getInterpolationWorldTransform(),mins,maxs); volume=btDbvtVolume::FromMM(mins,maxs); volume.Expand(btVector3(1,1,1)*margin);