mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 16:55:07 +02:00
commit
25481e0a25
46 changed files with 371 additions and 450 deletions
|
@ -296,37 +296,12 @@ var toolBar = (function () {
|
|||
function addModel(url) {
|
||||
var entityID = createNewEntity({
|
||||
type: "Model",
|
||||
dimensions: DEFAULT_DIMENSIONS,
|
||||
modelURL: url
|
||||
}, false);
|
||||
|
||||
if (entityID) {
|
||||
print("Model added: " + url);
|
||||
|
||||
var checkCount = 0;
|
||||
function resize() {
|
||||
var entityProperties = Entities.getEntityProperties(entityID);
|
||||
var naturalDimensions = entityProperties.naturalDimensions;
|
||||
|
||||
checkCount++;
|
||||
|
||||
if (naturalDimensions.x == 0 && naturalDimensions.y == 0 && naturalDimensions.z == 0) {
|
||||
if (checkCount < RESIZE_MAX_CHECKS) {
|
||||
Script.setTimeout(resize, RESIZE_INTERVAL);
|
||||
} else {
|
||||
print("Resize failed: timed out waiting for model (" + url + ") to load");
|
||||
}
|
||||
} else {
|
||||
Entities.editEntity(entityID, { dimensions: naturalDimensions });
|
||||
|
||||
// Reset selection so that the selection overlays will be updated
|
||||
selectionManager.setSelections([entityID]);
|
||||
}
|
||||
}
|
||||
|
||||
selectionManager.setSelections([entityID]);
|
||||
|
||||
Script.setTimeout(resize, RESIZE_INTERVAL);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2325,9 +2325,14 @@ SelectionDisplay = (function () {
|
|||
});
|
||||
|
||||
that.checkMove = function() {
|
||||
if (SelectionManager.hasSelection() &&
|
||||
(!Vec3.equal(Camera.getPosition(), lastCameraPosition) || !Quat.equal(Camera.getOrientation(), lastCameraOrientation))){
|
||||
that.updateRotationHandles();
|
||||
if (SelectionManager.hasSelection()) {
|
||||
SelectionManager._update();
|
||||
|
||||
if (!Vec3.equal(Camera.getPosition(), lastCameraPosition) ||
|
||||
!Quat.equal(Camera.getOrientation(), lastCameraOrientation)) {
|
||||
|
||||
that.updateRotationHandles();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -43,6 +43,7 @@
|
|||
#include <AddressManager.h>
|
||||
#include <ApplicationVersion.h>
|
||||
#include <AssetClient.h>
|
||||
#include <AssetUpload.h>
|
||||
#include <AutoUpdater.h>
|
||||
#include <CursorManager.h>
|
||||
#include <DeferredLightingEffect.h>
|
||||
|
@ -157,6 +158,7 @@ static const QString SVO_EXTENSION = ".svo";
|
|||
static const QString SVO_JSON_EXTENSION = ".svo.json";
|
||||
static const QString JS_EXTENSION = ".js";
|
||||
static const QString FST_EXTENSION = ".fst";
|
||||
static const QString FBX_EXTENSION = ".fbx";
|
||||
|
||||
static const int MIRROR_VIEW_TOP_PADDING = 5;
|
||||
static const int MIRROR_VIEW_LEFT_PADDING = 10;
|
||||
|
@ -190,6 +192,15 @@ static const QString DESKTOP_LOCATION = QStandardPaths::writableLocation(QStanda
|
|||
const QString DEFAULT_SCRIPTS_JS_URL = "http://s3.amazonaws.com/hifi-public/scripts/defaultScripts.js";
|
||||
Setting::Handle<int> maxOctreePacketsPerSecond("maxOctreePPS", DEFAULT_MAX_OCTREE_PPS);
|
||||
|
||||
const QHash<QString, Application::AcceptURLMethod> Application::_acceptedExtensions {
|
||||
{ SNAPSHOT_EXTENSION, &Application::acceptSnapshot },
|
||||
{ SVO_EXTENSION, &Application::importSVOFromURL },
|
||||
{ SVO_JSON_EXTENSION, &Application::importSVOFromURL },
|
||||
{ JS_EXTENSION, &Application::askToLoadScript },
|
||||
{ FST_EXTENSION, &Application::askToSetAvatarUrl },
|
||||
{ FBX_EXTENSION, &Application::askToUploadAsset }
|
||||
};
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
class MyNativeEventFilter : public QAbstractNativeEventFilter {
|
||||
public:
|
||||
|
@ -2009,26 +2020,18 @@ void Application::wheelEvent(QWheelEvent* event) {
|
|||
}
|
||||
|
||||
void Application::dropEvent(QDropEvent *event) {
|
||||
const QMimeData *mimeData = event->mimeData();
|
||||
bool atLeastOneFileAccepted = false;
|
||||
foreach (QUrl url, mimeData->urls()) {
|
||||
const QMimeData* mimeData = event->mimeData();
|
||||
for (auto& url : mimeData->urls()) {
|
||||
QString urlString = url.toString();
|
||||
if (canAcceptURL(urlString)) {
|
||||
if (acceptURL(urlString)) {
|
||||
atLeastOneFileAccepted = true;
|
||||
break;
|
||||
}
|
||||
if (canAcceptURL(urlString) && acceptURL(urlString)) {
|
||||
event->acceptProposedAction();
|
||||
}
|
||||
}
|
||||
|
||||
if (atLeastOneFileAccepted) {
|
||||
event->acceptProposedAction();
|
||||
}
|
||||
}
|
||||
|
||||
void Application::dragEnterEvent(QDragEnterEvent* event) {
|
||||
const QMimeData* mimeData = event->mimeData();
|
||||
foreach(QUrl url, mimeData->urls()) {
|
||||
for (auto& url : mimeData->urls()) {
|
||||
auto urlString = url.toString();
|
||||
if (canAcceptURL(urlString)) {
|
||||
event->acceptProposedAction();
|
||||
|
@ -3954,19 +3957,7 @@ void Application::registerScriptEngineWithApplicationServices(ScriptEngine* scri
|
|||
#endif
|
||||
}
|
||||
|
||||
void Application::initializeAcceptedFiles() {
|
||||
if (_acceptedExtensions.size() == 0) {
|
||||
_acceptedExtensions[SNAPSHOT_EXTENSION] = &Application::acceptSnapshot;
|
||||
_acceptedExtensions[SVO_EXTENSION] = &Application::importSVOFromURL;
|
||||
_acceptedExtensions[SVO_JSON_EXTENSION] = &Application::importSVOFromURL;
|
||||
_acceptedExtensions[JS_EXTENSION] = &Application::askToLoadScript;
|
||||
_acceptedExtensions[FST_EXTENSION] = &Application::askToSetAvatarUrl;
|
||||
}
|
||||
}
|
||||
|
||||
bool Application::canAcceptURL(const QString& urlString) {
|
||||
initializeAcceptedFiles();
|
||||
|
||||
QUrl url(urlString);
|
||||
if (urlString.startsWith(HIFI_URL_SCHEME)) {
|
||||
return true;
|
||||
|
@ -3983,8 +3974,6 @@ bool Application::canAcceptURL(const QString& urlString) {
|
|||
}
|
||||
|
||||
bool Application::acceptURL(const QString& urlString) {
|
||||
initializeAcceptedFiles();
|
||||
|
||||
if (urlString.startsWith(HIFI_URL_SCHEME)) {
|
||||
// this is a hifi URL - have the AddressManager handle it
|
||||
QMetaObject::invokeMethod(DependencyManager::get<AddressManager>().data(), "handleLookupString",
|
||||
|
@ -4078,8 +4067,73 @@ bool Application::askToLoadScript(const QString& scriptFilenameOrURL) {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool Application::askToUploadAsset(const QString& filename) {
|
||||
if (!DependencyManager::get<NodeList>()->getThisNodeCanRez()) {
|
||||
QMessageBox::warning(_window, "Failed Upload",
|
||||
QString("You don't have upload rights on that domain.\n\n"));
|
||||
return false;
|
||||
}
|
||||
|
||||
QUrl url { filename };
|
||||
if (auto upload = DependencyManager::get<AssetClient>()->createUpload(url.toLocalFile())) {
|
||||
// connect to the finished signal so we know when the AssetUpload is done
|
||||
QObject::connect(upload, &AssetUpload::finished, this, &Application::assetUploadFinished);
|
||||
|
||||
// start the upload now
|
||||
upload->start();
|
||||
return true;
|
||||
}
|
||||
|
||||
// display a message box with the error
|
||||
QMessageBox::warning(_window, "Failed Upload", QString("Failed to upload %1.\n\n").arg(filename));
|
||||
return false;
|
||||
}
|
||||
|
||||
void Application::assetUploadFinished(AssetUpload* upload, const QString& hash) {
|
||||
if (upload->getError() != AssetUpload::NoError) {
|
||||
// figure out the right error message for the message box
|
||||
QString additionalError;
|
||||
|
||||
switch (upload->getError()) {
|
||||
case AssetUpload::PermissionDenied:
|
||||
additionalError = "You do not have permission to upload content to this asset-server.";
|
||||
break;
|
||||
case AssetUpload::TooLarge:
|
||||
additionalError = "The uploaded content was too large and could not be stored in the asset-server.";
|
||||
break;
|
||||
case AssetUpload::FileOpenError:
|
||||
additionalError = "The file could not be opened. Please check your permissions and try again.";
|
||||
break;
|
||||
case AssetUpload::NetworkError:
|
||||
additionalError = "The file could not be opened. Please check your network connectivity.";
|
||||
break;
|
||||
default:
|
||||
// not handled, do not show a message box
|
||||
return;
|
||||
}
|
||||
|
||||
// display a message box with the error
|
||||
auto filename = QFileInfo(upload->getFilename()).fileName();
|
||||
QString errorMessage = QString("Failed to upload %1.\n\n%2").arg(filename, additionalError);
|
||||
QMessageBox::warning(_window, "Failed Upload", errorMessage);
|
||||
}
|
||||
|
||||
auto entities = DependencyManager::get<EntityScriptingInterface>();
|
||||
auto myAvatar = getMyAvatar();
|
||||
|
||||
EntityItemProperties properties;
|
||||
properties.setType(EntityTypes::Model);
|
||||
properties.setModelURL(QString("%1:%2.%3").arg(ATP_SCHEME).arg(hash).arg(upload->getExtension()));
|
||||
properties.setPosition(myAvatar->getPosition() + myAvatar->getOrientation() * Vectors::FRONT * 2.0f);
|
||||
properties.setName(QUrl(upload->getFilename()).fileName());
|
||||
|
||||
entities->addEntity(properties);
|
||||
|
||||
upload->deleteLater();
|
||||
}
|
||||
|
||||
ScriptEngine* Application::loadScript(const QString& scriptFilename, bool isUserLoaded,
|
||||
bool loadScriptFromEditor, bool activateMainWindow, bool reload) {
|
||||
bool loadScriptFromEditor, bool activateMainWindow, bool reload) {
|
||||
|
||||
if (isAboutToQuit()) {
|
||||
return NULL;
|
||||
|
|
|
@ -67,6 +67,7 @@ class OffscreenGlCanvas;
|
|||
class GLCanvas;
|
||||
class FaceTracker;
|
||||
class MainWindow;
|
||||
class AssetUpload;
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
static const UINT UWM_IDENTIFY_INSTANCES =
|
||||
|
@ -327,6 +328,8 @@ private slots:
|
|||
bool acceptSnapshot(const QString& urlString);
|
||||
bool askToSetAvatarUrl(const QString& url);
|
||||
bool askToLoadScript(const QString& scriptFilenameOrURL);
|
||||
bool askToUploadAsset(const QString& asset);
|
||||
void assetUploadFinished(AssetUpload* upload, const QString& hash);
|
||||
|
||||
void setSessionUUID(const QUuid& sessionUUID);
|
||||
void domainChanged(const QString& domainHostname);
|
||||
|
@ -500,7 +503,7 @@ private:
|
|||
GLCanvas* _glWidget{ nullptr };
|
||||
|
||||
typedef bool (Application::* AcceptURLMethod)(const QString &);
|
||||
QHash<QString, AcceptURLMethod> _acceptedExtensions;
|
||||
static const QHash<QString, AcceptURLMethod> _acceptedExtensions;
|
||||
|
||||
QList<QString> _domainConnectionRefusals;
|
||||
glm::uvec2 _renderResolution;
|
||||
|
|
|
@ -29,10 +29,6 @@ AssetUploadDialogFactory& AssetUploadDialogFactory::getInstance() {
|
|||
return staticInstance;
|
||||
}
|
||||
|
||||
AssetUploadDialogFactory::AssetUploadDialogFactory() {
|
||||
|
||||
}
|
||||
|
||||
static const QString PERMISSION_DENIED_ERROR = "You do not have permission to upload content to this asset-server.";
|
||||
|
||||
void AssetUploadDialogFactory::showDialog() {
|
||||
|
|
|
@ -27,12 +27,14 @@ public:
|
|||
static AssetUploadDialogFactory& getInstance();
|
||||
|
||||
void setDialogParent(QWidget* dialogParent) { _dialogParent = dialogParent; }
|
||||
|
||||
public slots:
|
||||
void showDialog();
|
||||
private slots:
|
||||
void handleUploadFinished(AssetUpload* upload, const QString& hash);
|
||||
|
||||
private:
|
||||
AssetUploadDialogFactory();
|
||||
AssetUploadDialogFactory() = default;
|
||||
|
||||
void showErrorDialog(const QString& filename, const QString& additionalError);
|
||||
|
||||
|
|
|
@ -26,6 +26,12 @@
|
|||
EntityItemPointer RenderableModelEntityItem::factory(const EntityItemID& entityID, const EntityItemProperties& properties) {
|
||||
return std::make_shared<RenderableModelEntityItem>(entityID, properties);
|
||||
}
|
||||
RenderableModelEntityItem::RenderableModelEntityItem(const EntityItemID& entityItemID,
|
||||
const EntityItemProperties& properties) :
|
||||
ModelEntityItem(entityItemID, properties),
|
||||
_dimensionsInitialized { properties.dimensionsChanged() }
|
||||
{
|
||||
}
|
||||
|
||||
RenderableModelEntityItem::~RenderableModelEntityItem() {
|
||||
assert(_myRenderer || !_model); // if we have a model, we need to know our renderer
|
||||
|
@ -35,6 +41,11 @@ RenderableModelEntityItem::~RenderableModelEntityItem() {
|
|||
}
|
||||
}
|
||||
|
||||
void RenderableModelEntityItem::setDimensions(const glm::vec3& value) {
|
||||
_dimensionsInitialized = true;
|
||||
ModelEntityItem::setDimensions(value);
|
||||
}
|
||||
|
||||
bool RenderableModelEntityItem::setProperties(const EntityItemProperties& properties) {
|
||||
QString oldModelURL = getModelURL();
|
||||
bool somethingChanged = ModelEntityItem::setProperties(properties);
|
||||
|
@ -189,7 +200,6 @@ void makeEntityItemStatusGetters(RenderableModelEntityItem* entity, render::Item
|
|||
|
||||
bool RenderableModelEntityItem::addToScene(EntityItemPointer self, std::shared_ptr<render::Scene> scene,
|
||||
render::PendingChanges& pendingChanges) {
|
||||
|
||||
_myMetaItem = scene->allocateID();
|
||||
|
||||
auto renderData = std::make_shared<RenderableModelEntityItemMeta>(self);
|
||||
|
@ -223,9 +233,6 @@ void RenderableModelEntityItem::removeFromScene(EntityItemPointer self, std::sha
|
|||
void RenderableModelEntityItem::render(RenderArgs* args) {
|
||||
PerformanceTimer perfTimer("RMEIrender");
|
||||
assert(getType() == EntityTypes::Model);
|
||||
|
||||
glm::vec3 position = getPosition();
|
||||
glm::vec3 dimensions = getDimensions();
|
||||
|
||||
if (hasModel()) {
|
||||
if (_model) {
|
||||
|
@ -290,19 +297,19 @@ void RenderableModelEntityItem::render(RenderArgs* args) {
|
|||
}
|
||||
}
|
||||
|
||||
glm::quat rotation = getRotation();
|
||||
bool movingOrAnimating = isMoving() || isAnimatingSomething();
|
||||
if ((movingOrAnimating || _needsInitialSimulation) && _model->isActive()) {
|
||||
_model->setScaleToFit(true, dimensions);
|
||||
if ((movingOrAnimating || _needsInitialSimulation) && _model->isActive() && _dimensionsInitialized) {
|
||||
_model->setScaleToFit(true, getDimensions());
|
||||
_model->setSnapModelToRegistrationPoint(true, getRegistrationPoint());
|
||||
_model->setRotation(rotation);
|
||||
_model->setTranslation(position);
|
||||
_model->setRotation(getRotation());
|
||||
_model->setTranslation(getPosition());
|
||||
|
||||
// make sure to simulate so everything gets set up correctly for rendering
|
||||
{
|
||||
PerformanceTimer perfTimer("_model->simulate");
|
||||
_model->simulate(0.0f);
|
||||
}
|
||||
|
||||
_needsInitialSimulation = false;
|
||||
}
|
||||
}
|
||||
|
@ -360,7 +367,23 @@ Model* RenderableModelEntityItem::getModel(EntityTreeRenderer* renderer) {
|
|||
}
|
||||
|
||||
bool RenderableModelEntityItem::needsToCallUpdate() const {
|
||||
return _needsInitialSimulation || ModelEntityItem::needsToCallUpdate();
|
||||
return !_dimensionsInitialized || _needsInitialSimulation || ModelEntityItem::needsToCallUpdate();
|
||||
}
|
||||
|
||||
void RenderableModelEntityItem::update(const quint64& now) {
|
||||
if (!_dimensionsInitialized && _model && _model->isActive()) {
|
||||
EntityItemProperties properties;
|
||||
auto extents = _model->getMeshExtents();
|
||||
properties.setDimensions(extents.maximum - extents.minimum);
|
||||
|
||||
qCDebug(entitiesrenderer) << "Autoresizing:" << (!getName().isEmpty() ? getName() : getModelURL());
|
||||
QMetaObject::invokeMethod(DependencyManager::get<EntityScriptingInterface>().data(), "editEntity",
|
||||
Qt::QueuedConnection,
|
||||
Q_ARG(QUuid, getEntityItemID()),
|
||||
Q_ARG(EntityItemProperties, properties));
|
||||
}
|
||||
|
||||
ModelEntityItem::update(now);
|
||||
}
|
||||
|
||||
EntityItemProperties RenderableModelEntityItem::getProperties(EntityPropertyFlags desiredProperties) const {
|
||||
|
|
|
@ -25,16 +25,12 @@ class RenderableModelEntityItem : public ModelEntityItem {
|
|||
public:
|
||||
static EntityItemPointer factory(const EntityItemID& entityID, const EntityItemProperties& properties);
|
||||
|
||||
RenderableModelEntityItem(const EntityItemID& entityItemID, const EntityItemProperties& properties) :
|
||||
ModelEntityItem(entityItemID, properties),
|
||||
_model(NULL),
|
||||
_needsInitialSimulation(true),
|
||||
_needsModelReload(true),
|
||||
_myRenderer(NULL),
|
||||
_originalTexturesRead(false) { }
|
||||
RenderableModelEntityItem(const EntityItemID& entityItemID, const EntityItemProperties& properties);
|
||||
|
||||
virtual ~RenderableModelEntityItem();
|
||||
|
||||
virtual void setDimensions(const glm::vec3& value) override;
|
||||
|
||||
virtual EntityItemProperties getProperties(EntityPropertyFlags desiredProperties = EntityPropertyFlags()) const;
|
||||
virtual bool setProperties(const EntityItemProperties& properties);
|
||||
virtual int readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead,
|
||||
|
@ -61,8 +57,9 @@ public:
|
|||
void** intersectedObject, bool precisionPicking) const;
|
||||
|
||||
Model* getModel(EntityTreeRenderer* renderer);
|
||||
|
||||
bool needsToCallUpdate() const;
|
||||
|
||||
virtual bool needsToCallUpdate() const;
|
||||
virtual void update(const quint64& now);
|
||||
|
||||
virtual void setCompoundShapeURL(const QString& url);
|
||||
|
||||
|
@ -74,14 +71,15 @@ public:
|
|||
private:
|
||||
void remapTextures();
|
||||
|
||||
Model* _model;
|
||||
bool _needsInitialSimulation;
|
||||
bool _needsModelReload;
|
||||
EntityTreeRenderer* _myRenderer;
|
||||
Model* _model = nullptr;
|
||||
bool _needsInitialSimulation = true;
|
||||
bool _needsModelReload = true;
|
||||
EntityTreeRenderer* _myRenderer = nullptr;
|
||||
QString _currentTextures;
|
||||
QStringList _originalTextures;
|
||||
bool _originalTexturesRead;
|
||||
bool _originalTexturesRead = false;
|
||||
QVector<QVector<glm::vec3>> _points;
|
||||
bool _dimensionsInitialized = false;
|
||||
|
||||
render::ItemID _myMetaItem;
|
||||
};
|
||||
|
|
|
@ -263,8 +263,8 @@ void RenderableParticleEffectEntityItem::updateRenderItem() {
|
|||
}
|
||||
|
||||
// update transform
|
||||
glm::quat rot = _transform.getRotation();
|
||||
glm::vec3 pos = _transform.getTranslation();
|
||||
glm::quat rot = getRotation();
|
||||
glm::vec3 pos = getPosition();
|
||||
Transform t;
|
||||
t.setRotation(rot);
|
||||
payload.setModelTransform(t);
|
||||
|
|
|
@ -18,18 +18,6 @@
|
|||
#include "EntityItemProperties.h"
|
||||
#include "EntityItemPropertiesMacros.h"
|
||||
|
||||
AnimationPropertyGroup::AnimationPropertyGroup() :
|
||||
CONSTRUCT_PROPERTY(url, QString{}),
|
||||
CONSTRUCT_PROPERTY(fps, 30.0f),
|
||||
CONSTRUCT_PROPERTY(running, false),
|
||||
CONSTRUCT_PROPERTY(loop, true),
|
||||
CONSTRUCT_PROPERTY(firstFrame, 0.0f),
|
||||
CONSTRUCT_PROPERTY(lastFrame, AnimationLoop::MAXIMUM_POSSIBLE_FRAME),
|
||||
CONSTRUCT_PROPERTY(hold, false),
|
||||
CONSTRUCT_PROPERTY(startAutomatically, false)
|
||||
{
|
||||
}
|
||||
|
||||
void AnimationPropertyGroup::copyToScriptValue(const EntityPropertyFlags& desiredProperties, QScriptValue& properties, QScriptEngine* engine, bool skipDefaults, EntityItemProperties& defaultEntityProperties) const {
|
||||
COPY_GROUP_PROPERTY_TO_QSCRIPTVALUE(PROP_ANIMATION_URL, Animation, animation, URL, url);
|
||||
|
||||
|
|
|
@ -13,26 +13,24 @@
|
|||
#ifndef hifi_AnimationPropertyGroup_h
|
||||
#define hifi_AnimationPropertyGroup_h
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
#include <QtScript/QScriptEngine>
|
||||
|
||||
#include "PropertyGroup.h"
|
||||
#include "AnimationLoop.h"
|
||||
#include "EntityItemPropertiesMacros.h"
|
||||
#include "PropertyGroup.h"
|
||||
|
||||
class EntityItemProperties;
|
||||
class EncodeBitstreamParams;
|
||||
class OctreePacketData;
|
||||
class EntityTreeElementExtraEncodeData;
|
||||
class ReadBitstreamToTreeParams;
|
||||
class AnimationLoop;
|
||||
|
||||
#include <stdint.h>
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
|
||||
class AnimationPropertyGroup : public PropertyGroup {
|
||||
public:
|
||||
AnimationPropertyGroup();
|
||||
virtual ~AnimationPropertyGroup() {}
|
||||
void associateWithAnimationLoop(AnimationLoop* animationLoop) { _animationLoop = animationLoop; }
|
||||
|
||||
// EntityItemProperty related helpers
|
||||
|
@ -72,16 +70,16 @@ public:
|
|||
ReadBitstreamToTreeParams& args,
|
||||
EntityPropertyFlags& propertyFlags, bool overwriteLocalData,
|
||||
bool& somethingChanged);
|
||||
|
||||
DEFINE_PROPERTY_REF(PROP_ANIMATION_URL, URL, url, QString);
|
||||
DEFINE_PROPERTY(PROP_ANIMATION_FPS, FPS, fps, float);
|
||||
DEFINE_PROPERTY(PROP_ANIMATION_FRAME_INDEX, CurrentFrame, currentFrame, float);
|
||||
DEFINE_PROPERTY(PROP_ANIMATION_PLAYING, Running, running, bool); // was animationIsPlaying
|
||||
DEFINE_PROPERTY(PROP_ANIMATION_LOOP, Loop, loop, bool); // was animationSettings.loop
|
||||
DEFINE_PROPERTY(PROP_ANIMATION_FIRST_FRAME, FirstFrame, firstFrame, float); // was animationSettings.firstFrame
|
||||
DEFINE_PROPERTY(PROP_ANIMATION_LAST_FRAME, LastFrame, lastFrame, float); // was animationSettings.lastFrame
|
||||
DEFINE_PROPERTY(PROP_ANIMATION_HOLD, Hold, hold, bool); // was animationSettings.hold
|
||||
DEFINE_PROPERTY(PROP_ANIMATION_START_AUTOMATICALLY, StartAutomatically, startAutomatically, bool); // was animationSettings.startAutomatically
|
||||
|
||||
DEFINE_PROPERTY_REF(PROP_ANIMATION_URL, URL, url, QString, "");
|
||||
DEFINE_PROPERTY(PROP_ANIMATION_FPS, FPS, fps, float, 30.0f);
|
||||
DEFINE_PROPERTY(PROP_ANIMATION_FRAME_INDEX, CurrentFrame, currentFrame, float, 0.0f);
|
||||
DEFINE_PROPERTY(PROP_ANIMATION_PLAYING, Running, running, bool, false); // was animationIsPlaying
|
||||
DEFINE_PROPERTY(PROP_ANIMATION_LOOP, Loop, loop, bool, true); // was animationSettings.loop
|
||||
DEFINE_PROPERTY(PROP_ANIMATION_FIRST_FRAME, FirstFrame, firstFrame, float, 0.0f); // was animationSettings.firstFrame
|
||||
DEFINE_PROPERTY(PROP_ANIMATION_LAST_FRAME, LastFrame, lastFrame, float, AnimationLoop::MAXIMUM_POSSIBLE_FRAME); // was animationSettings.lastFrame
|
||||
DEFINE_PROPERTY(PROP_ANIMATION_HOLD, Hold, hold, bool, false); // was animationSettings.hold
|
||||
DEFINE_PROPERTY(PROP_ANIMATION_START_AUTOMATICALLY, StartAutomatically, startAutomatically, bool, false); // was animationSettings.startAutomatically
|
||||
|
||||
protected:
|
||||
void setFromOldAnimationSettings(const QString& value);
|
||||
|
|
|
@ -15,22 +15,13 @@
|
|||
#include "EntityItemProperties.h"
|
||||
#include "EntityItemPropertiesMacros.h"
|
||||
|
||||
AtmospherePropertyGroup::AtmospherePropertyGroup() {
|
||||
const glm::vec3 DEFAULT_CENTER = glm::vec3(0.0f, -1000.0f, 0.0f);
|
||||
const float DEFAULT_INNER_RADIUS = 1000.0f;
|
||||
const float DEFAULT_OUTER_RADIUS = 1025.0f;
|
||||
const float DEFAULT_RAYLEIGH_SCATTERING = 0.0025f;
|
||||
const float DEFAULT_MIE_SCATTERING = 0.0010f;
|
||||
const glm::vec3 DEFAULT_SCATTERING_WAVELENGTHS = glm::vec3(0.650f, 0.570f, 0.475f);
|
||||
|
||||
_center = DEFAULT_CENTER;
|
||||
_innerRadius = DEFAULT_INNER_RADIUS;
|
||||
_outerRadius = DEFAULT_OUTER_RADIUS;
|
||||
_mieScattering = DEFAULT_MIE_SCATTERING;
|
||||
_rayleighScattering = DEFAULT_RAYLEIGH_SCATTERING;
|
||||
_scatteringWavelengths = DEFAULT_SCATTERING_WAVELENGTHS;
|
||||
_hasStars = true;
|
||||
}
|
||||
const glm::vec3 AtmospherePropertyGroup::DEFAULT_CENTER = glm::vec3(0.0f, -1000.0f, 0.0f);
|
||||
const float AtmospherePropertyGroup::DEFAULT_INNER_RADIUS = 1000.0f;
|
||||
const float AtmospherePropertyGroup::DEFAULT_OUTER_RADIUS = 1025.0f;
|
||||
const float AtmospherePropertyGroup::DEFAULT_RAYLEIGH_SCATTERING = 0.0025f;
|
||||
const float AtmospherePropertyGroup::DEFAULT_MIE_SCATTERING = 0.0010f;
|
||||
const glm::vec3 AtmospherePropertyGroup::DEFAULT_SCATTERING_WAVELENGTHS = glm::vec3(0.650f, 0.570f, 0.475f);
|
||||
const bool AtmospherePropertyGroup::DEFAULT_HAS_STARS = true;
|
||||
|
||||
void AtmospherePropertyGroup::copyToScriptValue(const EntityPropertyFlags& desiredProperties, QScriptValue& properties, QScriptEngine* engine, bool skipDefaults, EntityItemProperties& defaultEntityProperties) const {
|
||||
COPY_GROUP_PROPERTY_TO_QSCRIPTVALUE(PROP_ATMOSPHERE_CENTER, Atmosphere, atmosphere, Center, center);
|
||||
|
|
|
@ -49,9 +49,6 @@ class ReadBitstreamToTreeParams;
|
|||
|
||||
class AtmospherePropertyGroup : public PropertyGroup {
|
||||
public:
|
||||
AtmospherePropertyGroup();
|
||||
virtual ~AtmospherePropertyGroup() {}
|
||||
|
||||
// EntityItemProperty related helpers
|
||||
virtual void copyToScriptValue(const EntityPropertyFlags& desiredProperties, QScriptValue& properties, QScriptEngine* engine, bool skipDefaults, EntityItemProperties& defaultEntityProperties) const;
|
||||
virtual void copyFromScriptValue(const QScriptValue& object, bool& _defaultSettings);
|
||||
|
@ -90,14 +87,22 @@ public:
|
|||
EntityPropertyFlags& propertyFlags, bool overwriteLocalData,
|
||||
bool& somethingChanged);
|
||||
|
||||
|
||||
DEFINE_PROPERTY_REF(PROP_ATMOSPHERE_CENTER, Center, center, glm::vec3);
|
||||
DEFINE_PROPERTY(PROP_ATMOSPHERE_INNER_RADIUS, InnerRadius, innerRadius, float);
|
||||
DEFINE_PROPERTY(PROP_ATMOSPHERE_OUTER_RADIUS, OuterRadius, outerRadius, float);
|
||||
DEFINE_PROPERTY(PROP_ATMOSPHERE_MIE_SCATTERING, MieScattering, mieScattering, float);
|
||||
DEFINE_PROPERTY(PROP_ATMOSPHERE_RAYLEIGH_SCATTERING, RayleighScattering, rayleighScattering, float);
|
||||
DEFINE_PROPERTY_REF(PROP_ATMOSPHERE_SCATTERING_WAVELENGTHS, ScatteringWavelengths, scatteringWavelengths, glm::vec3);
|
||||
DEFINE_PROPERTY(PROP_ATMOSPHERE_HAS_STARS, HasStars, hasStars, bool);
|
||||
|
||||
static const glm::vec3 DEFAULT_CENTER;
|
||||
static const float DEFAULT_INNER_RADIUS;
|
||||
static const float DEFAULT_OUTER_RADIUS;
|
||||
static const float DEFAULT_RAYLEIGH_SCATTERING;
|
||||
static const float DEFAULT_MIE_SCATTERING;
|
||||
static const glm::vec3 DEFAULT_SCATTERING_WAVELENGTHS;
|
||||
static const bool DEFAULT_HAS_STARS;
|
||||
|
||||
DEFINE_PROPERTY_REF(PROP_ATMOSPHERE_CENTER, Center, center, glm::vec3, DEFAULT_CENTER);
|
||||
DEFINE_PROPERTY(PROP_ATMOSPHERE_INNER_RADIUS, InnerRadius, innerRadius, float, DEFAULT_INNER_RADIUS);
|
||||
DEFINE_PROPERTY(PROP_ATMOSPHERE_OUTER_RADIUS, OuterRadius, outerRadius, float, DEFAULT_OUTER_RADIUS);
|
||||
DEFINE_PROPERTY(PROP_ATMOSPHERE_MIE_SCATTERING, MieScattering, mieScattering, float, DEFAULT_MIE_SCATTERING);
|
||||
DEFINE_PROPERTY(PROP_ATMOSPHERE_RAYLEIGH_SCATTERING, RayleighScattering, rayleighScattering, float, DEFAULT_RAYLEIGH_SCATTERING);
|
||||
DEFINE_PROPERTY_REF(PROP_ATMOSPHERE_SCATTERING_WAVELENGTHS, ScatteringWavelengths, scatteringWavelengths, glm::vec3, DEFAULT_SCATTERING_WAVELENGTHS);
|
||||
DEFINE_PROPERTY(PROP_ATMOSPHERE_HAS_STARS, HasStars, hasStars, bool, DEFAULT_HAS_STARS);
|
||||
};
|
||||
|
||||
#endif // hifi_AtmospherePropertyGroup_h
|
||||
|
|
|
@ -15,11 +15,11 @@
|
|||
#include <ByteCountCoding.h>
|
||||
|
||||
#include "BoxEntityItem.h"
|
||||
#include "EntityTree.h"
|
||||
#include "EntitiesLogging.h"
|
||||
#include "EntityItemProperties.h"
|
||||
#include "EntityTree.h"
|
||||
#include "EntityTreeElement.h"
|
||||
|
||||
|
||||
EntityItemPointer BoxEntityItem::factory(const EntityItemID& entityID, const EntityItemProperties& properties) {
|
||||
EntityItemPointer result { new BoxEntityItem(entityID, properties) };
|
||||
return result;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include "EntityEditPacketSender.h"
|
||||
#include "EntitiesLogging.h"
|
||||
#include "EntityItem.h"
|
||||
#include "EntityItemProperties.h"
|
||||
|
||||
EntityEditPacketSender::EntityEditPacketSender() {
|
||||
auto& packetReceiver = DependencyManager::get<NodeList>()->getPacketReceiver();
|
||||
|
|
|
@ -25,8 +25,8 @@
|
|||
#include <Transform.h>
|
||||
|
||||
#include "EntityItemID.h"
|
||||
#include "EntityItemProperties.h"
|
||||
#include "EntityItemPropertiesDefaults.h"
|
||||
#include "EntityPropertyFlags.h"
|
||||
#include "EntityTypes.h"
|
||||
#include "SimulationOwner.h"
|
||||
|
||||
|
@ -34,6 +34,7 @@ class EntitySimulation;
|
|||
class EntityTreeElement;
|
||||
class EntityTreeElementExtraEncodeData;
|
||||
class EntityActionInterface;
|
||||
class EntityItemProperties;
|
||||
class EntityTree;
|
||||
typedef std::shared_ptr<EntityTree> EntityTreePointer;
|
||||
typedef std::shared_ptr<EntityActionInterface> EntityActionPointer;
|
||||
|
|
|
@ -21,13 +21,7 @@
|
|||
#include "EntitiesLogging.h"
|
||||
#include "EntityItem.h"
|
||||
#include "EntityItemProperties.h"
|
||||
#include "EntityItemPropertiesDefaults.h"
|
||||
#include "ModelEntityItem.h"
|
||||
#include "ParticleEffectEntityItem.h"
|
||||
#include "TextEntityItem.h"
|
||||
#include "ZoneEntityItem.h"
|
||||
#include "PolyVoxEntityItem.h"
|
||||
#include "LineEntityItem.h"
|
||||
#include "PolyLineEntityItem.h"
|
||||
|
||||
AnimationPropertyGroup EntityItemProperties::_staticAnimation;
|
||||
|
@ -39,96 +33,6 @@ EntityPropertyList PROP_LAST_ITEM = (EntityPropertyList)(PROP_AFTER_LAST_ITEM -
|
|||
|
||||
EntityItemProperties::EntityItemProperties(EntityPropertyFlags desiredProperties) :
|
||||
|
||||
CONSTRUCT_PROPERTY(visible, ENTITY_ITEM_DEFAULT_VISIBLE),
|
||||
CONSTRUCT_PROPERTY(position, 0.0f),
|
||||
CONSTRUCT_PROPERTY(dimensions, ENTITY_ITEM_DEFAULT_DIMENSIONS),
|
||||
CONSTRUCT_PROPERTY(rotation, ENTITY_ITEM_DEFAULT_ROTATION),
|
||||
CONSTRUCT_PROPERTY(density, ENTITY_ITEM_DEFAULT_DENSITY),
|
||||
CONSTRUCT_PROPERTY(velocity, ENTITY_ITEM_DEFAULT_VELOCITY),
|
||||
CONSTRUCT_PROPERTY(gravity, ENTITY_ITEM_DEFAULT_GRAVITY),
|
||||
CONSTRUCT_PROPERTY(acceleration, ENTITY_ITEM_DEFAULT_ACCELERATION),
|
||||
CONSTRUCT_PROPERTY(damping, ENTITY_ITEM_DEFAULT_DAMPING),
|
||||
CONSTRUCT_PROPERTY(restitution, ENTITY_ITEM_DEFAULT_RESTITUTION),
|
||||
CONSTRUCT_PROPERTY(friction, ENTITY_ITEM_DEFAULT_FRICTION),
|
||||
CONSTRUCT_PROPERTY(lifetime, ENTITY_ITEM_DEFAULT_LIFETIME),
|
||||
CONSTRUCT_PROPERTY(created, UNKNOWN_CREATED_TIME),
|
||||
CONSTRUCT_PROPERTY(script, ENTITY_ITEM_DEFAULT_SCRIPT),
|
||||
CONSTRUCT_PROPERTY(scriptTimestamp, ENTITY_ITEM_DEFAULT_SCRIPT_TIMESTAMP),
|
||||
CONSTRUCT_PROPERTY(collisionSoundURL, ENTITY_ITEM_DEFAULT_COLLISION_SOUND_URL),
|
||||
CONSTRUCT_PROPERTY(color, ),
|
||||
CONSTRUCT_PROPERTY(colorSpread, ParticleEffectEntityItem::DEFAULT_COLOR_SPREAD),
|
||||
CONSTRUCT_PROPERTY(colorStart, ParticleEffectEntityItem::DEFAULT_COLOR),
|
||||
CONSTRUCT_PROPERTY(colorFinish, ParticleEffectEntityItem::DEFAULT_COLOR),
|
||||
CONSTRUCT_PROPERTY(alpha, ENTITY_ITEM_DEFAULT_ALPHA),
|
||||
CONSTRUCT_PROPERTY(alphaSpread, ParticleEffectEntityItem::DEFAULT_ALPHA_SPREAD),
|
||||
CONSTRUCT_PROPERTY(alphaStart, ParticleEffectEntityItem::DEFAULT_ALPHA_START),
|
||||
CONSTRUCT_PROPERTY(alphaFinish, ParticleEffectEntityItem::DEFAULT_ALPHA_FINISH),
|
||||
CONSTRUCT_PROPERTY(modelURL, ""),
|
||||
CONSTRUCT_PROPERTY(compoundShapeURL, ""),
|
||||
CONSTRUCT_PROPERTY(registrationPoint, ENTITY_ITEM_DEFAULT_REGISTRATION_POINT),
|
||||
CONSTRUCT_PROPERTY(angularVelocity, ENTITY_ITEM_DEFAULT_ANGULAR_VELOCITY),
|
||||
CONSTRUCT_PROPERTY(angularDamping, ENTITY_ITEM_DEFAULT_ANGULAR_DAMPING),
|
||||
CONSTRUCT_PROPERTY(ignoreForCollisions, ENTITY_ITEM_DEFAULT_IGNORE_FOR_COLLISIONS),
|
||||
CONSTRUCT_PROPERTY(collisionsWillMove, ENTITY_ITEM_DEFAULT_COLLISIONS_WILL_MOVE),
|
||||
CONSTRUCT_PROPERTY(isSpotlight, false),
|
||||
CONSTRUCT_PROPERTY(intensity, 1.0f),
|
||||
CONSTRUCT_PROPERTY(exponent, 0.0f),
|
||||
CONSTRUCT_PROPERTY(cutoff, ENTITY_ITEM_DEFAULT_CUTOFF),
|
||||
CONSTRUCT_PROPERTY(locked, ENTITY_ITEM_DEFAULT_LOCKED),
|
||||
CONSTRUCT_PROPERTY(textures, ""),
|
||||
CONSTRUCT_PROPERTY(userData, ENTITY_ITEM_DEFAULT_USER_DATA),
|
||||
CONSTRUCT_PROPERTY(simulationOwner, SimulationOwner()),
|
||||
CONSTRUCT_PROPERTY(text, TextEntityItem::DEFAULT_TEXT),
|
||||
CONSTRUCT_PROPERTY(lineHeight, TextEntityItem::DEFAULT_LINE_HEIGHT),
|
||||
CONSTRUCT_PROPERTY(textColor, TextEntityItem::DEFAULT_TEXT_COLOR),
|
||||
CONSTRUCT_PROPERTY(backgroundColor, TextEntityItem::DEFAULT_BACKGROUND_COLOR),
|
||||
CONSTRUCT_PROPERTY(shapeType, SHAPE_TYPE_NONE),
|
||||
CONSTRUCT_PROPERTY(maxParticles, ParticleEffectEntityItem::DEFAULT_MAX_PARTICLES),
|
||||
CONSTRUCT_PROPERTY(lifespan, ParticleEffectEntityItem::DEFAULT_LIFESPAN),
|
||||
CONSTRUCT_PROPERTY(emitRate, ParticleEffectEntityItem::DEFAULT_EMIT_RATE),
|
||||
CONSTRUCT_PROPERTY(emitSpeed, ParticleEffectEntityItem::DEFAULT_EMIT_SPEED),
|
||||
CONSTRUCT_PROPERTY(speedSpread, ParticleEffectEntityItem::DEFAULT_SPEED_SPREAD),
|
||||
CONSTRUCT_PROPERTY(emitOrientation, ParticleEffectEntityItem::DEFAULT_EMIT_ORIENTATION),
|
||||
CONSTRUCT_PROPERTY(emitDimensions, ParticleEffectEntityItem::DEFAULT_EMIT_DIMENSIONS),
|
||||
CONSTRUCT_PROPERTY(emitRadiusStart, ParticleEffectEntityItem::DEFAULT_EMIT_RADIUS_START),
|
||||
CONSTRUCT_PROPERTY(polarStart, ParticleEffectEntityItem::DEFAULT_POLAR_START),
|
||||
CONSTRUCT_PROPERTY(polarFinish, ParticleEffectEntityItem::DEFAULT_POLAR_FINISH),
|
||||
CONSTRUCT_PROPERTY(azimuthStart, ParticleEffectEntityItem::DEFAULT_AZIMUTH_START),
|
||||
CONSTRUCT_PROPERTY(azimuthFinish, ParticleEffectEntityItem::DEFAULT_AZIMUTH_FINISH),
|
||||
CONSTRUCT_PROPERTY(emitAcceleration, ParticleEffectEntityItem::DEFAULT_EMIT_ACCELERATION),
|
||||
CONSTRUCT_PROPERTY(accelerationSpread, ParticleEffectEntityItem::DEFAULT_ACCELERATION_SPREAD),
|
||||
CONSTRUCT_PROPERTY(particleRadius, ParticleEffectEntityItem::DEFAULT_PARTICLE_RADIUS),
|
||||
CONSTRUCT_PROPERTY(radiusSpread, ParticleEffectEntityItem::DEFAULT_RADIUS_SPREAD),
|
||||
CONSTRUCT_PROPERTY(radiusStart, ParticleEffectEntityItem::DEFAULT_RADIUS_START),
|
||||
CONSTRUCT_PROPERTY(radiusFinish, ParticleEffectEntityItem::DEFAULT_RADIUS_FINISH),
|
||||
CONSTRUCT_PROPERTY(marketplaceID, ENTITY_ITEM_DEFAULT_MARKETPLACE_ID),
|
||||
CONSTRUCT_PROPERTY(keyLightColor, ZoneEntityItem::DEFAULT_KEYLIGHT_COLOR),
|
||||
CONSTRUCT_PROPERTY(keyLightIntensity, ZoneEntityItem::DEFAULT_KEYLIGHT_INTENSITY),
|
||||
CONSTRUCT_PROPERTY(keyLightAmbientIntensity, ZoneEntityItem::DEFAULT_KEYLIGHT_AMBIENT_INTENSITY),
|
||||
CONSTRUCT_PROPERTY(keyLightDirection, ZoneEntityItem::DEFAULT_KEYLIGHT_DIRECTION),
|
||||
CONSTRUCT_PROPERTY(voxelVolumeSize, PolyVoxEntityItem::DEFAULT_VOXEL_VOLUME_SIZE),
|
||||
CONSTRUCT_PROPERTY(voxelData, PolyVoxEntityItem::DEFAULT_VOXEL_DATA),
|
||||
CONSTRUCT_PROPERTY(voxelSurfaceStyle, PolyVoxEntityItem::DEFAULT_VOXEL_SURFACE_STYLE),
|
||||
CONSTRUCT_PROPERTY(name, ENTITY_ITEM_DEFAULT_NAME),
|
||||
CONSTRUCT_PROPERTY(backgroundMode, BACKGROUND_MODE_INHERIT),
|
||||
CONSTRUCT_PROPERTY(sourceUrl, ""),
|
||||
CONSTRUCT_PROPERTY(lineWidth, LineEntityItem::DEFAULT_LINE_WIDTH),
|
||||
CONSTRUCT_PROPERTY(linePoints, QVector<glm::vec3>()),
|
||||
CONSTRUCT_PROPERTY(faceCamera, TextEntityItem::DEFAULT_FACE_CAMERA),
|
||||
CONSTRUCT_PROPERTY(actionData, QByteArray()),
|
||||
CONSTRUCT_PROPERTY(normals, QVector<glm::vec3>()),
|
||||
CONSTRUCT_PROPERTY(strokeWidths, QVector<float>()),
|
||||
CONSTRUCT_PROPERTY(xTextureURL, ""),
|
||||
CONSTRUCT_PROPERTY(yTextureURL, ""),
|
||||
CONSTRUCT_PROPERTY(zTextureURL, ""),
|
||||
CONSTRUCT_PROPERTY(xNNeighborID, UNKNOWN_ENTITY_ID),
|
||||
CONSTRUCT_PROPERTY(yNNeighborID, UNKNOWN_ENTITY_ID),
|
||||
CONSTRUCT_PROPERTY(zNNeighborID, UNKNOWN_ENTITY_ID),
|
||||
CONSTRUCT_PROPERTY(xPNeighborID, UNKNOWN_ENTITY_ID),
|
||||
CONSTRUCT_PROPERTY(yPNeighborID, UNKNOWN_ENTITY_ID),
|
||||
CONSTRUCT_PROPERTY(zPNeighborID, UNKNOWN_ENTITY_ID),
|
||||
|
||||
|
||||
_id(UNKNOWN_ENTITY_ID),
|
||||
_idSet(false),
|
||||
_lastEdited(0),
|
||||
|
@ -147,9 +51,6 @@ _desiredProperties(desiredProperties)
|
|||
{
|
||||
}
|
||||
|
||||
EntityItemProperties::~EntityItemProperties() {
|
||||
}
|
||||
|
||||
void EntityItemProperties::setSittingPoints(const QVector<SittingPoint>& sittingPoints) {
|
||||
_sittingPoints.clear();
|
||||
foreach (SittingPoint sitPoint, sittingPoints) {
|
||||
|
|
|
@ -32,12 +32,18 @@
|
|||
#include "AnimationPropertyGroup.h"
|
||||
#include "AtmospherePropertyGroup.h"
|
||||
#include "EntityItemID.h"
|
||||
#include "EntityItemPropertiesDefaults.h"
|
||||
#include "EntityItemPropertiesMacros.h"
|
||||
#include "EntityTypes.h"
|
||||
#include "EntityPropertyFlags.h"
|
||||
#include "LineEntityItem.h"
|
||||
#include "ParticleEffectEntityItem.h"
|
||||
#include "PolyVoxEntityItem.h"
|
||||
#include "SimulationOwner.h"
|
||||
#include "SkyboxPropertyGroup.h"
|
||||
#include "StagePropertyGroup.h"
|
||||
#include "TextEntityItem.h"
|
||||
#include "ZoneEntityItem.h"
|
||||
|
||||
const quint64 UNKNOWN_CREATED_TIME = 0;
|
||||
|
||||
|
@ -60,7 +66,7 @@ class EntityItemProperties {
|
|||
friend class PolyLineEntityItem; // TODO: consider removing this friend relationship and use public methods
|
||||
public:
|
||||
EntityItemProperties(EntityPropertyFlags desiredProperties = EntityPropertyFlags());
|
||||
virtual ~EntityItemProperties();
|
||||
virtual ~EntityItemProperties() = default;
|
||||
|
||||
EntityTypes::EntityType getType() const { return _type; }
|
||||
void setType(EntityTypes::EntityType type) { _type = type; }
|
||||
|
@ -83,108 +89,108 @@ public:
|
|||
void debugDump() const;
|
||||
void setLastEdited(quint64 usecTime);
|
||||
|
||||
// Note: DEFINE_PROPERTY(PROP_FOO, Foo, foo, type) creates the following methods and variables:
|
||||
// Note: DEFINE_PROPERTY(PROP_FOO, Foo, foo, type, value) creates the following methods and variables:
|
||||
// type getFoo() const;
|
||||
// void setFoo(type);
|
||||
// bool fooChanged() const;
|
||||
// type _foo;
|
||||
// bool _fooChanged;
|
||||
// type _foo { value };
|
||||
// bool _fooChanged { false };
|
||||
|
||||
DEFINE_PROPERTY(PROP_VISIBLE, Visible, visible, bool);
|
||||
DEFINE_PROPERTY_REF_WITH_SETTER(PROP_POSITION, Position, position, glm::vec3);
|
||||
DEFINE_PROPERTY_REF(PROP_DIMENSIONS, Dimensions, dimensions, glm::vec3);
|
||||
DEFINE_PROPERTY_REF(PROP_ROTATION, Rotation, rotation, glm::quat);
|
||||
DEFINE_PROPERTY(PROP_DENSITY, Density, density, float);
|
||||
DEFINE_PROPERTY_REF(PROP_VELOCITY, Velocity, velocity, glm::vec3);
|
||||
DEFINE_PROPERTY_REF(PROP_GRAVITY, Gravity, gravity, glm::vec3);
|
||||
DEFINE_PROPERTY_REF(PROP_ACCELERATION, Acceleration, acceleration, glm::vec3);
|
||||
DEFINE_PROPERTY(PROP_DAMPING, Damping, damping, float);
|
||||
DEFINE_PROPERTY(PROP_RESTITUTION, Restitution, restitution, float);
|
||||
DEFINE_PROPERTY(PROP_FRICTION, Friction, friction, float);
|
||||
DEFINE_PROPERTY(PROP_LIFETIME, Lifetime, lifetime, float);
|
||||
DEFINE_PROPERTY(PROP_CREATED, Created, created, quint64);
|
||||
DEFINE_PROPERTY_REF(PROP_SCRIPT, Script, script, QString);
|
||||
DEFINE_PROPERTY(PROP_SCRIPT_TIMESTAMP, ScriptTimestamp, scriptTimestamp, quint64);
|
||||
DEFINE_PROPERTY_REF(PROP_COLLISION_SOUND_URL, CollisionSoundURL, collisionSoundURL, QString);
|
||||
DEFINE_PROPERTY_REF(PROP_COLOR, Color, color, xColor);
|
||||
DEFINE_PROPERTY_REF(PROP_COLOR_SPREAD, ColorSpread, colorSpread, xColor);
|
||||
DEFINE_PROPERTY_REF(PROP_COLOR_START, ColorStart, colorStart, xColor);
|
||||
DEFINE_PROPERTY_REF(PROP_COLOR_FINISH, ColorFinish, colorFinish, xColor);
|
||||
DEFINE_PROPERTY(PROP_ALPHA, Alpha, alpha, float);
|
||||
DEFINE_PROPERTY(PROP_ALPHA_SPREAD, AlphaSpread, alphaSpread, float);
|
||||
DEFINE_PROPERTY(PROP_ALPHA_START, AlphaStart, alphaStart, float);
|
||||
DEFINE_PROPERTY(PROP_ALPHA_FINISH, AlphaFinish, alphaFinish, float);
|
||||
DEFINE_PROPERTY_REF(PROP_MODEL_URL, ModelURL, modelURL, QString);
|
||||
DEFINE_PROPERTY_REF(PROP_COMPOUND_SHAPE_URL, CompoundShapeURL, compoundShapeURL, QString);
|
||||
DEFINE_PROPERTY_REF(PROP_REGISTRATION_POINT, RegistrationPoint, registrationPoint, glm::vec3);
|
||||
DEFINE_PROPERTY_REF(PROP_ANGULAR_VELOCITY, AngularVelocity, angularVelocity, glm::vec3);
|
||||
DEFINE_PROPERTY(PROP_ANGULAR_DAMPING, AngularDamping, angularDamping, float);
|
||||
DEFINE_PROPERTY(PROP_IGNORE_FOR_COLLISIONS, IgnoreForCollisions, ignoreForCollisions, bool);
|
||||
DEFINE_PROPERTY(PROP_COLLISIONS_WILL_MOVE, CollisionsWillMove, collisionsWillMove, bool);
|
||||
DEFINE_PROPERTY(PROP_IS_SPOTLIGHT, IsSpotlight, isSpotlight, bool);
|
||||
DEFINE_PROPERTY(PROP_INTENSITY, Intensity, intensity, float);
|
||||
DEFINE_PROPERTY(PROP_EXPONENT, Exponent, exponent, float);
|
||||
DEFINE_PROPERTY(PROP_CUTOFF, Cutoff, cutoff, float);
|
||||
DEFINE_PROPERTY(PROP_LOCKED, Locked, locked, bool);
|
||||
DEFINE_PROPERTY_REF(PROP_TEXTURES, Textures, textures, QString);
|
||||
DEFINE_PROPERTY_REF(PROP_USER_DATA, UserData, userData, QString);
|
||||
DEFINE_PROPERTY_REF(PROP_SIMULATION_OWNER, SimulationOwner, simulationOwner, SimulationOwner);
|
||||
DEFINE_PROPERTY_REF(PROP_TEXT, Text, text, QString);
|
||||
DEFINE_PROPERTY(PROP_LINE_HEIGHT, LineHeight, lineHeight, float);
|
||||
DEFINE_PROPERTY_REF(PROP_TEXT_COLOR, TextColor, textColor, xColor);
|
||||
DEFINE_PROPERTY_REF(PROP_BACKGROUND_COLOR, BackgroundColor, backgroundColor, xColor);
|
||||
DEFINE_PROPERTY_REF_ENUM(PROP_SHAPE_TYPE, ShapeType, shapeType, ShapeType);
|
||||
DEFINE_PROPERTY(PROP_MAX_PARTICLES, MaxParticles, maxParticles, quint32);
|
||||
DEFINE_PROPERTY(PROP_LIFESPAN, Lifespan, lifespan, float);
|
||||
DEFINE_PROPERTY(PROP_EMITTING_PARTICLES, IsEmitting, isEmitting, bool);
|
||||
DEFINE_PROPERTY(PROP_EMIT_RATE, EmitRate, emitRate, float);
|
||||
DEFINE_PROPERTY(PROP_EMIT_SPEED, EmitSpeed, emitSpeed, float);
|
||||
DEFINE_PROPERTY(PROP_SPEED_SPREAD, SpeedSpread, speedSpread, float);
|
||||
DEFINE_PROPERTY_REF(PROP_EMIT_ORIENTATION, EmitOrientation, emitOrientation, glm::quat);
|
||||
DEFINE_PROPERTY_REF(PROP_EMIT_DIMENSIONS, EmitDimensions, emitDimensions, glm::vec3);
|
||||
DEFINE_PROPERTY(PROP_EMIT_RADIUS_START, EmitRadiusStart, emitRadiusStart, float);
|
||||
DEFINE_PROPERTY(PROP_POLAR_START, PolarStart, polarStart, float);
|
||||
DEFINE_PROPERTY(PROP_POLAR_FINISH, PolarFinish, polarFinish, float);
|
||||
DEFINE_PROPERTY(PROP_AZIMUTH_START, AzimuthStart, azimuthStart, float);
|
||||
DEFINE_PROPERTY(PROP_AZIMUTH_FINISH, AzimuthFinish, azimuthFinish, float);
|
||||
DEFINE_PROPERTY_REF(PROP_EMIT_ACCELERATION, EmitAcceleration, emitAcceleration, glm::vec3);
|
||||
DEFINE_PROPERTY_REF(PROP_ACCELERATION_SPREAD, AccelerationSpread, accelerationSpread, glm::vec3);
|
||||
DEFINE_PROPERTY(PROP_PARTICLE_RADIUS, ParticleRadius, particleRadius, float);
|
||||
DEFINE_PROPERTY(PROP_RADIUS_SPREAD, RadiusSpread, radiusSpread, float);
|
||||
DEFINE_PROPERTY(PROP_RADIUS_START, RadiusStart, radiusStart, float);
|
||||
DEFINE_PROPERTY(PROP_RADIUS_FINISH, RadiusFinish, radiusFinish, float);
|
||||
DEFINE_PROPERTY_REF(PROP_MARKETPLACE_ID, MarketplaceID, marketplaceID, QString);
|
||||
DEFINE_PROPERTY_REF(PROP_KEYLIGHT_COLOR, KeyLightColor, keyLightColor, xColor);
|
||||
DEFINE_PROPERTY(PROP_KEYLIGHT_INTENSITY, KeyLightIntensity, keyLightIntensity, float);
|
||||
DEFINE_PROPERTY(PROP_KEYLIGHT_AMBIENT_INTENSITY, KeyLightAmbientIntensity, keyLightAmbientIntensity, float);
|
||||
DEFINE_PROPERTY_REF(PROP_KEYLIGHT_DIRECTION, KeyLightDirection, keyLightDirection, glm::vec3);
|
||||
DEFINE_PROPERTY_REF(PROP_VOXEL_VOLUME_SIZE, VoxelVolumeSize, voxelVolumeSize, glm::vec3);
|
||||
DEFINE_PROPERTY_REF(PROP_VOXEL_DATA, VoxelData, voxelData, QByteArray);
|
||||
DEFINE_PROPERTY_REF(PROP_VOXEL_SURFACE_STYLE, VoxelSurfaceStyle, voxelSurfaceStyle, uint16_t);
|
||||
DEFINE_PROPERTY_REF(PROP_NAME, Name, name, QString);
|
||||
DEFINE_PROPERTY_REF_ENUM(PROP_BACKGROUND_MODE, BackgroundMode, backgroundMode, BackgroundMode);
|
||||
DEFINE_PROPERTY(PROP_VISIBLE, Visible, visible, bool, ENTITY_ITEM_DEFAULT_VISIBLE);
|
||||
DEFINE_PROPERTY_REF_WITH_SETTER(PROP_POSITION, Position, position, glm::vec3, ENTITY_ITEM_ZERO_VEC3);
|
||||
DEFINE_PROPERTY_REF(PROP_DIMENSIONS, Dimensions, dimensions, glm::vec3, ENTITY_ITEM_DEFAULT_DIMENSIONS);
|
||||
DEFINE_PROPERTY_REF(PROP_ROTATION, Rotation, rotation, glm::quat, ENTITY_ITEM_DEFAULT_ROTATION);
|
||||
DEFINE_PROPERTY(PROP_DENSITY, Density, density, float, ENTITY_ITEM_DEFAULT_DENSITY);
|
||||
DEFINE_PROPERTY_REF(PROP_VELOCITY, Velocity, velocity, glm::vec3, ENTITY_ITEM_DEFAULT_VELOCITY);
|
||||
DEFINE_PROPERTY_REF(PROP_GRAVITY, Gravity, gravity, glm::vec3, ENTITY_ITEM_DEFAULT_GRAVITY);
|
||||
DEFINE_PROPERTY_REF(PROP_ACCELERATION, Acceleration, acceleration, glm::vec3, ENTITY_ITEM_DEFAULT_ACCELERATION);
|
||||
DEFINE_PROPERTY(PROP_DAMPING, Damping, damping, float, ENTITY_ITEM_DEFAULT_DAMPING);
|
||||
DEFINE_PROPERTY(PROP_RESTITUTION, Restitution, restitution, float, ENTITY_ITEM_DEFAULT_RESTITUTION);
|
||||
DEFINE_PROPERTY(PROP_FRICTION, Friction, friction, float, ENTITY_ITEM_DEFAULT_FRICTION);
|
||||
DEFINE_PROPERTY(PROP_LIFETIME, Lifetime, lifetime, float, ENTITY_ITEM_DEFAULT_LIFETIME);
|
||||
DEFINE_PROPERTY(PROP_CREATED, Created, created, quint64, UNKNOWN_CREATED_TIME);
|
||||
DEFINE_PROPERTY_REF(PROP_SCRIPT, Script, script, QString, ENTITY_ITEM_DEFAULT_SCRIPT);
|
||||
DEFINE_PROPERTY(PROP_SCRIPT_TIMESTAMP, ScriptTimestamp, scriptTimestamp, quint64, ENTITY_ITEM_DEFAULT_SCRIPT_TIMESTAMP);
|
||||
DEFINE_PROPERTY_REF(PROP_COLLISION_SOUND_URL, CollisionSoundURL, collisionSoundURL, QString, ENTITY_ITEM_DEFAULT_COLLISION_SOUND_URL);
|
||||
DEFINE_PROPERTY_REF(PROP_COLOR, Color, color, xColor, ParticleEffectEntityItem::DEFAULT_COLOR);
|
||||
DEFINE_PROPERTY_REF(PROP_COLOR_SPREAD, ColorSpread, colorSpread, xColor, ParticleEffectEntityItem::DEFAULT_COLOR_SPREAD);
|
||||
DEFINE_PROPERTY_REF(PROP_COLOR_START, ColorStart, colorStart, xColor, ParticleEffectEntityItem::DEFAULT_COLOR);
|
||||
DEFINE_PROPERTY_REF(PROP_COLOR_FINISH, ColorFinish, colorFinish, xColor, ParticleEffectEntityItem::DEFAULT_COLOR);
|
||||
DEFINE_PROPERTY(PROP_ALPHA, Alpha, alpha, float, ParticleEffectEntityItem::DEFAULT_ALPHA);
|
||||
DEFINE_PROPERTY(PROP_ALPHA_SPREAD, AlphaSpread, alphaSpread, float, ParticleEffectEntityItem::DEFAULT_ALPHA_SPREAD);
|
||||
DEFINE_PROPERTY(PROP_ALPHA_START, AlphaStart, alphaStart, float, ParticleEffectEntityItem::DEFAULT_ALPHA);
|
||||
DEFINE_PROPERTY(PROP_ALPHA_FINISH, AlphaFinish, alphaFinish, float, ParticleEffectEntityItem::DEFAULT_ALPHA);
|
||||
DEFINE_PROPERTY_REF(PROP_MODEL_URL, ModelURL, modelURL, QString, "");
|
||||
DEFINE_PROPERTY_REF(PROP_COMPOUND_SHAPE_URL, CompoundShapeURL, compoundShapeURL, QString, "");
|
||||
DEFINE_PROPERTY_REF(PROP_REGISTRATION_POINT, RegistrationPoint, registrationPoint, glm::vec3, ENTITY_ITEM_DEFAULT_REGISTRATION_POINT);
|
||||
DEFINE_PROPERTY_REF(PROP_ANGULAR_VELOCITY, AngularVelocity, angularVelocity, glm::vec3, ENTITY_ITEM_DEFAULT_ANGULAR_VELOCITY);
|
||||
DEFINE_PROPERTY(PROP_ANGULAR_DAMPING, AngularDamping, angularDamping, float, ENTITY_ITEM_DEFAULT_ANGULAR_DAMPING);
|
||||
DEFINE_PROPERTY(PROP_IGNORE_FOR_COLLISIONS, IgnoreForCollisions, ignoreForCollisions, bool, ENTITY_ITEM_DEFAULT_IGNORE_FOR_COLLISIONS);
|
||||
DEFINE_PROPERTY(PROP_COLLISIONS_WILL_MOVE, CollisionsWillMove, collisionsWillMove, bool, ENTITY_ITEM_DEFAULT_COLLISIONS_WILL_MOVE);
|
||||
DEFINE_PROPERTY(PROP_IS_SPOTLIGHT, IsSpotlight, isSpotlight, bool, false);
|
||||
DEFINE_PROPERTY(PROP_INTENSITY, Intensity, intensity, float, 1.0f);
|
||||
DEFINE_PROPERTY(PROP_EXPONENT, Exponent, exponent, float, 0.0f);
|
||||
DEFINE_PROPERTY(PROP_CUTOFF, Cutoff, cutoff, float, ENTITY_ITEM_DEFAULT_CUTOFF);
|
||||
DEFINE_PROPERTY(PROP_LOCKED, Locked, locked, bool, ENTITY_ITEM_DEFAULT_LOCKED);
|
||||
DEFINE_PROPERTY_REF(PROP_TEXTURES, Textures, textures, QString, "");
|
||||
DEFINE_PROPERTY_REF(PROP_USER_DATA, UserData, userData, QString, ENTITY_ITEM_DEFAULT_USER_DATA);
|
||||
DEFINE_PROPERTY_REF(PROP_SIMULATION_OWNER, SimulationOwner, simulationOwner, SimulationOwner, SimulationOwner());
|
||||
DEFINE_PROPERTY_REF(PROP_TEXT, Text, text, QString, TextEntityItem::DEFAULT_TEXT);
|
||||
DEFINE_PROPERTY(PROP_LINE_HEIGHT, LineHeight, lineHeight, float, TextEntityItem::DEFAULT_LINE_HEIGHT);
|
||||
DEFINE_PROPERTY_REF(PROP_TEXT_COLOR, TextColor, textColor, xColor, TextEntityItem::DEFAULT_TEXT_COLOR);
|
||||
DEFINE_PROPERTY_REF(PROP_BACKGROUND_COLOR, BackgroundColor, backgroundColor, xColor, TextEntityItem::DEFAULT_BACKGROUND_COLOR);
|
||||
DEFINE_PROPERTY_REF_ENUM(PROP_SHAPE_TYPE, ShapeType, shapeType, ShapeType, SHAPE_TYPE_NONE);
|
||||
DEFINE_PROPERTY(PROP_MAX_PARTICLES, MaxParticles, maxParticles, quint32, ParticleEffectEntityItem::DEFAULT_MAX_PARTICLES);
|
||||
DEFINE_PROPERTY(PROP_LIFESPAN, Lifespan, lifespan, float, ParticleEffectEntityItem::DEFAULT_LIFESPAN);
|
||||
DEFINE_PROPERTY(PROP_EMITTING_PARTICLES, IsEmitting, isEmitting, bool, true);
|
||||
DEFINE_PROPERTY(PROP_EMIT_RATE, EmitRate, emitRate, float, ParticleEffectEntityItem::DEFAULT_EMIT_RATE);
|
||||
DEFINE_PROPERTY(PROP_EMIT_SPEED, EmitSpeed, emitSpeed, float, ParticleEffectEntityItem::DEFAULT_EMIT_SPEED);
|
||||
DEFINE_PROPERTY(PROP_SPEED_SPREAD, SpeedSpread, speedSpread, float, ParticleEffectEntityItem::DEFAULT_SPEED_SPREAD);
|
||||
DEFINE_PROPERTY_REF(PROP_EMIT_ORIENTATION, EmitOrientation, emitOrientation, glm::quat, ParticleEffectEntityItem::DEFAULT_EMIT_ORIENTATION);
|
||||
DEFINE_PROPERTY_REF(PROP_EMIT_DIMENSIONS, EmitDimensions, emitDimensions, glm::vec3, ParticleEffectEntityItem::DEFAULT_EMIT_DIMENSIONS);
|
||||
DEFINE_PROPERTY(PROP_EMIT_RADIUS_START, EmitRadiusStart, emitRadiusStart, float, ParticleEffectEntityItem::DEFAULT_EMIT_RADIUS_START);
|
||||
DEFINE_PROPERTY(PROP_POLAR_START, PolarStart, polarStart, float, ParticleEffectEntityItem::DEFAULT_POLAR_START);
|
||||
DEFINE_PROPERTY(PROP_POLAR_FINISH, PolarFinish, polarFinish, float, ParticleEffectEntityItem::DEFAULT_POLAR_FINISH);
|
||||
DEFINE_PROPERTY(PROP_AZIMUTH_START, AzimuthStart, azimuthStart, float, ParticleEffectEntityItem::DEFAULT_AZIMUTH_START);
|
||||
DEFINE_PROPERTY(PROP_AZIMUTH_FINISH, AzimuthFinish, azimuthFinish, float, ParticleEffectEntityItem::DEFAULT_AZIMUTH_FINISH);
|
||||
DEFINE_PROPERTY_REF(PROP_EMIT_ACCELERATION, EmitAcceleration, emitAcceleration, glm::vec3, ParticleEffectEntityItem::DEFAULT_EMIT_ACCELERATION);
|
||||
DEFINE_PROPERTY_REF(PROP_ACCELERATION_SPREAD, AccelerationSpread, accelerationSpread, glm::vec3, ParticleEffectEntityItem::DEFAULT_ACCELERATION_SPREAD);
|
||||
DEFINE_PROPERTY(PROP_PARTICLE_RADIUS, ParticleRadius, particleRadius, float, ParticleEffectEntityItem::DEFAULT_PARTICLE_RADIUS);
|
||||
DEFINE_PROPERTY(PROP_RADIUS_SPREAD, RadiusSpread, radiusSpread, float, ParticleEffectEntityItem::DEFAULT_RADIUS_SPREAD);
|
||||
DEFINE_PROPERTY(PROP_RADIUS_START, RadiusStart, radiusStart, float, ParticleEffectEntityItem::DEFAULT_RADIUS_START);
|
||||
DEFINE_PROPERTY(PROP_RADIUS_FINISH, RadiusFinish, radiusFinish, float, ParticleEffectEntityItem::DEFAULT_RADIUS_FINISH);
|
||||
DEFINE_PROPERTY_REF(PROP_MARKETPLACE_ID, MarketplaceID, marketplaceID, QString, ENTITY_ITEM_DEFAULT_MARKETPLACE_ID);
|
||||
DEFINE_PROPERTY_REF(PROP_KEYLIGHT_COLOR, KeyLightColor, keyLightColor, xColor, ZoneEntityItem::DEFAULT_KEYLIGHT_COLOR);
|
||||
DEFINE_PROPERTY(PROP_KEYLIGHT_INTENSITY, KeyLightIntensity, keyLightIntensity, float, ZoneEntityItem::DEFAULT_KEYLIGHT_INTENSITY);
|
||||
DEFINE_PROPERTY(PROP_KEYLIGHT_AMBIENT_INTENSITY, KeyLightAmbientIntensity, keyLightAmbientIntensity, float, ZoneEntityItem::DEFAULT_KEYLIGHT_AMBIENT_INTENSITY);
|
||||
DEFINE_PROPERTY_REF(PROP_KEYLIGHT_DIRECTION, KeyLightDirection, keyLightDirection, glm::vec3, ZoneEntityItem::DEFAULT_KEYLIGHT_DIRECTION);
|
||||
DEFINE_PROPERTY_REF(PROP_VOXEL_VOLUME_SIZE, VoxelVolumeSize, voxelVolumeSize, glm::vec3, PolyVoxEntityItem::DEFAULT_VOXEL_VOLUME_SIZE);
|
||||
DEFINE_PROPERTY_REF(PROP_VOXEL_DATA, VoxelData, voxelData, QByteArray, PolyVoxEntityItem::DEFAULT_VOXEL_DATA);
|
||||
DEFINE_PROPERTY_REF(PROP_VOXEL_SURFACE_STYLE, VoxelSurfaceStyle, voxelSurfaceStyle, uint16_t, PolyVoxEntityItem::DEFAULT_VOXEL_SURFACE_STYLE);
|
||||
DEFINE_PROPERTY_REF(PROP_NAME, Name, name, QString, ENTITY_ITEM_DEFAULT_NAME);
|
||||
DEFINE_PROPERTY_REF_ENUM(PROP_BACKGROUND_MODE, BackgroundMode, backgroundMode, BackgroundMode, BACKGROUND_MODE_INHERIT);
|
||||
DEFINE_PROPERTY_GROUP(Stage, stage, StagePropertyGroup);
|
||||
DEFINE_PROPERTY_GROUP(Atmosphere, atmosphere, AtmospherePropertyGroup);
|
||||
DEFINE_PROPERTY_GROUP(Skybox, skybox, SkyboxPropertyGroup);
|
||||
DEFINE_PROPERTY_GROUP(Animation, animation, AnimationPropertyGroup);
|
||||
DEFINE_PROPERTY_REF(PROP_SOURCE_URL, SourceUrl, sourceUrl, QString);
|
||||
DEFINE_PROPERTY(PROP_LINE_WIDTH, LineWidth, lineWidth, float);
|
||||
DEFINE_PROPERTY_REF(LINE_POINTS, LinePoints, linePoints, QVector<glm::vec3>);
|
||||
DEFINE_PROPERTY_REF(PROP_HREF, Href, href, QString);
|
||||
DEFINE_PROPERTY_REF(PROP_DESCRIPTION, Description, description, QString);
|
||||
DEFINE_PROPERTY(PROP_FACE_CAMERA, FaceCamera, faceCamera, bool);
|
||||
DEFINE_PROPERTY_REF(PROP_ACTION_DATA, ActionData, actionData, QByteArray);
|
||||
DEFINE_PROPERTY(PROP_NORMALS, Normals, normals, QVector<glm::vec3>);
|
||||
DEFINE_PROPERTY(PROP_STROKE_WIDTHS, StrokeWidths, strokeWidths, QVector<float>);
|
||||
DEFINE_PROPERTY_REF(PROP_X_TEXTURE_URL, XTextureURL, xTextureURL, QString);
|
||||
DEFINE_PROPERTY_REF(PROP_Y_TEXTURE_URL, YTextureURL, yTextureURL, QString);
|
||||
DEFINE_PROPERTY_REF(PROP_Z_TEXTURE_URL, ZTextureURL, zTextureURL, QString);
|
||||
DEFINE_PROPERTY_REF(PROP_X_N_NEIGHBOR_ID, XNNeighborID, xNNeighborID, EntityItemID);
|
||||
DEFINE_PROPERTY_REF(PROP_Y_N_NEIGHBOR_ID, YNNeighborID, yNNeighborID, EntityItemID);
|
||||
DEFINE_PROPERTY_REF(PROP_Z_N_NEIGHBOR_ID, ZNNeighborID, zNNeighborID, EntityItemID);
|
||||
DEFINE_PROPERTY_REF(PROP_X_P_NEIGHBOR_ID, XPNeighborID, xPNeighborID, EntityItemID);
|
||||
DEFINE_PROPERTY_REF(PROP_Y_P_NEIGHBOR_ID, YPNeighborID, yPNeighborID, EntityItemID);
|
||||
DEFINE_PROPERTY_REF(PROP_Z_P_NEIGHBOR_ID, ZPNeighborID, zPNeighborID, EntityItemID);
|
||||
DEFINE_PROPERTY_REF(PROP_SOURCE_URL, SourceUrl, sourceUrl, QString, "");
|
||||
DEFINE_PROPERTY(PROP_LINE_WIDTH, LineWidth, lineWidth, float, LineEntityItem::DEFAULT_LINE_WIDTH);
|
||||
DEFINE_PROPERTY_REF(LINE_POINTS, LinePoints, linePoints, QVector<glm::vec3>, QVector<glm::vec3>());
|
||||
DEFINE_PROPERTY_REF(PROP_HREF, Href, href, QString, "");
|
||||
DEFINE_PROPERTY_REF(PROP_DESCRIPTION, Description, description, QString, "");
|
||||
DEFINE_PROPERTY(PROP_FACE_CAMERA, FaceCamera, faceCamera, bool, TextEntityItem::DEFAULT_FACE_CAMERA);
|
||||
DEFINE_PROPERTY_REF(PROP_ACTION_DATA, ActionData, actionData, QByteArray, QByteArray());
|
||||
DEFINE_PROPERTY(PROP_NORMALS, Normals, normals, QVector<glm::vec3>, QVector<glm::vec3>());
|
||||
DEFINE_PROPERTY(PROP_STROKE_WIDTHS, StrokeWidths, strokeWidths, QVector<float>, QVector<float>());
|
||||
DEFINE_PROPERTY_REF(PROP_X_TEXTURE_URL, XTextureURL, xTextureURL, QString, "");
|
||||
DEFINE_PROPERTY_REF(PROP_Y_TEXTURE_URL, YTextureURL, yTextureURL, QString, "");
|
||||
DEFINE_PROPERTY_REF(PROP_Z_TEXTURE_URL, ZTextureURL, zTextureURL, QString, "");
|
||||
DEFINE_PROPERTY_REF(PROP_X_N_NEIGHBOR_ID, XNNeighborID, xNNeighborID, EntityItemID, UNKNOWN_ENTITY_ID);
|
||||
DEFINE_PROPERTY_REF(PROP_Y_N_NEIGHBOR_ID, YNNeighborID, yNNeighborID, EntityItemID, UNKNOWN_ENTITY_ID);
|
||||
DEFINE_PROPERTY_REF(PROP_Z_N_NEIGHBOR_ID, ZNNeighborID, zNNeighborID, EntityItemID, UNKNOWN_ENTITY_ID);
|
||||
DEFINE_PROPERTY_REF(PROP_X_P_NEIGHBOR_ID, XPNeighborID, xPNeighborID, EntityItemID, UNKNOWN_ENTITY_ID);
|
||||
DEFINE_PROPERTY_REF(PROP_Y_P_NEIGHBOR_ID, YPNeighborID, yPNeighborID, EntityItemID, UNKNOWN_ENTITY_ID);
|
||||
DEFINE_PROPERTY_REF(PROP_Z_P_NEIGHBOR_ID, ZPNeighborID, zPNeighborID, EntityItemID, UNKNOWN_ENTITY_ID);
|
||||
|
||||
static QString getBackgroundModeString(BackgroundMode mode);
|
||||
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
#include <NumericalConstants.h>
|
||||
|
||||
// There is a minor performance gain when comparing/copying an existing glm::vec3 rather than
|
||||
// creating a new one on the stack so we declare the ZERO_VEC3 constant as an optimization.
|
||||
const glm::vec3 ENTITY_ITEM_ZERO_VEC3 = glm::vec3(0.0f);
|
||||
|
|
|
@ -9,12 +9,14 @@
|
|||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
#include <QDateTime>
|
||||
|
||||
#ifndef hifi_EntityItemPropertiesMacros_h
|
||||
#define hifi_EntityItemPropertiesMacros_h
|
||||
|
||||
#include <QDateTime>
|
||||
|
||||
#include "EntityItemID.h"
|
||||
#include <RegisteredMetaTypes.h>
|
||||
|
||||
#define APPEND_ENTITY_PROPERTY(P,V) \
|
||||
if (requestedProperties.getHasProperty(P)) { \
|
||||
|
@ -329,10 +331,6 @@ inline xColor xColor_convertFromScriptValue(const QScriptValue& v, bool& isValid
|
|||
set##S##FromString(newValue); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define CONSTRUCT_PROPERTY(n, V) \
|
||||
_##n(V), \
|
||||
_##n##Changed(false)
|
||||
|
||||
#define DEFINE_PROPERTY_GROUP(N, n, T) \
|
||||
public: \
|
||||
|
@ -348,57 +346,45 @@ inline xColor xColor_convertFromScriptValue(const QScriptValue& v, bool& isValid
|
|||
#define ADD_GROUP_PROPERTY_TO_MAP(P, G, g, N, n) \
|
||||
_propertyStringsToEnums[#g "." #n] = P;
|
||||
|
||||
#define DEFINE_PROPERTY(P, N, n, T) \
|
||||
#define DEFINE_CORE(N, n, T, V) \
|
||||
public: \
|
||||
bool n##Changed() const { return _##n##Changed; } \
|
||||
void set##N##Changed(bool value) { _##n##Changed = value; } \
|
||||
private: \
|
||||
T _##n = V; \
|
||||
bool _##n##Changed { false };
|
||||
|
||||
#define DEFINE_PROPERTY(P, N, n, T, V) \
|
||||
public: \
|
||||
T get##N() const { return _##n; } \
|
||||
void set##N(T value) { _##n = value; _##n##Changed = true; } \
|
||||
bool n##Changed() const { return _##n##Changed; } \
|
||||
void set##N##Changed(bool value) { _##n##Changed = value; } \
|
||||
private: \
|
||||
T _##n; \
|
||||
bool _##n##Changed = false;
|
||||
DEFINE_CORE(N, n, T, V)
|
||||
|
||||
#define DEFINE_PROPERTY_REF(P, N, n, T) \
|
||||
#define DEFINE_PROPERTY_REF(P, N, n, T, V) \
|
||||
public: \
|
||||
const T& get##N() const { return _##n; } \
|
||||
void set##N(const T& value) { _##n = value; _##n##Changed = true; } \
|
||||
bool n##Changed() const { return _##n##Changed; } \
|
||||
void set##N##Changed(bool value) { _##n##Changed = value; } \
|
||||
private: \
|
||||
T _##n; \
|
||||
bool _##n##Changed = false;
|
||||
DEFINE_CORE(N, n, T, V)
|
||||
|
||||
#define DEFINE_PROPERTY_REF_WITH_SETTER(P, N, n, T) \
|
||||
#define DEFINE_PROPERTY_REF_WITH_SETTER(P, N, n, T, V) \
|
||||
public: \
|
||||
const T& get##N() const { return _##n; } \
|
||||
void set##N(const T& value); \
|
||||
bool n##Changed() const; \
|
||||
void set##N##Changed(bool value) { _##n##Changed = value; } \
|
||||
private: \
|
||||
T _##n; \
|
||||
bool _##n##Changed;
|
||||
DEFINE_CORE(N, n, T, V)
|
||||
|
||||
#define DEFINE_PROPERTY_REF_WITH_SETTER_AND_GETTER(P, N, n, T) \
|
||||
#define DEFINE_PROPERTY_REF_WITH_SETTER_AND_GETTER(P, N, n, T, V) \
|
||||
public: \
|
||||
T get##N() const; \
|
||||
void set##N(const T& value); \
|
||||
bool n##Changed() const; \
|
||||
void set##N##Changed(bool value) { _##n##Changed = value; } \
|
||||
private: \
|
||||
T _##n; \
|
||||
bool _##n##Changed;
|
||||
DEFINE_CORE(N, n, T, V)
|
||||
|
||||
#define DEFINE_PROPERTY_REF_ENUM(P, N, n, T) \
|
||||
#define DEFINE_PROPERTY_REF_ENUM(P, N, n, T, V) \
|
||||
public: \
|
||||
const T& get##N() const { return _##n; } \
|
||||
void set##N(const T& value) { _##n = value; _##n##Changed = true; } \
|
||||
bool n##Changed() const { return _##n##Changed; } \
|
||||
QString get##N##AsString() const; \
|
||||
void set##N##FromString(const QString& name); \
|
||||
void set##N##Changed(bool value) { _##n##Changed = value; } \
|
||||
private: \
|
||||
T _##n; \
|
||||
bool _##n##Changed;
|
||||
DEFINE_CORE(N, n, T, V)
|
||||
|
||||
#define DEBUG_PROPERTY(D, P, N, n, x) \
|
||||
D << " " << #n << ":" << P.get##N() << x << "[changed:" << P.n##Changed() << "]\n";
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
#include "EntityEditPacketSender.h"
|
||||
#include "EntitiesScriptEngineProvider.h"
|
||||
|
||||
#include "EntityItemProperties.h"
|
||||
|
||||
class EntityTree;
|
||||
class MouseEvent;
|
||||
|
|
|
@ -14,8 +14,9 @@
|
|||
#include <FBXReader.h>
|
||||
#include <GeometryUtil.h>
|
||||
|
||||
#include "EntityTree.h"
|
||||
#include "EntitiesLogging.h"
|
||||
#include "EntityItemProperties.h"
|
||||
#include "EntityTree.h"
|
||||
#include "EntityTreeElement.h"
|
||||
|
||||
EntityTreeElement::EntityTreeElement(unsigned char* octalCode) : OctreeElement() {
|
||||
|
|
|
@ -88,9 +88,7 @@ EntityItemPointer EntityTypes::constructEntityItem(EntityType entityType, const
|
|||
factory = _factories[entityType];
|
||||
}
|
||||
if (factory) {
|
||||
EntityItemProperties mutableProperties = properties;
|
||||
mutableProperties.markAllChanged();
|
||||
newEntityItem = factory(entityID, mutableProperties);
|
||||
newEntityItem = factory(entityID, properties);
|
||||
}
|
||||
return newEntityItem;
|
||||
}
|
||||
|
|
|
@ -14,10 +14,11 @@
|
|||
|
||||
#include <ByteCountCoding.h>
|
||||
|
||||
#include "EntitiesLogging.h"
|
||||
#include "EntityItemID.h"
|
||||
#include "EntityItemProperties.h"
|
||||
#include "EntityTree.h"
|
||||
#include "EntityTreeElement.h"
|
||||
#include "EntitiesLogging.h"
|
||||
#include "LightEntityItem.h"
|
||||
|
||||
bool LightEntityItem::_lightsArePickable = false;
|
||||
|
|
|
@ -9,19 +9,18 @@
|
|||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
#include "LineEntityItem.h"
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
#include <ByteCountCoding.h>
|
||||
|
||||
#include "LineEntityItem.h"
|
||||
#include "EntityTree.h"
|
||||
#include "EntitiesLogging.h"
|
||||
#include "EntityItemProperties.h"
|
||||
#include "EntityTree.h"
|
||||
#include "EntityTreeElement.h"
|
||||
#include "OctreeConstants.h"
|
||||
|
||||
|
||||
|
||||
const float LineEntityItem::DEFAULT_LINE_WIDTH = 2.0f;
|
||||
const int LineEntityItem::MAX_POINTS_PER_LINE = 70;
|
||||
|
||||
|
|
|
@ -14,9 +14,10 @@
|
|||
#include <ByteCountCoding.h>
|
||||
#include <GLMHelpers.h>
|
||||
|
||||
#include "EntitiesLogging.h"
|
||||
#include "EntityItemProperties.h"
|
||||
#include "EntityTree.h"
|
||||
#include "EntityTreeElement.h"
|
||||
#include "EntitiesLogging.h"
|
||||
#include "ResourceCache.h"
|
||||
#include "ModelEntityItem.h"
|
||||
|
||||
|
@ -264,7 +265,7 @@ bool ModelEntityItem::isAnimatingSomething() const {
|
|||
}
|
||||
|
||||
bool ModelEntityItem::needsToCallUpdate() const {
|
||||
return isAnimatingSomething() ? true : EntityItem::needsToCallUpdate();
|
||||
return isAnimatingSomething() || EntityItem::needsToCallUpdate();
|
||||
}
|
||||
|
||||
void ModelEntityItem::update(const quint64& now) {
|
||||
|
|
|
@ -14,7 +14,8 @@
|
|||
|
||||
#include <AnimationLoop.h>
|
||||
|
||||
#include "EntityItem.h"
|
||||
#include "EntityItem.h"
|
||||
#include "AnimationPropertyGroup.h"
|
||||
|
||||
class ModelEntityItem : public EntityItem {
|
||||
public:
|
||||
|
|
|
@ -104,7 +104,6 @@ EntityItemPointer ParticleEffectEntityItem::factory(const EntityItemID& entityID
|
|||
ParticleEffectEntityItem::ParticleEffectEntityItem(const EntityItemID& entityItemID, const EntityItemProperties& properties) :
|
||||
EntityItem(entityItemID),
|
||||
_lastSimulated(usecTimestampNow()),
|
||||
_isEmitting(true),
|
||||
_particleLifetimes(DEFAULT_MAX_PARTICLES, 0.0f),
|
||||
_particlePositions(DEFAULT_MAX_PARTICLES, glm::vec3(0.0f, 0.0f, 0.0f)),
|
||||
_particleVelocities(DEFAULT_MAX_PARTICLES, glm::vec3(0.0f, 0.0f, 0.0f)),
|
||||
|
|
|
@ -250,7 +250,7 @@ protected:
|
|||
|
||||
|
||||
quint64 _lastSimulated;
|
||||
bool _isEmitting;
|
||||
bool _isEmitting = true;
|
||||
|
||||
QString _textures = DEFAULT_TEXTURES;
|
||||
bool _texturesChangedFlag = false;
|
||||
|
|
|
@ -14,13 +14,12 @@
|
|||
|
||||
#include <ByteCountCoding.h>
|
||||
|
||||
#include "PolyLineEntityItem.h"
|
||||
#include "EntityTree.h"
|
||||
#include "EntitiesLogging.h"
|
||||
#include "EntityItemProperties.h"
|
||||
#include "EntityTree.h"
|
||||
#include "EntityTreeElement.h"
|
||||
#include "OctreeConstants.h"
|
||||
|
||||
|
||||
#include "PolyLineEntityItem.h"
|
||||
|
||||
const float PolyLineEntityItem::DEFAULT_LINE_WIDTH = 0.1f;
|
||||
const int PolyLineEntityItem::MAX_POINTS_PER_LINE = 70;
|
||||
|
|
|
@ -16,11 +16,11 @@
|
|||
|
||||
#include <ByteCountCoding.h>
|
||||
|
||||
#include "PolyVoxEntityItem.h"
|
||||
#include "EntityTree.h"
|
||||
#include "EntitiesLogging.h"
|
||||
#include "EntityItemProperties.h"
|
||||
#include "EntityTree.h"
|
||||
#include "EntityTreeElement.h"
|
||||
|
||||
#include "PolyVoxEntityItem.h"
|
||||
|
||||
const glm::vec3 PolyVoxEntityItem::DEFAULT_VOXEL_VOLUME_SIZE = glm::vec3(32, 32, 32);
|
||||
const float PolyVoxEntityItem::MAX_VOXEL_DIMENSION = 128.0f;
|
||||
|
|
|
@ -51,8 +51,7 @@ class ReadBitstreamToTreeParams;
|
|||
|
||||
class PropertyGroup {
|
||||
public:
|
||||
PropertyGroup() {}
|
||||
virtual ~PropertyGroup() {}
|
||||
virtual ~PropertyGroup() = default;
|
||||
|
||||
// EntityItemProperty related helpers
|
||||
virtual void copyToScriptValue(const EntityPropertyFlags& desiredProperties, QScriptValue& properties, QScriptEngine* engine, bool skipDefaults, EntityItemProperties& defaultEntityProperties) const = 0;
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
#include "RecurseOctreeToMapOperator.h"
|
||||
|
||||
#include "EntityItemProperties.h"
|
||||
|
||||
RecurseOctreeToMapOperator::RecurseOctreeToMapOperator(QVariantMap& map,
|
||||
OctreeElementPointer top,
|
||||
|
|
|
@ -15,10 +15,7 @@
|
|||
#include "EntityItemProperties.h"
|
||||
#include "EntityItemPropertiesMacros.h"
|
||||
|
||||
SkyboxPropertyGroup::SkyboxPropertyGroup() {
|
||||
_color.red = _color.green = _color.blue = 0;
|
||||
_url = QString();
|
||||
}
|
||||
const xColor SkyboxPropertyGroup::DEFAULT_COLOR = { 0, 0, 0 };
|
||||
|
||||
void SkyboxPropertyGroup::copyToScriptValue(const EntityPropertyFlags& desiredProperties, QScriptValue& properties, QScriptEngine* engine, bool skipDefaults, EntityItemProperties& defaultEntityProperties) const {
|
||||
COPY_GROUP_PROPERTY_TO_QSCRIPTVALUE(PROP_SKYBOX_COLOR, Skybox, skybox, Color, color);
|
||||
|
|
|
@ -12,6 +12,10 @@
|
|||
#ifndef hifi_SkyboxPropertyGroup_h
|
||||
#define hifi_SkyboxPropertyGroup_h
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
#include <QtScript/QScriptEngine>
|
||||
|
||||
#include "PropertyGroup.h"
|
||||
|
@ -23,15 +27,8 @@ class OctreePacketData;
|
|||
class EntityTreeElementExtraEncodeData;
|
||||
class ReadBitstreamToTreeParams;
|
||||
|
||||
#include <stdint.h>
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
|
||||
class SkyboxPropertyGroup : public PropertyGroup {
|
||||
public:
|
||||
SkyboxPropertyGroup();
|
||||
virtual ~SkyboxPropertyGroup() {}
|
||||
|
||||
// EntityItemProperty related helpers
|
||||
virtual void copyToScriptValue(const EntityPropertyFlags& desiredProperties, QScriptValue& properties, QScriptEngine* engine, bool skipDefaults, EntityItemProperties& defaultEntityProperties) const;
|
||||
virtual void copyFromScriptValue(const QScriptValue& object, bool& _defaultSettings);
|
||||
|
@ -78,9 +75,9 @@ public:
|
|||
return color;
|
||||
}
|
||||
|
||||
|
||||
DEFINE_PROPERTY_REF(PROP_SKYBOX_COLOR, Color, color, xColor);
|
||||
DEFINE_PROPERTY_REF(PROP_SKYBOX_URL, URL, url, QString);
|
||||
static const xColor DEFAULT_COLOR;
|
||||
DEFINE_PROPERTY_REF(PROP_SKYBOX_COLOR, Color, color, xColor, DEFAULT_COLOR);
|
||||
DEFINE_PROPERTY_REF(PROP_SKYBOX_URL, URL, url, QString, "");
|
||||
};
|
||||
|
||||
#endif // hifi_SkyboxPropertyGroup_h
|
||||
|
|
|
@ -17,12 +17,12 @@
|
|||
#include <ByteCountCoding.h>
|
||||
#include <GeometryUtil.h>
|
||||
|
||||
#include "EntitiesLogging.h"
|
||||
#include "EntityItemProperties.h"
|
||||
#include "EntityTree.h"
|
||||
#include "EntityTreeElement.h"
|
||||
#include "EntitiesLogging.h"
|
||||
#include "SphereEntityItem.h"
|
||||
|
||||
|
||||
EntityItemPointer SphereEntityItem::factory(const EntityItemID& entityID, const EntityItemProperties& properties) {
|
||||
EntityItemPointer result { new SphereEntityItem(entityID, properties) };
|
||||
return result;
|
||||
|
|
|
@ -26,16 +26,6 @@ const float StagePropertyGroup::DEFAULT_STAGE_ALTITUDE = 0.03f;
|
|||
const quint16 StagePropertyGroup::DEFAULT_STAGE_DAY = 60;
|
||||
const float StagePropertyGroup::DEFAULT_STAGE_HOUR = 12.0f;
|
||||
|
||||
StagePropertyGroup::StagePropertyGroup() {
|
||||
_sunModelEnabled = DEFAULT_STAGE_SUN_MODEL_ENABLED;
|
||||
_latitude = DEFAULT_STAGE_LATITUDE;
|
||||
_longitude = DEFAULT_STAGE_LONGITUDE;
|
||||
_altitude = DEFAULT_STAGE_ALTITUDE;
|
||||
_day = DEFAULT_STAGE_DAY;
|
||||
_hour = DEFAULT_STAGE_HOUR;
|
||||
_automaticHourDay = false;
|
||||
}
|
||||
|
||||
void StagePropertyGroup::copyToScriptValue(const EntityPropertyFlags& desiredProperties, QScriptValue& properties, QScriptEngine* engine, bool skipDefaults, EntityItemProperties& defaultEntityProperties) const {
|
||||
COPY_GROUP_PROPERTY_TO_QSCRIPTVALUE(PROP_STAGE_SUN_MODEL_ENABLED, Stage, stage, SunModelEnabled, sunModelEnabled);
|
||||
COPY_GROUP_PROPERTY_TO_QSCRIPTVALUE(PROP_STAGE_LATITUDE, Stage, stage, Latitude, latitude);
|
||||
|
|
|
@ -29,9 +29,6 @@ class ReadBitstreamToTreeParams;
|
|||
|
||||
class StagePropertyGroup : public PropertyGroup {
|
||||
public:
|
||||
StagePropertyGroup();
|
||||
virtual ~StagePropertyGroup() {}
|
||||
|
||||
// EntityItemProperty related helpers
|
||||
virtual void copyToScriptValue(const EntityPropertyFlags& desiredProperties, QScriptValue& properties, QScriptEngine* engine, bool skipDefaults, EntityItemProperties& defaultEntityProperties) const;
|
||||
virtual void copyFromScriptValue(const QScriptValue& object, bool& _defaultSettings);
|
||||
|
@ -79,14 +76,14 @@ public:
|
|||
|
||||
float calculateHour() const;
|
||||
uint16_t calculateDay() const;
|
||||
|
||||
DEFINE_PROPERTY(PROP_STAGE_SUN_MODEL_ENABLED, SunModelEnabled, sunModelEnabled, bool);
|
||||
DEFINE_PROPERTY(PROP_STAGE_LATITUDE, Latitude, latitude, float);
|
||||
DEFINE_PROPERTY(PROP_STAGE_LONGITUDE, Longitude, longitude, float);
|
||||
DEFINE_PROPERTY(PROP_STAGE_ALTITUDE, Altitude, altitude, float);
|
||||
DEFINE_PROPERTY(PROP_STAGE_DAY, Day, day, uint16_t);
|
||||
DEFINE_PROPERTY(PROP_STAGE_HOUR, Hour, hour, float);
|
||||
DEFINE_PROPERTY(PROP_STAGE_AUTOMATIC_HOURDAY, AutomaticHourDay, automaticHourDay, bool);
|
||||
|
||||
DEFINE_PROPERTY(PROP_STAGE_SUN_MODEL_ENABLED, SunModelEnabled, sunModelEnabled, bool, DEFAULT_STAGE_SUN_MODEL_ENABLED);
|
||||
DEFINE_PROPERTY(PROP_STAGE_LATITUDE, Latitude, latitude, float, DEFAULT_STAGE_LATITUDE);
|
||||
DEFINE_PROPERTY(PROP_STAGE_LONGITUDE, Longitude, longitude, float, DEFAULT_STAGE_LONGITUDE);
|
||||
DEFINE_PROPERTY(PROP_STAGE_ALTITUDE, Altitude, altitude, float, DEFAULT_STAGE_ALTITUDE);
|
||||
DEFINE_PROPERTY(PROP_STAGE_DAY, Day, day, uint16_t, DEFAULT_STAGE_DAY);
|
||||
DEFINE_PROPERTY(PROP_STAGE_HOUR, Hour, hour, float, DEFAULT_STAGE_HOUR);
|
||||
DEFINE_PROPERTY(PROP_STAGE_AUTOMATIC_HOURDAY, AutomaticHourDay, automaticHourDay, bool, false);
|
||||
};
|
||||
|
||||
#endif // hifi_StagePropertyGroup_h
|
||||
|
|
|
@ -17,12 +17,12 @@
|
|||
#include <ByteCountCoding.h>
|
||||
#include <GeometryUtil.h>
|
||||
|
||||
#include "EntityItemProperties.h"
|
||||
#include "EntitiesLogging.h"
|
||||
#include "EntityTree.h"
|
||||
#include "EntityTreeElement.h"
|
||||
#include "EntitiesLogging.h"
|
||||
#include "TextEntityItem.h"
|
||||
|
||||
|
||||
const QString TextEntityItem::DEFAULT_TEXT("");
|
||||
const float TextEntityItem::DEFAULT_LINE_HEIGHT = 0.1f;
|
||||
const xColor TextEntityItem::DEFAULT_TEXT_COLOR = { 255, 255, 255 };
|
||||
|
|
|
@ -9,11 +9,6 @@
|
|||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
#include "EntityItem.h"
|
||||
#include "EntityTree.h"
|
||||
#include "EntityTreeElement.h"
|
||||
#include "EntitiesLogging.h"
|
||||
|
||||
#include "UpdateEntityOperator.h"
|
||||
|
||||
UpdateEntityOperator::UpdateEntityOperator(EntityTreePointer tree,
|
||||
|
|
|
@ -12,6 +12,12 @@
|
|||
#ifndef hifi_UpdateEntityOperator_h
|
||||
#define hifi_UpdateEntityOperator_h
|
||||
|
||||
#include "EntitiesLogging.h"
|
||||
#include "EntityItem.h"
|
||||
#include "EntityItemProperties.h"
|
||||
#include "EntityTree.h"
|
||||
#include "EntityTreeElement.h"
|
||||
|
||||
class UpdateEntityOperator : public RecurseOctreeOperator {
|
||||
public:
|
||||
UpdateEntityOperator(EntityTreePointer tree, EntityTreeElementPointer containingElement,
|
||||
|
|
|
@ -15,10 +15,10 @@
|
|||
#include <ByteCountCoding.h>
|
||||
#include <GeometryUtil.h>
|
||||
|
||||
#include "EntitiesLogging.h"
|
||||
#include "EntityItemProperties.h"
|
||||
#include "EntityTree.h"
|
||||
#include "EntityTreeElement.h"
|
||||
#include "EntitiesLogging.h"
|
||||
|
||||
|
||||
const QString WebEntityItem::DEFAULT_SOURCE_URL("http://www.google.com");
|
||||
|
||||
|
|
|
@ -14,10 +14,11 @@
|
|||
|
||||
#include <ByteCountCoding.h>
|
||||
|
||||
#include "ZoneEntityItem.h"
|
||||
#include "EntityTree.h"
|
||||
#include "EntitiesLogging.h"
|
||||
#include "EntityItemProperties.h"
|
||||
#include "EntityTree.h"
|
||||
#include "EntityTreeElement.h"
|
||||
#include "ZoneEntityItem.h"
|
||||
|
||||
bool ZoneEntityItem::_zonesArePickable = false;
|
||||
bool ZoneEntityItem::_drawZoneBoundaries = false;
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
#include "AtmospherePropertyGroup.h"
|
||||
#include "EntityItem.h"
|
||||
#include "EntityTree.h"
|
||||
#include "SkyboxPropertyGroup.h"
|
||||
#include "StagePropertyGroup.h"
|
||||
|
||||
class ZoneEntityItem : public EntityItem {
|
||||
public:
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
//
|
||||
|
||||
#include <EntityItem.h>
|
||||
#include <EntityItemProperties.h>
|
||||
#include <EntityEditPacketSender.h>
|
||||
#include <PhysicsCollisionGroups.h>
|
||||
|
||||
|
|
|
@ -16,9 +16,10 @@
|
|||
#include <QDir>
|
||||
#include <ByteCountCoding.h>
|
||||
|
||||
#include <PathUtils.h>
|
||||
#include <BoxEntityItem.h>
|
||||
#include <EntityItemProperties.h>
|
||||
#include <Octree.h>
|
||||
#include <PathUtils.h>
|
||||
|
||||
const QString& getTestResourceDir() {
|
||||
static QString dir;
|
||||
|
|
Loading…
Reference in a new issue