formatting, diff minimization

This commit is contained in:
Seth Alves 2015-03-14 12:09:23 -07:00
parent 6b49b0ed7d
commit 250567e315
4 changed files with 5 additions and 18 deletions

View file

@ -57,8 +57,7 @@ public:
void updateShapeType(ShapeType type); void updateShapeType(ShapeType type);
virtual ShapeType getShapeType() const { virtual ShapeType getShapeType() const {
// return _shapeType; // XXX make hull an option in edit.js ?
// XXX make hull an option in editentity.js
if (_collisionModelURL != "") { if (_collisionModelURL != "") {
return SHAPE_TYPE_CONVEX_HULL; return SHAPE_TYPE_CONVEX_HULL;
} else { } else {

View file

@ -159,7 +159,6 @@ bool parseOBJGroup(OBJTokenizer &tokenizer, const QVariantHash& mapping,
if (tokenizer.nextToken() != OBJTokenizer::DATUM_TOKEN) { if (tokenizer.nextToken() != OBJTokenizer::DATUM_TOKEN) {
break; break;
} }
// obj is right-handed, hifi is left-handed
float z = std::stof(tokenizer.getDatum().data()); float z = std::stof(tokenizer.getDatum().data());
while (tokenizer.isNextTokenFloat()) { while (tokenizer.isNextTokenFloat()) {
@ -208,7 +207,6 @@ bool parseOBJGroup(OBJTokenizer &tokenizer, const QVariantHash& mapping,
assert(parts.count() <= 3); assert(parts.count() <= 3);
QByteArray vertIndexBA = parts[ 0 ]; QByteArray vertIndexBA = parts[ 0 ];
// int vertexIndex = std::stoi(tokenizer.getDatum().data());
bool ok; bool ok;
int vertexIndex = vertIndexBA.toInt(&ok); int vertexIndex = vertIndexBA.toInt(&ok);
if (!ok) { if (!ok) {
@ -238,7 +236,6 @@ bool parseOBJGroup(OBJTokenizer &tokenizer, const QVariantHash& mapping,
} }
if (indices.count() == 3) { if (indices.count() == 3) {
// flip these around (because of the -z above) so our triangles face outward
meshPart.triangleIndices.append(indices[0]); meshPart.triangleIndices.append(indices[0]);
meshPart.triangleIndices.append(indices[1]); meshPart.triangleIndices.append(indices[1]);
meshPart.triangleIndices.append(indices[2]); meshPart.triangleIndices.append(indices[2]);
@ -385,9 +382,9 @@ FBXGeometry readOBJ(QIODevice* device, const QVariantHash& mapping) {
pointNormalsSums[p0Index] += n0; pointNormalsSums[p0Index] += n0;
pointNormalsSums[p1Index] += n1; pointNormalsSums[p1Index] += n1;
pointNormalsSums[p2Index] += n2; pointNormalsSums[p2Index] += n2;
pointNormalsCounts[p0Index] ++; pointNormalsCounts[p0Index]++;
pointNormalsCounts[p1Index] ++; pointNormalsCounts[p1Index]++;
pointNormalsCounts[p2Index] ++; pointNormalsCounts[p2Index]++;
} }
int vertCount = mesh.vertices.count(); int vertCount = mesh.vertices.count();

View file

@ -60,25 +60,20 @@ void PhysicsEngine::updateEntitiesInternal(const quint64& now) {
} }
void PhysicsEngine::addEntityInternal(EntityItem* entity) { void PhysicsEngine::addEntityInternal(EntityItem* entity) {
// qDebug() << "\n\nPhysicsEngine::addEntityInternal for " << entity->getID().toString()
// << "thread-id" << QThread::currentThreadId();
assert(entity); assert(entity);
void* physicsInfo = entity->getPhysicsInfo(); void* physicsInfo = entity->getPhysicsInfo();
if (!physicsInfo) { if (!physicsInfo) {
// qDebug() << " has no physicsInfo";
if (entity->isReadyToComputeShape()) { if (entity->isReadyToComputeShape()) {
ShapeInfo shapeInfo; ShapeInfo shapeInfo;
entity->computeShapeInfo(shapeInfo); entity->computeShapeInfo(shapeInfo);
btCollisionShape* shape = _shapeManager.getShape(shapeInfo); btCollisionShape* shape = _shapeManager.getShape(shapeInfo);
if (shape) { if (shape) {
// qDebug() << " found a shape";
EntityMotionState* motionState = new EntityMotionState(entity); EntityMotionState* motionState = new EntityMotionState(entity);
entity->setPhysicsInfo(static_cast<void*>(motionState)); entity->setPhysicsInfo(static_cast<void*>(motionState));
_entityMotionStates.insert(motionState); _entityMotionStates.insert(motionState);
addObject(shapeInfo, shape, motionState); addObject(shapeInfo, shape, motionState);
} else if (entity->isMoving()) { } else if (entity->isMoving()) {
// qDebug() << " is moving";
EntityMotionState* motionState = new EntityMotionState(entity); EntityMotionState* motionState = new EntityMotionState(entity);
entity->setPhysicsInfo(static_cast<void*>(motionState)); entity->setPhysicsInfo(static_cast<void*>(motionState));
_entityMotionStates.insert(motionState); _entityMotionStates.insert(motionState);
@ -87,11 +82,7 @@ void PhysicsEngine::addEntityInternal(EntityItem* entity) {
_nonPhysicalKinematicObjects.insert(motionState); _nonPhysicalKinematicObjects.insert(motionState);
// We failed to add the entity to the simulation. Probably because we couldn't create a shape for it. // We failed to add the entity to the simulation. Probably because we couldn't create a shape for it.
//qDebug() << "failed to add entity " << entity->getEntityItemID() << " to physics engine"; //qDebug() << "failed to add entity " << entity->getEntityItemID() << " to physics engine";
} else {
// qDebug() << " no shape and not moving";
} }
} else {
// qDebug() << " not ready to compute shape.";
} }
} }
} }

View file

@ -13,7 +13,7 @@
#include <gpu/GPUConfig.h> #include <gpu/GPUConfig.h>
#include <QEvent> #include <QEvent>
// #include <QGLWidget> #include <QGLWidget>
#include <QNetworkReply> #include <QNetworkReply>
#include <QOpenGLFramebufferObject> #include <QOpenGLFramebufferObject>
#include <QResizeEvent> #include <QResizeEvent>