trying to figureo out where to download hull models

This commit is contained in:
Seth Alves 2015-03-11 14:26:30 -07:00
parent 20a22ff42c
commit 3a3e723f4e
9 changed files with 80 additions and 16 deletions

View file

@ -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> networkGeometry =
// DependencyManager::get<GeometryCache>()->getGeometry (_collisionModelURL, QUrl(), false);
// FBXGeometry& _collisionModel;
// _collisionModel = &networkGeometry->getFBXGeometry();
// connect(networkGeometry, loaded, this, collisionGeometryLoaded);
// info.setParams(getShapeType(), 0.5f * getDimensions(), NULL, _collisionModelURL);
}
}

View file

@ -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<QString, AnimationPointer> _loadedAnimations;
static AnimationCache _animationCache;
QSharedPointer<NetworkGeometry> _collisionNetworkGeometry;
};
#endif // hifi_ModelEntityItem_h

View file

@ -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<Vertex> *vertices, vector<int> *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<float> MeshInfo::computeMassProperties(){
volumeAndInertia[5] = -globalInertiaTensors[1][0]; //i21 or i12
volumeAndInertia[6] = -globalInertiaTensors[2][0]; //i13 or i31
return volumeAndInertia;
}
}

View file

@ -21,8 +21,8 @@
#include <DependencyManager.h>
#include <ResourceCache.h>
#include <FBXReader.h>
#include <OBJReader.h>
#include "FBXReader.h"
#include "OBJReader.h"
#include <AnimationCache.h>

View file

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

View file

@ -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> networkGeometry =
DependencyManager::get<GeometryCache>()->getGeometry (_url, QUrl(), false);
connect(networkGeometry, loaded, this, collisionGeometryLoaded);
break;
default:
_halfExtents = halfExtents;

View file

@ -12,6 +12,7 @@
#ifndef hifi_ShapeInfo_h
#define hifi_ShapeInfo_h
#include <QObject>
#include <QVector>
#include <QString>
#include <QUrl>

54
tools/library-depends.gv Normal file
View file

@ -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
}

BIN
tools/library-depends.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 KiB