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

View file

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

View file

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