diff --git a/libraries/entities/src/ModelEntityItem.cpp b/libraries/entities/src/ModelEntityItem.cpp index 6e5989a11b..bd6842b18a 100644 --- a/libraries/entities/src/ModelEntityItem.cpp +++ b/libraries/entities/src/ModelEntityItem.cpp @@ -17,6 +17,7 @@ #include "EntityTree.h" #include "EntityTreeElement.h" #include "ModelEntityItem.h" +// #include "GeometryCache.h" const QString ModelEntityItem::DEFAULT_MODEL_URL = QString(""); const QString ModelEntityItem::DEFAULT_COLLISION_MODEL_URL = QString(""); @@ -31,7 +32,7 @@ EntityItem* ModelEntityItem::factory(const EntityItemID& entityID, const EntityI } ModelEntityItem::ModelEntityItem(const EntityItemID& entityItemID, const EntityItemProperties& properties) : - EntityItem(entityItemID, properties) + EntityItem(entityItemID, properties) { _type = EntityTypes::Model; setProperties(properties); @@ -413,5 +414,15 @@ QString ModelEntityItem::getAnimationSettings() const { } void ModelEntityItem::computeShapeInfo(ShapeInfo& info) const { - info.setParams(getShapeType(), 0.5f * getDimensions(), NULL, _collisionModelURL); + + if (_collisionModelURL != "") { + // QSharedPointer networkGeometry = + // DependencyManager::get()->getGeometry (_collisionModelURL, QUrl(), false); + + // FBXGeometry& _collisionModel; + // _collisionModel = &networkGeometry->getFBXGeometry(); + // connect(networkGeometry, loaded, this, collisionGeometryLoaded); + + // info.setParams(getShapeType(), 0.5f * getDimensions(), NULL, _collisionModelURL); + } } diff --git a/libraries/entities/src/ModelEntityItem.h b/libraries/entities/src/ModelEntityItem.h index 0187f8e8e6..516ecbf1c8 100644 --- a/libraries/entities/src/ModelEntityItem.h +++ b/libraries/entities/src/ModelEntityItem.h @@ -16,6 +16,9 @@ #include "EntityItem.h" +class NetworkGeometry; +class GeometryCache; + class ModelEntityItem : public EntityItem { public: static EntityItem* factory(const EntityItemID& entityID, const EntityItemProperties& properties); @@ -153,6 +156,8 @@ protected: static QMap _loadedAnimations; static AnimationCache _animationCache; + QSharedPointer _collisionNetworkGeometry; + }; #endif // hifi_ModelEntityItem_h diff --git a/libraries/physics/src/MeshInfo.cpp b/libraries/physics/src/MeshInfo.cpp index 8df5ff914d..d9ead677b0 100644 --- a/libraries/physics/src/MeshInfo.cpp +++ b/libraries/physics/src/MeshInfo.cpp @@ -17,9 +17,9 @@ using namespace meshinfo; //origin is the default reference point for generating the tetrahedron from each triangle of the mesh. MeshInfo::MeshInfo(vector *vertices, vector *triangles) :\ -_vertices(vertices), -_triangles(triangles), -_centerOfMass(Vertex(0.0, 0.0, 0.0)){ + _vertices(vertices), + _centerOfMass(Vertex(0.0, 0.0, 0.0)), + _triangles(triangles) { } MeshInfo::~MeshInfo(){ @@ -145,4 +145,4 @@ vector MeshInfo::computeMassProperties(){ volumeAndInertia[5] = -globalInertiaTensors[1][0]; //i21 or i12 volumeAndInertia[6] = -globalInertiaTensors[2][0]; //i13 or i31 return volumeAndInertia; -} \ No newline at end of file +} diff --git a/libraries/render-utils/src/GeometryCache.h b/libraries/render-utils/src/GeometryCache.h index ba7c16bc10..37156a6c71 100644 --- a/libraries/render-utils/src/GeometryCache.h +++ b/libraries/render-utils/src/GeometryCache.h @@ -21,8 +21,8 @@ #include #include -#include -#include +#include "FBXReader.h" +#include "OBJReader.h" #include diff --git a/libraries/render-utils/src/TextureCache.cpp b/libraries/render-utils/src/TextureCache.cpp index 022e722c14..0cbb8796ad 100644 --- a/libraries/render-utils/src/TextureCache.cpp +++ b/libraries/render-utils/src/TextureCache.cpp @@ -13,7 +13,7 @@ #include #include -#include +// #include #include #include #include diff --git a/libraries/shared/src/ShapeInfo.cpp b/libraries/shared/src/ShapeInfo.cpp index aaad4679a5..5a062e5eec 100644 --- a/libraries/shared/src/ShapeInfo.cpp +++ b/libraries/shared/src/ShapeInfo.cpp @@ -14,7 +14,6 @@ #include "SharedUtil.h" // for MILLIMETERS_PER_METER #include "ShapeInfo.h" -#include "GeometryCache.h" void ShapeInfo::clear() { _type = SHAPE_TYPE_NONE; @@ -42,12 +41,6 @@ void ShapeInfo::setParams(ShapeType type, const glm::vec3& halfExtents, QVector< _url = QUrl(url); // start download of model which contains collision hulls _type = SHAPE_TYPE_NONE; // until download is done - - QSharedPointer networkGeometry = - DependencyManager::get()->getGeometry (_url, QUrl(), false); - - connect(networkGeometry, loaded, this, collisionGeometryLoaded); - break; default: _halfExtents = halfExtents; diff --git a/libraries/shared/src/ShapeInfo.h b/libraries/shared/src/ShapeInfo.h index cba71aef4d..851d8cdc14 100644 --- a/libraries/shared/src/ShapeInfo.h +++ b/libraries/shared/src/ShapeInfo.h @@ -12,6 +12,7 @@ #ifndef hifi_ShapeInfo_h #define hifi_ShapeInfo_h +#include #include #include #include diff --git a/tools/library-depends.gv b/tools/library-depends.gv new file mode 100644 index 0000000000..6aa6f6f940 --- /dev/null +++ b/tools/library-depends.gv @@ -0,0 +1,54 @@ +digraph hifilibdepends { +animation -> shared +animation -> gpu +animation -> model +animation -> fbx +audio_client -> audio +audio -> networking +audio -> shared +avatars -> audio +avatars -> shared +avatars -> networking +entities -> avatars +entities -> shared +entities -> octree +entities -> gpu +entities -> model +entities -> fbx +entities -> networking +entities -> animation +entities_renderer -> shared +entities_renderer -> gpu +entities_renderer -> script_engine +entities_renderer -> render_utils +environment -> shared +environment -> networking +fbx -> shared +fbx -> gpu +fbx -> model +fbx -> networking +fbx -> octree +gpu -> shared +model -> shared +model -> gpu +networking -> shared +octree -> shared +octree -> networking +physics -> shared +physics -> fbx +physics -> entities +render_utils -> animation +render_utils -> fbx +render_utils -> shared +render_utils -> gpu +render_utils -> physics +script_engine -> shared +script_engine -> octree +script_engine -> gpu +script_engine -> model +script_engine -> fbx +script_engine -> entities +script_engine -> animation +script_engine -> audio +script_engine -> physics +} diff --git a/tools/library-depends.png b/tools/library-depends.png new file mode 100644 index 0000000000..5e429fd47f Binary files /dev/null and b/tools/library-depends.png differ