mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 21:03:09 +02:00
formatting
This commit is contained in:
parent
f7f75cabf4
commit
b815c365eb
6 changed files with 4 additions and 37 deletions
|
@ -418,18 +418,15 @@ QString ModelEntityItem::getAnimationSettings() const {
|
|||
|
||||
|
||||
bool ModelEntityItem::isReadyToComputeShape() {
|
||||
// qDebug() << " ModelEntityItem::getReadyToComputeShape for " << getID().toString() << _collisionModelURL;
|
||||
if (_collisionModelURL == "") {
|
||||
return true;
|
||||
}
|
||||
|
||||
// qDebug() << " url is" << _collisionModelURL;
|
||||
if (! _collisionNetworkGeometry.isNull() && _collisionNetworkGeometry->isLoadedWithTextures()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (_collisionNetworkGeometry.isNull()) {
|
||||
// qDebug() << " _collisionNetworkGeometry is Null";
|
||||
_collisionNetworkGeometry =
|
||||
DependencyManager::get<GeometryCache>()->getGeometry(_collisionModelURL, QUrl(), false);
|
||||
|
||||
|
@ -442,14 +439,7 @@ bool ModelEntityItem::isReadyToComputeShape() {
|
|||
return false;
|
||||
}
|
||||
|
||||
// void ModelEntityItem::collisionGeometryLoaded() {
|
||||
// qDebug() << "ModelEntityItem::collisionGeometryLoaded for " << getID().toString();
|
||||
// emit entityShapeReady(getID());
|
||||
// }
|
||||
|
||||
void ModelEntityItem::computeShapeInfo(ShapeInfo& info) {
|
||||
// qDebug() << "ModelEntityItem::computeShapeInfo for " << getID().toString();
|
||||
|
||||
if (_collisionModelURL == "") {
|
||||
info.setParams(getShapeType(), 0.5f * getDimensions());
|
||||
} else {
|
||||
|
@ -461,7 +451,6 @@ void ModelEntityItem::computeShapeInfo(ShapeInfo& info) {
|
|||
}
|
||||
|
||||
info.setParams(getShapeType(), 0.5f * getDimensions(), NULL, _collisionModelURL);
|
||||
// info.setConvexHull(QVector<glm::vec3>(_points));
|
||||
info.setConvexHull(_points);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -136,9 +136,6 @@ public:
|
|||
static void cleanupLoadedAnimations();
|
||||
|
||||
bool isReadyToComputeShape();
|
||||
|
||||
// public slots:
|
||||
// void collisionGeometryLoaded();
|
||||
|
||||
protected:
|
||||
|
||||
|
|
|
@ -96,13 +96,6 @@ void PhysicsEngine::addEntityInternal(EntityItem* entity) {
|
|||
}
|
||||
}
|
||||
|
||||
// void PhysicsEngine::entityShapeReady(QUuid entityId) {
|
||||
// qDebug() << "PhysicsEngine::entityShapeReady for" << entityId.toString() << "thread-id" << QThread::currentThreadId();
|
||||
// lockBusyForWrite();
|
||||
// _busyComputingShape[entityId] = false;
|
||||
// unlockBusy();
|
||||
// }
|
||||
|
||||
void PhysicsEngine::removeEntityInternal(EntityItem* entity) {
|
||||
assert(entity);
|
||||
void* physicsInfo = entity->getPhysicsInfo();
|
||||
|
|
|
@ -93,20 +93,20 @@ btCollisionShape* ShapeInfoUtil::createShapeFromInfo(const ShapeInfo& info) {
|
|||
switch(info.getType()) {
|
||||
case SHAPE_TYPE_BOX: {
|
||||
shape = new btBoxShape(glmToBullet(info.getHalfExtents()));
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case SHAPE_TYPE_SPHERE: {
|
||||
float radius = info.getHalfExtents().x;
|
||||
shape = new btSphereShape(radius);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case SHAPE_TYPE_CAPSULE_Y: {
|
||||
glm::vec3 halfExtents = info.getHalfExtents();
|
||||
float radius = halfExtents.x;
|
||||
float height = 2.0f * halfExtents.y;
|
||||
shape = new btCapsuleShape(radius, height);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case SHAPE_TYPE_CONVEX_HULL: {
|
||||
shape = new btConvexHullShape();
|
||||
const QVector<glm::vec3>& points = info.getPoints();
|
||||
|
@ -114,8 +114,8 @@ btCollisionShape* ShapeInfoUtil::createShapeFromInfo(const ShapeInfo& info) {
|
|||
btVector3 btPoint(point[0], point[1], point[2]);
|
||||
static_cast<btConvexHullShape*>(shape)->addPoint(btPoint);
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return shape;
|
||||
}
|
||||
|
|
|
@ -50,13 +50,6 @@ void ShapeInfo::setParams(ShapeType type, const glm::vec3& halfExtents, QVector<
|
|||
_externalData = data;
|
||||
}
|
||||
|
||||
|
||||
void ShapeInfo::collisionGeometryLoaded() {
|
||||
_type = SHAPE_TYPE_CONVEX_HULL;
|
||||
// xxx copy points over;
|
||||
}
|
||||
|
||||
|
||||
void ShapeInfo::setBox(const glm::vec3& halfExtents) {
|
||||
_type = SHAPE_TYPE_BOX;
|
||||
_halfExtents = halfExtents;
|
||||
|
|
|
@ -65,11 +65,6 @@ public:
|
|||
|
||||
const DoubleHashKey& getHash() const;
|
||||
|
||||
|
||||
private slots:
|
||||
void collisionGeometryLoaded();
|
||||
|
||||
|
||||
protected:
|
||||
ShapeType _type = SHAPE_TYPE_NONE;
|
||||
glm::vec3 _halfExtents = glm::vec3(0.0f);
|
||||
|
|
Loading…
Reference in a new issue