some more virtual entity work

This commit is contained in:
ZappoMan 2014-07-07 14:29:03 -07:00
parent 3145d150f3
commit a4b7673a2c
3 changed files with 10 additions and 4 deletions

View file

@ -90,12 +90,14 @@ Model* EntityTreeRenderer::getModel(const EntityItem& entityItem) {
} }
} }
// if we don't have a model... // if we don't have a model... but our item does have a model URL
if (!model) { if (!model && !entityItem.getModelURL().isEmpty()) {
// Make sure we only create new models on the thread that owns the EntityTreeRenderer // Make sure we only create new models on the thread that owns the EntityTreeRenderer
if (QThread::currentThread() != thread()) { if (QThread::currentThread() != thread()) {
qDebug() << "about to call QMetaObject::invokeMethod(this, 'getModel', Qt::BlockingQueuedConnection,...";
QMetaObject::invokeMethod(this, "getModel", Qt::BlockingQueuedConnection, QMetaObject::invokeMethod(this, "getModel", Qt::BlockingQueuedConnection,
Q_RETURN_ARG(Model*, model), Q_ARG(const EntityItem&, entityItem)); Q_RETURN_ARG(Model*, model), Q_ARG(const EntityItem&, entityItem));
qDebug() << "got it... model=" << model;
return model; return model;
} }

View file

@ -27,6 +27,7 @@
// Generic client side Octree renderer class. // Generic client side Octree renderer class.
class EntityTreeRenderer : public OctreeRenderer, public EntityItemFBXService { class EntityTreeRenderer : public OctreeRenderer, public EntityItemFBXService {
Q_OBJECT
public: public:
EntityTreeRenderer(); EntityTreeRenderer();
virtual ~EntityTreeRenderer(); virtual ~EntityTreeRenderer();
@ -54,9 +55,10 @@ public:
/// clears the tree /// clears the tree
virtual void clear(); virtual void clear();
Q_INVOKABLE Model* getModel(const EntityItem& modelItem);
protected: protected:
void clearModelsCache(); void clearModelsCache();
Model* getModel(const EntityItem& modelItem);
QMap<uint32_t, Model*> _knownEntityItemModels; QMap<uint32_t, Model*> _knownEntityItemModels;
QMap<uint32_t, Model*> _unknownEntityItemModels; QMap<uint32_t, Model*> _unknownEntityItemModels;
}; };

View file

@ -762,6 +762,7 @@ int EntityTree::processEditPacketData(PacketType packetType, const unsigned char
case PacketTypeEntityAddOrEdit: { case PacketTypeEntityAddOrEdit: {
// TODO: need to do this // TODO: need to do this
qDebug() << "EntityTree::processEditPacketData().... NOT YET IMPLEMENTED!!!";
#if 0 #if 0
bool isValid = false; bool isValid = false;
EntityItem* newEntity = NULL; // EntityItem::fromEditPacket(editData, maxLength, processedBytes, this, isValid); EntityItem* newEntity = NULL; // EntityItem::fromEditPacket(editData, maxLength, processedBytes, this, isValid);
@ -841,6 +842,7 @@ void EntityTree::update() {
for (int i = 0; i < movingEntitys; i++) { for (int i = 0; i < movingEntitys; i++) {
// XXXBHG: replace storeEntity with new API!! // XXXBHG: replace storeEntity with new API!!
qDebug() << "EntityTree::update().... NOT YET IMPLEMENTED!!!";
#if 0 ////////////////////////////////////////////////////// #if 0 //////////////////////////////////////////////////////
bool shouldDie = args._movingEntities[i]->getShouldBeDeleted(); bool shouldDie = args._movingEntities[i]->getShouldBeDeleted();