From 59804a0f54df433a8ca89e014ee4fc131127f489 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Sun, 6 Mar 2016 12:58:30 -0800 Subject: [PATCH] cleanups --- .../src/RenderableModelEntityItem.cpp | 10 +--------- libraries/physics/src/ShapeFactory.cpp | 16 +--------------- 2 files changed, 2 insertions(+), 24 deletions(-) diff --git a/libraries/entities-renderer/src/RenderableModelEntityItem.cpp b/libraries/entities-renderer/src/RenderableModelEntityItem.cpp index 3f46c5bf83..52fcda7f3e 100644 --- a/libraries/entities-renderer/src/RenderableModelEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableModelEntityItem.cpp @@ -704,10 +704,6 @@ void RenderableModelEntityItem::computeShapeInfo(ShapeInfo& info) { AABox box; for (int i = 0; i < _points.size(); i++) { for (int j = 0; j < _points[i].size(); j++) { - // compensate for registraion - _points[i][j] += _model->getOffset(); - // _points[i][j] += info.getOffset(); - // scale so the collision points match the model points _points[i][j] *= scale; box += _points[i][j]; } @@ -719,13 +715,9 @@ void RenderableModelEntityItem::computeShapeInfo(ShapeInfo& info) { QString::number(_registrationPoint.y) + "," + QString::number(_registrationPoint.z); - qDebug() << "NEW SHAPE FOR" << getName() << shapeKey; - qDebug() << " model-offset:" << _model->getOffset(); - info.setParams(type, collisionModelDimensions, shapeKey); info.setConvexHulls(_points); - adjustShapeInfoByRegistration(info); - qDebug() << " info-offset:" << info.getOffset(); + info.setOffset(_model->getOffset()); } } diff --git a/libraries/physics/src/ShapeFactory.cpp b/libraries/physics/src/ShapeFactory.cpp index b7eb417bca..0ed4b1d0a9 100644 --- a/libraries/physics/src/ShapeFactory.cpp +++ b/libraries/physics/src/ShapeFactory.cpp @@ -15,8 +15,6 @@ #include "ShapeFactory.h" #include "BulletUtil.h" -#include "StreamUtils.h" - btConvexHullShape* ShapeFactory::createConvexHull(const QVector& points) { assert(points.size() > 0); @@ -65,11 +63,6 @@ btConvexHullShape* ShapeFactory::createConvexHull(const QVector& poin hull->addPoint(btVector3(correctedPoint[0], correctedPoint[1], correctedPoint[2]), false); } hull->recalcLocalAabb(); - - qDebug() << "------- NEW COMPOUND SHAPE ------"; - qDebug() << " low = " << minCorner; - qDebug() << " high = " << maxCorner; - return hull; } @@ -97,13 +90,11 @@ btCollisionShape* ShapeFactory::createShapeFromInfo(const ShapeInfo& info) { const QVector>& points = info.getPoints(); uint32_t numSubShapes = info.getNumSubShapes(); if (numSubShapes == 1) { - // XXX offset? shape = createConvexHull(info.getPoints()[0]); } else { auto compound = new btCompoundShape(); btTransform trans; trans.setIdentity(); - // trans.setOrigin(-glmToBullet(info.getOffset())); foreach (QVector hullPoints, points) { btConvexHullShape* hull = createConvexHull(hullPoints); compound->addChildShape (trans, hull); @@ -113,7 +104,7 @@ btCollisionShape* ShapeFactory::createShapeFromInfo(const ShapeInfo& info) { } break; } - if (shape && type != SHAPE_TYPE_COMPOUND) { + if (shape) { if (glm::length2(info.getOffset()) > MIN_SHAPE_OFFSET * MIN_SHAPE_OFFSET) { // this shape has an offset, which we support by wrapping the true shape // in a btCompoundShape with a local transform @@ -126,10 +117,5 @@ btCollisionShape* ShapeFactory::createShapeFromInfo(const ShapeInfo& info) { } } - if (type == SHAPE_TYPE_COMPOUND) { - qDebug() << " offset = " << info.getOffset(); - } - - return shape; }