mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 18:50:00 +02:00
try out smaller collision margins
This commit is contained in:
parent
80749195e6
commit
2ec660bd42
1 changed files with 3 additions and 0 deletions
|
@ -14,6 +14,7 @@
|
||||||
#include "ShapeInfoUtil.h"
|
#include "ShapeInfoUtil.h"
|
||||||
#include "BulletUtil.h"
|
#include "BulletUtil.h"
|
||||||
|
|
||||||
|
const float BULLET_COLLISION_MARGIN = 0.01;
|
||||||
|
|
||||||
btCollisionShape* ShapeInfoUtil::createShapeFromInfo(const ShapeInfo& info) {
|
btCollisionShape* ShapeInfoUtil::createShapeFromInfo(const ShapeInfo& info) {
|
||||||
btCollisionShape* shape = NULL;
|
btCollisionShape* shape = NULL;
|
||||||
|
@ -44,6 +45,7 @@ btCollisionShape* ShapeInfoUtil::createShapeFromInfo(const ShapeInfo& info) {
|
||||||
btVector3 btPoint(point[0], point[1], point[2]);
|
btVector3 btPoint(point[0], point[1], point[2]);
|
||||||
hull->addPoint(btPoint, false);
|
hull->addPoint(btPoint, false);
|
||||||
}
|
}
|
||||||
|
hull->setMargin(BULLET_COLLISION_MARGIN);
|
||||||
hull->recalcLocalAabb();
|
hull->recalcLocalAabb();
|
||||||
shape = hull;
|
shape = hull;
|
||||||
} else {
|
} else {
|
||||||
|
@ -60,6 +62,7 @@ btCollisionShape* ShapeInfoUtil::createShapeFromInfo(const ShapeInfo& info) {
|
||||||
hull->recalcLocalAabb();
|
hull->recalcLocalAabb();
|
||||||
compound->addChildShape (trans, hull);
|
compound->addChildShape (trans, hull);
|
||||||
}
|
}
|
||||||
|
compound->setMargin(BULLET_COLLISION_MARGIN);
|
||||||
shape = compound;
|
shape = compound;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue