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
11 11
12#include "EntityScriptingInterface.h"12#include "EntityScriptingInterface.h"
13#include "EntityTree.h"13#include "EntityTree.h"
14#include "ModelEntityItem.h"
14 15
15EntityScriptingInterface::EntityScriptingInterface() :16EntityScriptingInterface::EntityScriptingInterface() :
16 _nextCreatorTokenID(0),17 _nextCreatorTokenID(0),
@@ -75,10 +76,18 @@ EntityItemProperties EntityScriptingInterface::getEntityProperties(EntityItemID · 58 unmodified lines
75 if (_entityTree) {76 if (_entityTree) {
76 _entityTree->lockForRead();77 _entityTree->lockForRead();
77 EntityItem* entity = const_cast<EntityItem*>(_entityTree->findEntityByEntityItemID(identity));78 EntityItem* entity = const_cast<EntityItem*>(_entityTree->findEntityByEntityItemID(identity));
79
78 if (entity) {80 if (entity) {
79 81
80 // TODO: look into sitting points!!!82 // TODO: improve sitting points in the future, for now we've included the old model behavior for entity
81 //entity->setSittingPoints(_entityTree->getGeometryForEntity(entity)->sittingPoints);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 results = entity->getProperties();92 results = entity->getProperties();
84 } else {93 } else {