Showing the changes to libraries/entities/src/EntityScriptingInterface.cpp (1 of 2 files). Show all
Unified · Split
| @@ -11,6 +11,7 @@ · 10 unmodified lines | ||
| 11 | 11 | |
| 12 | 12 | #include "EntityScriptingInterface.h" |
| 13 | 13 | #include "EntityTree.h" |
| 14 | +#include "ModelEntityItem.h" | |
| 14 | 15 | |
| 15 | 16 | EntityScriptingInterface::EntityScriptingInterface() : |
| 16 | 17 | _nextCreatorTokenID(0), |
| @@ -75,10 +76,18 @@ EntityItemProperties EntityScriptingInterface::getEntityProperties(EntityItemID · 58 unmodified lines | ||
| 75 | 76 | if (_entityTree) { |
| 76 | 77 | _entityTree->lockForRead(); |
| 77 | 78 | EntityItem* entity = const_cast<EntityItem*>(_entityTree->findEntityByEntityItemID(identity)); |
| 79 | + | |
| 78 | 80 | if (entity) { |
| 79 | 81 | |
| 80 | − // TODO: look into sitting points!!! | |
| 81 | − //entity->setSittingPoints(_entityTree->getGeometryForEntity(entity)->sittingPoints); | |
| 82 | + // TODO: improve sitting points in the future, for now we've included the old model behavior for entity | |
| 83 | + // types that are models | |
| 84 | + if (entity->getType() == EntityTypes::Model) { | |
| 85 | + ModelEntityItem* model = dynamic_cast<ModelEntityItem*>(entity); | |
| 86 | + const FBXGeometry* geometry = _entityTree->getGeometryForEntity(entity); | |
| 87 | + if (geometry) { | |
| 88 | + model->setSittingPoints(geometry->sittingPoints); | |
| 89 | + } | |
| 90 | + } | |
| 82 | 91 | |
| 83 | 92 | results = entity->getProperties(); |
| 84 | 93 | } else { |