mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 05:04:44 +02:00
formatting, diff minimization
This commit is contained in:
parent
6b49b0ed7d
commit
250567e315
4 changed files with 5 additions and 18 deletions
|
@ -57,8 +57,7 @@ public:
|
|||
|
||||
void updateShapeType(ShapeType type);
|
||||
virtual ShapeType getShapeType() const {
|
||||
// return _shapeType;
|
||||
// XXX make hull an option in editentity.js
|
||||
// XXX make hull an option in edit.js ?
|
||||
if (_collisionModelURL != "") {
|
||||
return SHAPE_TYPE_CONVEX_HULL;
|
||||
} else {
|
||||
|
|
|
@ -159,7 +159,6 @@ bool parseOBJGroup(OBJTokenizer &tokenizer, const QVariantHash& mapping,
|
|||
if (tokenizer.nextToken() != OBJTokenizer::DATUM_TOKEN) {
|
||||
break;
|
||||
}
|
||||
// obj is right-handed, hifi is left-handed
|
||||
float z = std::stof(tokenizer.getDatum().data());
|
||||
|
||||
while (tokenizer.isNextTokenFloat()) {
|
||||
|
@ -208,7 +207,6 @@ bool parseOBJGroup(OBJTokenizer &tokenizer, const QVariantHash& mapping,
|
|||
assert(parts.count() <= 3);
|
||||
QByteArray vertIndexBA = parts[ 0 ];
|
||||
|
||||
// int vertexIndex = std::stoi(tokenizer.getDatum().data());
|
||||
bool ok;
|
||||
int vertexIndex = vertIndexBA.toInt(&ok);
|
||||
if (!ok) {
|
||||
|
@ -238,7 +236,6 @@ bool parseOBJGroup(OBJTokenizer &tokenizer, const QVariantHash& mapping,
|
|||
}
|
||||
|
||||
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[1]);
|
||||
meshPart.triangleIndices.append(indices[2]);
|
||||
|
@ -385,9 +382,9 @@ FBXGeometry readOBJ(QIODevice* device, const QVariantHash& mapping) {
|
|||
pointNormalsSums[p0Index] += n0;
|
||||
pointNormalsSums[p1Index] += n1;
|
||||
pointNormalsSums[p2Index] += n2;
|
||||
pointNormalsCounts[p0Index] ++;
|
||||
pointNormalsCounts[p1Index] ++;
|
||||
pointNormalsCounts[p2Index] ++;
|
||||
pointNormalsCounts[p0Index]++;
|
||||
pointNormalsCounts[p1Index]++;
|
||||
pointNormalsCounts[p2Index]++;
|
||||
}
|
||||
|
||||
int vertCount = mesh.vertices.count();
|
||||
|
|
|
@ -60,25 +60,20 @@ void PhysicsEngine::updateEntitiesInternal(const quint64& now) {
|
|||
}
|
||||
|
||||
void PhysicsEngine::addEntityInternal(EntityItem* entity) {
|
||||
// qDebug() << "\n\nPhysicsEngine::addEntityInternal for " << entity->getID().toString()
|
||||
// << "thread-id" << QThread::currentThreadId();
|
||||
assert(entity);
|
||||
void* physicsInfo = entity->getPhysicsInfo();
|
||||
if (!physicsInfo) {
|
||||
// qDebug() << " has no physicsInfo";
|
||||
|
||||
if (entity->isReadyToComputeShape()) {
|
||||
ShapeInfo shapeInfo;
|
||||
entity->computeShapeInfo(shapeInfo);
|
||||
btCollisionShape* shape = _shapeManager.getShape(shapeInfo);
|
||||
if (shape) {
|
||||
// qDebug() << " found a shape";
|
||||
EntityMotionState* motionState = new EntityMotionState(entity);
|
||||
entity->setPhysicsInfo(static_cast<void*>(motionState));
|
||||
_entityMotionStates.insert(motionState);
|
||||
addObject(shapeInfo, shape, motionState);
|
||||
} else if (entity->isMoving()) {
|
||||
// qDebug() << " is moving";
|
||||
EntityMotionState* motionState = new EntityMotionState(entity);
|
||||
entity->setPhysicsInfo(static_cast<void*>(motionState));
|
||||
_entityMotionStates.insert(motionState);
|
||||
|
@ -87,11 +82,7 @@ void PhysicsEngine::addEntityInternal(EntityItem* entity) {
|
|||
_nonPhysicalKinematicObjects.insert(motionState);
|
||||
// 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";
|
||||
} else {
|
||||
// qDebug() << " no shape and not moving";
|
||||
}
|
||||
} else {
|
||||
// qDebug() << " not ready to compute shape.";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
#include <gpu/GPUConfig.h>
|
||||
|
||||
#include <QEvent>
|
||||
// #include <QGLWidget>
|
||||
#include <QGLWidget>
|
||||
#include <QNetworkReply>
|
||||
#include <QOpenGLFramebufferObject>
|
||||
#include <QResizeEvent>
|
||||
|
|
Loading…
Reference in a new issue