mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 05:09:23 +02:00
trying to figureo out where to download hull models
This commit is contained in:
parent
20a22ff42c
commit
3a3e723f4e
9 changed files with 80 additions and 16 deletions
|
@ -17,6 +17,7 @@
|
||||||
#include "EntityTree.h"
|
#include "EntityTree.h"
|
||||||
#include "EntityTreeElement.h"
|
#include "EntityTreeElement.h"
|
||||||
#include "ModelEntityItem.h"
|
#include "ModelEntityItem.h"
|
||||||
|
// #include "GeometryCache.h"
|
||||||
|
|
||||||
const QString ModelEntityItem::DEFAULT_MODEL_URL = QString("");
|
const QString ModelEntityItem::DEFAULT_MODEL_URL = QString("");
|
||||||
const QString ModelEntityItem::DEFAULT_COLLISION_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) :
|
ModelEntityItem::ModelEntityItem(const EntityItemID& entityItemID, const EntityItemProperties& properties) :
|
||||||
EntityItem(entityItemID, properties)
|
EntityItem(entityItemID, properties)
|
||||||
{
|
{
|
||||||
_type = EntityTypes::Model;
|
_type = EntityTypes::Model;
|
||||||
setProperties(properties);
|
setProperties(properties);
|
||||||
|
@ -413,5 +414,15 @@ QString ModelEntityItem::getAnimationSettings() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModelEntityItem::computeShapeInfo(ShapeInfo& info) 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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,9 @@
|
||||||
|
|
||||||
#include "EntityItem.h"
|
#include "EntityItem.h"
|
||||||
|
|
||||||
|
class NetworkGeometry;
|
||||||
|
class GeometryCache;
|
||||||
|
|
||||||
class ModelEntityItem : public EntityItem {
|
class ModelEntityItem : public EntityItem {
|
||||||
public:
|
public:
|
||||||
static EntityItem* factory(const EntityItemID& entityID, const EntityItemProperties& properties);
|
static EntityItem* factory(const EntityItemID& entityID, const EntityItemProperties& properties);
|
||||||
|
@ -153,6 +156,8 @@ protected:
|
||||||
static QMap<QString, AnimationPointer> _loadedAnimations;
|
static QMap<QString, AnimationPointer> _loadedAnimations;
|
||||||
static AnimationCache _animationCache;
|
static AnimationCache _animationCache;
|
||||||
|
|
||||||
|
QSharedPointer<NetworkGeometry> _collisionNetworkGeometry;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_ModelEntityItem_h
|
#endif // hifi_ModelEntityItem_h
|
||||||
|
|
|
@ -17,9 +17,9 @@ using namespace meshinfo;
|
||||||
//origin is the default reference point for generating the tetrahedron from each triangle of the mesh.
|
//origin is the default reference point for generating the tetrahedron from each triangle of the mesh.
|
||||||
|
|
||||||
MeshInfo::MeshInfo(vector<Vertex> *vertices, vector<int> *triangles) :\
|
MeshInfo::MeshInfo(vector<Vertex> *vertices, vector<int> *triangles) :\
|
||||||
_vertices(vertices),
|
_vertices(vertices),
|
||||||
_triangles(triangles),
|
_centerOfMass(Vertex(0.0, 0.0, 0.0)),
|
||||||
_centerOfMass(Vertex(0.0, 0.0, 0.0)){
|
_triangles(triangles) {
|
||||||
}
|
}
|
||||||
|
|
||||||
MeshInfo::~MeshInfo(){
|
MeshInfo::~MeshInfo(){
|
||||||
|
@ -145,4 +145,4 @@ vector<float> MeshInfo::computeMassProperties(){
|
||||||
volumeAndInertia[5] = -globalInertiaTensors[1][0]; //i21 or i12
|
volumeAndInertia[5] = -globalInertiaTensors[1][0]; //i21 or i12
|
||||||
volumeAndInertia[6] = -globalInertiaTensors[2][0]; //i13 or i31
|
volumeAndInertia[6] = -globalInertiaTensors[2][0]; //i13 or i31
|
||||||
return volumeAndInertia;
|
return volumeAndInertia;
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,8 +21,8 @@
|
||||||
#include <DependencyManager.h>
|
#include <DependencyManager.h>
|
||||||
#include <ResourceCache.h>
|
#include <ResourceCache.h>
|
||||||
|
|
||||||
#include <FBXReader.h>
|
#include "FBXReader.h"
|
||||||
#include <OBJReader.h>
|
#include "OBJReader.h"
|
||||||
|
|
||||||
#include <AnimationCache.h>
|
#include <AnimationCache.h>
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
#include <gpu/GPUConfig.h>
|
#include <gpu/GPUConfig.h>
|
||||||
|
|
||||||
#include <QEvent>
|
#include <QEvent>
|
||||||
#include <QGLWidget>
|
// #include <QGLWidget>
|
||||||
#include <QNetworkReply>
|
#include <QNetworkReply>
|
||||||
#include <QOpenGLFramebufferObject>
|
#include <QOpenGLFramebufferObject>
|
||||||
#include <QResizeEvent>
|
#include <QResizeEvent>
|
||||||
|
|
|
@ -14,7 +14,6 @@
|
||||||
#include "SharedUtil.h" // for MILLIMETERS_PER_METER
|
#include "SharedUtil.h" // for MILLIMETERS_PER_METER
|
||||||
|
|
||||||
#include "ShapeInfo.h"
|
#include "ShapeInfo.h"
|
||||||
#include "GeometryCache.h"
|
|
||||||
|
|
||||||
void ShapeInfo::clear() {
|
void ShapeInfo::clear() {
|
||||||
_type = SHAPE_TYPE_NONE;
|
_type = SHAPE_TYPE_NONE;
|
||||||
|
@ -42,12 +41,6 @@ void ShapeInfo::setParams(ShapeType type, const glm::vec3& halfExtents, QVector<
|
||||||
_url = QUrl(url);
|
_url = QUrl(url);
|
||||||
// start download of model which contains collision hulls
|
// start download of model which contains collision hulls
|
||||||
_type = SHAPE_TYPE_NONE; // until download is done
|
_type = SHAPE_TYPE_NONE; // until download is done
|
||||||
|
|
||||||
QSharedPointer<NetworkGeometry> networkGeometry =
|
|
||||||
DependencyManager::get<GeometryCache>()->getGeometry (_url, QUrl(), false);
|
|
||||||
|
|
||||||
connect(networkGeometry, loaded, this, collisionGeometryLoaded);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
_halfExtents = halfExtents;
|
_halfExtents = halfExtents;
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#ifndef hifi_ShapeInfo_h
|
#ifndef hifi_ShapeInfo_h
|
||||||
#define hifi_ShapeInfo_h
|
#define hifi_ShapeInfo_h
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
#include <QVector>
|
#include <QVector>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
|
|
54
tools/library-depends.gv
Normal file
54
tools/library-depends.gv
Normal 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
BIN
tools/library-depends.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 246 KiB |
Loading…
Reference in a new issue