mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 03:48:44 +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() {
|
bool ModelEntityItem::isReadyToComputeShape() {
|
||||||
// qDebug() << " ModelEntityItem::getReadyToComputeShape for " << getID().toString() << _collisionModelURL;
|
|
||||||
if (_collisionModelURL == "") {
|
if (_collisionModelURL == "") {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// qDebug() << " url is" << _collisionModelURL;
|
|
||||||
if (! _collisionNetworkGeometry.isNull() && _collisionNetworkGeometry->isLoadedWithTextures()) {
|
if (! _collisionNetworkGeometry.isNull() && _collisionNetworkGeometry->isLoadedWithTextures()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_collisionNetworkGeometry.isNull()) {
|
if (_collisionNetworkGeometry.isNull()) {
|
||||||
// qDebug() << " _collisionNetworkGeometry is Null";
|
|
||||||
_collisionNetworkGeometry =
|
_collisionNetworkGeometry =
|
||||||
DependencyManager::get<GeometryCache>()->getGeometry(_collisionModelURL, QUrl(), false);
|
DependencyManager::get<GeometryCache>()->getGeometry(_collisionModelURL, QUrl(), false);
|
||||||
|
|
||||||
|
@ -442,14 +439,7 @@ bool ModelEntityItem::isReadyToComputeShape() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// void ModelEntityItem::collisionGeometryLoaded() {
|
|
||||||
// qDebug() << "ModelEntityItem::collisionGeometryLoaded for " << getID().toString();
|
|
||||||
// emit entityShapeReady(getID());
|
|
||||||
// }
|
|
||||||
|
|
||||||
void ModelEntityItem::computeShapeInfo(ShapeInfo& info) {
|
void ModelEntityItem::computeShapeInfo(ShapeInfo& info) {
|
||||||
// qDebug() << "ModelEntityItem::computeShapeInfo for " << getID().toString();
|
|
||||||
|
|
||||||
if (_collisionModelURL == "") {
|
if (_collisionModelURL == "") {
|
||||||
info.setParams(getShapeType(), 0.5f * getDimensions());
|
info.setParams(getShapeType(), 0.5f * getDimensions());
|
||||||
} else {
|
} else {
|
||||||
|
@ -461,7 +451,6 @@ void ModelEntityItem::computeShapeInfo(ShapeInfo& info) {
|
||||||
}
|
}
|
||||||
|
|
||||||
info.setParams(getShapeType(), 0.5f * getDimensions(), NULL, _collisionModelURL);
|
info.setParams(getShapeType(), 0.5f * getDimensions(), NULL, _collisionModelURL);
|
||||||
// info.setConvexHull(QVector<glm::vec3>(_points));
|
|
||||||
info.setConvexHull(_points);
|
info.setConvexHull(_points);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -136,9 +136,6 @@ public:
|
||||||
static void cleanupLoadedAnimations();
|
static void cleanupLoadedAnimations();
|
||||||
|
|
||||||
bool isReadyToComputeShape();
|
bool isReadyToComputeShape();
|
||||||
|
|
||||||
// public slots:
|
|
||||||
// void collisionGeometryLoaded();
|
|
||||||
|
|
||||||
protected:
|
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) {
|
void PhysicsEngine::removeEntityInternal(EntityItem* entity) {
|
||||||
assert(entity);
|
assert(entity);
|
||||||
void* physicsInfo = entity->getPhysicsInfo();
|
void* physicsInfo = entity->getPhysicsInfo();
|
||||||
|
|
|
@ -93,20 +93,20 @@ btCollisionShape* ShapeInfoUtil::createShapeFromInfo(const ShapeInfo& info) {
|
||||||
switch(info.getType()) {
|
switch(info.getType()) {
|
||||||
case SHAPE_TYPE_BOX: {
|
case SHAPE_TYPE_BOX: {
|
||||||
shape = new btBoxShape(glmToBullet(info.getHalfExtents()));
|
shape = new btBoxShape(glmToBullet(info.getHalfExtents()));
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
case SHAPE_TYPE_SPHERE: {
|
case SHAPE_TYPE_SPHERE: {
|
||||||
float radius = info.getHalfExtents().x;
|
float radius = info.getHalfExtents().x;
|
||||||
shape = new btSphereShape(radius);
|
shape = new btSphereShape(radius);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
case SHAPE_TYPE_CAPSULE_Y: {
|
case SHAPE_TYPE_CAPSULE_Y: {
|
||||||
glm::vec3 halfExtents = info.getHalfExtents();
|
glm::vec3 halfExtents = info.getHalfExtents();
|
||||||
float radius = halfExtents.x;
|
float radius = halfExtents.x;
|
||||||
float height = 2.0f * halfExtents.y;
|
float height = 2.0f * halfExtents.y;
|
||||||
shape = new btCapsuleShape(radius, height);
|
shape = new btCapsuleShape(radius, height);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
case SHAPE_TYPE_CONVEX_HULL: {
|
case SHAPE_TYPE_CONVEX_HULL: {
|
||||||
shape = new btConvexHullShape();
|
shape = new btConvexHullShape();
|
||||||
const QVector<glm::vec3>& points = info.getPoints();
|
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]);
|
btVector3 btPoint(point[0], point[1], point[2]);
|
||||||
static_cast<btConvexHullShape*>(shape)->addPoint(btPoint);
|
static_cast<btConvexHullShape*>(shape)->addPoint(btPoint);
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return shape;
|
return shape;
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,13 +50,6 @@ void ShapeInfo::setParams(ShapeType type, const glm::vec3& halfExtents, QVector<
|
||||||
_externalData = data;
|
_externalData = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ShapeInfo::collisionGeometryLoaded() {
|
|
||||||
_type = SHAPE_TYPE_CONVEX_HULL;
|
|
||||||
// xxx copy points over;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void ShapeInfo::setBox(const glm::vec3& halfExtents) {
|
void ShapeInfo::setBox(const glm::vec3& halfExtents) {
|
||||||
_type = SHAPE_TYPE_BOX;
|
_type = SHAPE_TYPE_BOX;
|
||||||
_halfExtents = halfExtents;
|
_halfExtents = halfExtents;
|
||||||
|
|
|
@ -65,11 +65,6 @@ public:
|
||||||
|
|
||||||
const DoubleHashKey& getHash() const;
|
const DoubleHashKey& getHash() const;
|
||||||
|
|
||||||
|
|
||||||
private slots:
|
|
||||||
void collisionGeometryLoaded();
|
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
ShapeType _type = SHAPE_TYPE_NONE;
|
ShapeType _type = SHAPE_TYPE_NONE;
|
||||||
glm::vec3 _halfExtents = glm::vec3(0.0f);
|
glm::vec3 _halfExtents = glm::vec3(0.0f);
|
||||||
|
|
Loading…
Reference in a new issue