Add Entities.addModelEntity

This commit is contained in:
Ryan Huffman 2016-03-10 10:25:20 -08:00
parent 55248bc076
commit b42bec78dc
2 changed files with 10 additions and 0 deletions

View file

@ -178,6 +178,14 @@ QUuid EntityScriptingInterface::addEntity(const EntityItemProperties& properties
return id;
}
QUuid EntityScriptingInterface::addModelEntity(const QString& modelUrl, const glm::vec3& position) {
EntityItemProperties properties;
properties.setType(EntityTypes::Model);
properties.setModelURL(modelUrl);
properties.setPosition(position);
return addEntity(properties);
}
EntityItemProperties EntityScriptingInterface::getEntityProperties(QUuid identity) {
EntityPropertyFlags noSpecificProperties;
return getEntityProperties(identity, noSpecificProperties);

View file

@ -84,6 +84,8 @@ public slots:
/// adds a model with the specific properties
Q_INVOKABLE QUuid addEntity(const EntityItemProperties& properties);
Q_INVOKABLE QUuid addModelEntity(const QString& modelUrl, const glm::vec3& position);
/// gets the current model properties for a specific model
/// this function will not find return results in script engine contexts which don't have access to models
Q_INVOKABLE EntityItemProperties getEntityProperties(QUuid entityID);