mirror of
https://github.com/lubosz/overte.git
synced 2025-04-23 13:33:38 +02:00
Merge pull request #12978 from AndrewMeadows/fix-crash-createConvexHull-RC66.1
RC66.1: don't try to build convex hulls with nan data
This commit is contained in:
commit
47c983a004
1 changed files with 6 additions and 1 deletions
|
@ -114,6 +114,11 @@ btConvexHullShape* createConvexHull(const ShapeInfo::PointList& points) {
|
|||
minCorner = glm::min(minCorner, points[i]);
|
||||
}
|
||||
center /= (float)(points.size());
|
||||
if (glm::any(glm::isnan(center))) {
|
||||
// don't feed garbage to Bullet
|
||||
assert(false); // crash here in DEBUG so we can investigate source of bad input
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
float margin = hull->getMargin();
|
||||
|
||||
|
@ -265,7 +270,7 @@ btTriangleIndexVertexArray* createStaticMeshArray(const ShapeInfo& info) {
|
|||
}
|
||||
|
||||
const btCollisionShape* ShapeFactory::createShapeFromInfo(const ShapeInfo& info) {
|
||||
btCollisionShape* shape = NULL;
|
||||
btCollisionShape* shape = nullptr;
|
||||
int type = info.getType();
|
||||
switch(type) {
|
||||
case SHAPE_TYPE_BOX: {
|
||||
|
|
Loading…
Reference in a new issue