Case 20132, Case 16928: First class Image Entities
Showing the changes to interface/src/Application.cpp (1 of 37 files). Show all
Unified · Split
| @@ -2315,6 +2315,10 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 2314 unmodified lines | ||
| 2315 | 2315 | DependencyManager::get<PickManager>()->setPrecisionPicking(rayPickID, value); |
| 2316 | 2316 | }); |
| 2317 | 2317 | |
| 2318 | + EntityTreeRenderer::setGetAvatarUpOperator([] { | |
| 2319 | + return DependencyManager::get<AvatarManager>()->getMyAvatar()->getWorldOrientation() * Vectors::UP; | |
| 2320 | + }); | |
| 2321 | + | |
| 2318 | 2322 | // Preload Tablet sounds |
| 2319 | 2323 | DependencyManager::get<TabletScriptingInterface>()->preloadSounds(); |
| 2320 | 2324 | DependencyManager::get<Keyboard>()->createKeyboard(); |
| @@ -7685,16 +7689,13 @@ void Application::addAssetToWorldSetMapping(QString filePath, QString mapping, Q · 5364 unmodified lines | ||
| 7685 | 7689 | |
| 7686 | 7690 | void Application::addAssetToWorldAddEntity(QString filePath, QString mapping) { |
| 7687 | 7691 | EntityItemProperties properties; |
| 7688 | − properties.setType(EntityTypes::Model); | |
| 7689 | 7692 | properties.setName(mapping.right(mapping.length() - 1)); |
| 7690 | 7693 | if (filePath.toLower().endsWith(PNG_EXTENSION) || filePath.toLower().endsWith(JPG_EXTENSION)) { |
| 7691 | − QJsonObject textures { | |
| 7692 | − {"tex.picture", QString("atp:" + mapping) } | |
| 7693 | − }; | |
| 7694 | − properties.setModelURL("https://hifi-content.s3.amazonaws.com/DomainContent/production/default-image-model.fbx"); | |
| 7695 | − properties.setTextures(QJsonDocument(textures).toJson(QJsonDocument::Compact)); | |
| 7696 | − properties.setShapeType(SHAPE_TYPE_BOX); | |
| 7694 | + properties.setType(EntityTypes::Image); | |
| 7695 | + properties.setImageURL(QString("atp:" + mapping)); | |
| 7696 | + properties.setKeepAspectRatio(false); | |
| 7697 | 7697 | } else { |
| 7698 | + properties.setType(EntityTypes::Model); | |
| 7698 | 7699 | properties.setModelURL("atp:" + mapping); |
| 7699 | 7700 | properties.setShapeType(SHAPE_TYPE_SIMPLE_COMPOUND); |
| 7700 | 7701 | } |