History

get sit points working

ZappoMan committed 12 years ago

Commit 314e2991 parent 1663ff82 files · +14 −5Browse files

Showing the changes to libraries/entities/src/EntityScriptingInterface.cpp (1 of 2 files). Show all

Unified · Split

libraries/entities/src/EntityScriptingInterface.cpp+11−2
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111
1212 #include "EntityScriptingInterface.h"
1313 #include "EntityTree.h"
14+#include "ModelEntityItem.h"
1415
1516 EntityScriptingInterface::EntityScriptingInterface() :
1617 _nextCreatorTokenID(0),
@@ -75,10 +76,18 @@ EntityItemProperties EntityScriptingInterface::getEntityProperties(EntityItemID · 58 unmodified lines
7576 if (_entityTree) {
7677 _entityTree->lockForRead();
7778 EntityItem* entity = const_cast<EntityItem*>(_entityTree->findEntityByEntityItemID(identity));
79+
7880 if (entity) {
7981
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+ }
8291
8392 results = entity->getProperties();
8493 } else {