fix broken OS X build

This commit is contained in:
erwin.coumans
2008-10-29 07:01:56 +00:00
parent 487cc1cdf1
commit 2a871176d4
2 changed files with 17 additions and 7 deletions

View File

@@ -794,13 +794,13 @@ inline void btDbvt::collideTT( const btDbvtNode* root0,
m_stkStack.resize(DOUBLE_STACKSIZE); m_stkStack.resize(DOUBLE_STACKSIZE);
m_stkStack[0]=sStkNN(root0,root1); m_stkStack[0]=sStkNN(root0,root1);
do { do {
sStkNN p=stack[--depth]; sStkNN p=m_stkStack[--depth];
if(Intersect(p.a->volume,p.b->volume,xform)) if(Intersect(p.a->volume,p.b->volume,xform))
{ {
if(depth>treshold) if(depth>treshold)
{ {
m_stkStack.resize(stack.size()*2); m_stkStack.resize(m_stkStack.size()*2);
treshold=stack.size()-4; treshold=m_stkStack.size()-4;
} }
if(p.a->isinternal()) if(p.a->isinternal())
{ {

View File

@@ -486,13 +486,17 @@ void btSoftBody::setTotalDensity(btScalar density)
void btSoftBody::transform(const btTransform& trs) void btSoftBody::transform(const btTransform& trs)
{ {
const btScalar margin=getCollisionShape()->getMargin(); const btScalar margin=getCollisionShape()->getMargin();
ATTRIBUTE_ALIGNED16(btDbvtVolume) vol;
for(int i=0,ni=m_nodes.size();i<ni;++i) for(int i=0,ni=m_nodes.size();i<ni;++i)
{ {
Node& n=m_nodes[i]; Node& n=m_nodes[i];
n.m_x=trs*n.m_x; n.m_x=trs*n.m_x;
n.m_q=trs*n.m_q; n.m_q=trs*n.m_q;
n.m_n=trs.getBasis()*n.m_n; n.m_n=trs.getBasis()*n.m_n;
m_ndbvt.update(n.m_leaf,btDbvtVolume::FromCR(n.m_x,margin)); vol = btDbvtVolume::FromCR(n.m_x,margin);
m_ndbvt.update(n.m_leaf,vol);
} }
updateNormals(); updateNormals();
updateBounds(); updateBounds();
@@ -521,12 +525,15 @@ void btSoftBody::rotate( const btQuaternion& rot)
void btSoftBody::scale(const btVector3& scl) void btSoftBody::scale(const btVector3& scl)
{ {
const btScalar margin=getCollisionShape()->getMargin(); const btScalar margin=getCollisionShape()->getMargin();
ATTRIBUTE_ALIGNED16(btDbvtVolume) vol;
for(int i=0,ni=m_nodes.size();i<ni;++i) for(int i=0,ni=m_nodes.size();i<ni;++i)
{ {
Node& n=m_nodes[i]; Node& n=m_nodes[i];
n.m_x*=scl; n.m_x*=scl;
n.m_q*=scl; n.m_q*=scl;
m_ndbvt.update(n.m_leaf,btDbvtVolume::FromCR(n.m_x,margin)); vol = btDbvtVolume::FromCR(n.m_x,margin);
m_ndbvt.update(n.m_leaf,vol);
} }
updateNormals(); updateNormals();
updateBounds(); updateBounds();
@@ -1303,11 +1310,13 @@ void btSoftBody::predictMotion(btScalar dt)
/* Bounds */ /* Bounds */
updateBounds(); updateBounds();
/* Nodes */ /* Nodes */
ATTRIBUTE_ALIGNED16(btDbvtVolume) vol;
for(i=0,ni=m_nodes.size();i<ni;++i) for(i=0,ni=m_nodes.size();i<ni;++i)
{ {
Node& n=m_nodes[i]; Node& n=m_nodes[i];
vol = btDbvtVolume::FromCR(n.m_x,m_sst.radmrg);
m_ndbvt.update( n.m_leaf, m_ndbvt.update( n.m_leaf,
btDbvtVolume::FromCR(n.m_x,m_sst.radmrg), vol,
n.m_v*m_sst.velmrg, n.m_v*m_sst.velmrg,
m_sst.updmrg); m_sst.updmrg);
} }
@@ -1320,8 +1329,9 @@ void btSoftBody::predictMotion(btScalar dt)
const btVector3 v=( f.m_n[0]->m_v+ const btVector3 v=( f.m_n[0]->m_v+
f.m_n[1]->m_v+ f.m_n[1]->m_v+
f.m_n[2]->m_v)/3; f.m_n[2]->m_v)/3;
vol = VolumeOf(f,m_sst.radmrg);
m_fdbvt.update( f.m_leaf, m_fdbvt.update( f.m_leaf,
VolumeOf(f,m_sst.radmrg), vol,
v*m_sst.velmrg, v*m_sst.velmrg,
m_sst.updmrg); m_sst.updmrg);
} }