mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 19:52:26 +02:00
fix model scale
This commit is contained in:
parent
f9e5ee0185
commit
544f54e69a
8 changed files with 62 additions and 19 deletions
|
@ -311,7 +311,11 @@ EntityItemProperties Overlays::convertOverlayToEntityProperties(QVariantMap& ove
|
||||||
RENAME_PROP(start, position);
|
RENAME_PROP(start, position);
|
||||||
}
|
}
|
||||||
RENAME_PROP(point, position);
|
RENAME_PROP(point, position);
|
||||||
|
if (type != "Model") {
|
||||||
RENAME_PROP(scale, dimensions);
|
RENAME_PROP(scale, dimensions);
|
||||||
|
} else {
|
||||||
|
RENAME_PROP(scale, modelScale);
|
||||||
|
}
|
||||||
RENAME_PROP(size, dimensions);
|
RENAME_PROP(size, dimensions);
|
||||||
RENAME_PROP(orientation, rotation);
|
RENAME_PROP(orientation, rotation);
|
||||||
RENAME_PROP(localOrientation, localRotation);
|
RENAME_PROP(localOrientation, localRotation);
|
||||||
|
@ -636,7 +640,11 @@ QVariantMap Overlays::convertEntityToOverlayProperties(const EntityItemPropertie
|
||||||
RENAME_PROP(position, start);
|
RENAME_PROP(position, start);
|
||||||
}
|
}
|
||||||
RENAME_PROP(position, point);
|
RENAME_PROP(position, point);
|
||||||
|
if (type != "Model") {
|
||||||
RENAME_PROP(dimensions, scale);
|
RENAME_PROP(dimensions, scale);
|
||||||
|
} else {
|
||||||
|
RENAME_PROP(modelScale, scale);
|
||||||
|
}
|
||||||
RENAME_PROP(dimensions, size);
|
RENAME_PROP(dimensions, size);
|
||||||
RENAME_PROP(ignorePickIntersection, ignoreRayIntersection);
|
RENAME_PROP(ignorePickIntersection, ignoreRayIntersection);
|
||||||
|
|
||||||
|
@ -1718,7 +1726,8 @@ QVector<QUuid> Overlays::findOverlays(const glm::vec3& center, float radius) {
|
||||||
*
|
*
|
||||||
* @property {Vec3} position - The position of the overlay center. Synonyms: <code>p1</code>, <code>point</code>, and
|
* @property {Vec3} position - The position of the overlay center. Synonyms: <code>p1</code>, <code>point</code>, and
|
||||||
* <code>start</code>.
|
* <code>start</code>.
|
||||||
* @property {Vec3} dimensions - The dimensions of the overlay. Synonyms: <code>scale</code>, <code>size</code>.
|
* @property {Vec3} dimensions - The dimensions of the overlay. Synonyms: <code>size</code>.
|
||||||
|
* @property {Vec3} scale - The scale factor applied to the model's dimensions.
|
||||||
* @property {Quat} rotation - The orientation of the overlay. Synonym: <code>orientation</code>.
|
* @property {Quat} rotation - The orientation of the overlay. Synonym: <code>orientation</code>.
|
||||||
* @property {Vec3} localPosition - The local position of the overlay relative to its parent if the overlay has a
|
* @property {Vec3} localPosition - The local position of the overlay relative to its parent if the overlay has a
|
||||||
* <code>parentID</code> set, otherwise the same value as <code>position</code>.
|
* <code>parentID</code> set, otherwise the same value as <code>position</code>.
|
||||||
|
|
|
@ -580,6 +580,7 @@ EntityPropertyFlags EntityItemProperties::getChangedProperties() const {
|
||||||
|
|
||||||
// Model
|
// Model
|
||||||
CHECK_PROPERTY_CHANGE(PROP_MODEL_URL, modelURL);
|
CHECK_PROPERTY_CHANGE(PROP_MODEL_URL, modelURL);
|
||||||
|
CHECK_PROPERTY_CHANGE(PROP_MODEL_SCALE, modelScale);
|
||||||
CHECK_PROPERTY_CHANGE(PROP_JOINT_ROTATIONS_SET, jointRotationsSet);
|
CHECK_PROPERTY_CHANGE(PROP_JOINT_ROTATIONS_SET, jointRotationsSet);
|
||||||
CHECK_PROPERTY_CHANGE(PROP_JOINT_ROTATIONS, jointRotations);
|
CHECK_PROPERTY_CHANGE(PROP_JOINT_ROTATIONS, jointRotations);
|
||||||
CHECK_PROPERTY_CHANGE(PROP_JOINT_TRANSLATIONS_SET, jointTranslationsSet);
|
CHECK_PROPERTY_CHANGE(PROP_JOINT_TRANSLATIONS_SET, jointTranslationsSet);
|
||||||
|
@ -1012,6 +1013,7 @@ EntityPropertyFlags EntityItemProperties::getChangedProperties() const {
|
||||||
* @property {Vec3} dimensions=0.1,0.1,0.1 - The dimensions of the entity. When adding an entity, if no <code>dimensions</code>
|
* @property {Vec3} dimensions=0.1,0.1,0.1 - The dimensions of the entity. When adding an entity, if no <code>dimensions</code>
|
||||||
* value is specified then the model is automatically sized to its
|
* value is specified then the model is automatically sized to its
|
||||||
* <code>{@link Entities.EntityProperties|naturalDimensions}</code>.
|
* <code>{@link Entities.EntityProperties|naturalDimensions}</code>.
|
||||||
|
* @property {Vec3} modelScale - The scale factor applied to the model's dimensions.
|
||||||
* @property {Color} color=255,255,255 - <em>Currently not used.</em>
|
* @property {Color} color=255,255,255 - <em>Currently not used.</em>
|
||||||
* @property {string} modelURL="" - The URL of the FBX of OBJ model. Baked FBX models' URLs end in ".baked.fbx".<br />
|
* @property {string} modelURL="" - The URL of the FBX of OBJ model. Baked FBX models' URLs end in ".baked.fbx".<br />
|
||||||
* @property {string} textures="" - A JSON string of texture name, URL pairs used when rendering the model in place of the
|
* @property {string} textures="" - A JSON string of texture name, URL pairs used when rendering the model in place of the
|
||||||
|
@ -1683,6 +1685,7 @@ QScriptValue EntityItemProperties::copyToScriptValue(QScriptEngine* engine, bool
|
||||||
COPY_PROPERTY_TO_QSCRIPTVALUE(PROP_TEXTURES, textures);
|
COPY_PROPERTY_TO_QSCRIPTVALUE(PROP_TEXTURES, textures);
|
||||||
|
|
||||||
COPY_PROPERTY_TO_QSCRIPTVALUE(PROP_MODEL_URL, modelURL);
|
COPY_PROPERTY_TO_QSCRIPTVALUE(PROP_MODEL_URL, modelURL);
|
||||||
|
COPY_PROPERTY_TO_QSCRIPTVALUE(PROP_MODEL_SCALE, modelScale);
|
||||||
COPY_PROPERTY_TO_QSCRIPTVALUE(PROP_JOINT_ROTATIONS_SET, jointRotationsSet);
|
COPY_PROPERTY_TO_QSCRIPTVALUE(PROP_JOINT_ROTATIONS_SET, jointRotationsSet);
|
||||||
COPY_PROPERTY_TO_QSCRIPTVALUE(PROP_JOINT_ROTATIONS, jointRotations);
|
COPY_PROPERTY_TO_QSCRIPTVALUE(PROP_JOINT_ROTATIONS, jointRotations);
|
||||||
COPY_PROPERTY_TO_QSCRIPTVALUE(PROP_JOINT_TRANSLATIONS_SET, jointTranslationsSet);
|
COPY_PROPERTY_TO_QSCRIPTVALUE(PROP_JOINT_TRANSLATIONS_SET, jointTranslationsSet);
|
||||||
|
@ -2078,6 +2081,7 @@ void EntityItemProperties::copyFromScriptValue(const QScriptValue& object, bool
|
||||||
|
|
||||||
// Model
|
// Model
|
||||||
COPY_PROPERTY_FROM_QSCRIPTVALUE(modelURL, QString, setModelURL);
|
COPY_PROPERTY_FROM_QSCRIPTVALUE(modelURL, QString, setModelURL);
|
||||||
|
COPY_PROPERTY_FROM_QSCRIPTVALUE(modelScale, vec3, setModelScale);
|
||||||
COPY_PROPERTY_FROM_QSCRIPTVALUE(jointRotationsSet, qVectorBool, setJointRotationsSet);
|
COPY_PROPERTY_FROM_QSCRIPTVALUE(jointRotationsSet, qVectorBool, setJointRotationsSet);
|
||||||
COPY_PROPERTY_FROM_QSCRIPTVALUE(jointRotations, qVectorQuat, setJointRotations);
|
COPY_PROPERTY_FROM_QSCRIPTVALUE(jointRotations, qVectorQuat, setJointRotations);
|
||||||
COPY_PROPERTY_FROM_QSCRIPTVALUE(jointTranslationsSet, qVectorBool, setJointTranslationsSet);
|
COPY_PROPERTY_FROM_QSCRIPTVALUE(jointTranslationsSet, qVectorBool, setJointTranslationsSet);
|
||||||
|
@ -2357,6 +2361,7 @@ void EntityItemProperties::merge(const EntityItemProperties& other) {
|
||||||
|
|
||||||
// Model
|
// Model
|
||||||
COPY_PROPERTY_IF_CHANGED(modelURL);
|
COPY_PROPERTY_IF_CHANGED(modelURL);
|
||||||
|
COPY_PROPERTY_IF_CHANGED(modelScale);
|
||||||
COPY_PROPERTY_IF_CHANGED(jointRotationsSet);
|
COPY_PROPERTY_IF_CHANGED(jointRotationsSet);
|
||||||
COPY_PROPERTY_IF_CHANGED(jointRotations);
|
COPY_PROPERTY_IF_CHANGED(jointRotations);
|
||||||
COPY_PROPERTY_IF_CHANGED(jointTranslationsSet);
|
COPY_PROPERTY_IF_CHANGED(jointTranslationsSet);
|
||||||
|
@ -2700,6 +2705,7 @@ bool EntityItemProperties::getPropertyInfo(const QString& propertyName, EntityPr
|
||||||
|
|
||||||
// Model
|
// Model
|
||||||
ADD_PROPERTY_TO_MAP(PROP_MODEL_URL, ModelURL, modelURL, QString);
|
ADD_PROPERTY_TO_MAP(PROP_MODEL_URL, ModelURL, modelURL, QString);
|
||||||
|
ADD_PROPERTY_TO_MAP(PROP_MODEL_SCALE, ModelScale, modelScale, vec3);
|
||||||
ADD_PROPERTY_TO_MAP(PROP_JOINT_ROTATIONS_SET, JointRotationsSet, jointRotationsSet, QVector<bool>);
|
ADD_PROPERTY_TO_MAP(PROP_JOINT_ROTATIONS_SET, JointRotationsSet, jointRotationsSet, QVector<bool>);
|
||||||
ADD_PROPERTY_TO_MAP(PROP_JOINT_ROTATIONS, JointRotations, jointRotations, QVector<quat>);
|
ADD_PROPERTY_TO_MAP(PROP_JOINT_ROTATIONS, JointRotations, jointRotations, QVector<quat>);
|
||||||
ADD_PROPERTY_TO_MAP(PROP_JOINT_TRANSLATIONS_SET, JointTranslationsSet, jointTranslationsSet, QVector<bool>);
|
ADD_PROPERTY_TO_MAP(PROP_JOINT_TRANSLATIONS_SET, JointTranslationsSet, jointTranslationsSet, QVector<bool>);
|
||||||
|
@ -3989,6 +3995,7 @@ void EntityItemProperties::markAllChanged() {
|
||||||
|
|
||||||
// Model
|
// Model
|
||||||
_modelURLChanged = true;
|
_modelURLChanged = true;
|
||||||
|
_modelScaleChanged = true;
|
||||||
_jointRotationsSetChanged = true;
|
_jointRotationsSetChanged = true;
|
||||||
_jointRotationsChanged = true;
|
_jointRotationsChanged = true;
|
||||||
_jointTranslationsSetChanged = true;
|
_jointTranslationsSetChanged = true;
|
||||||
|
@ -4526,6 +4533,9 @@ QList<QString> EntityItemProperties::listChangedProperties() {
|
||||||
if (modelURLChanged()) {
|
if (modelURLChanged()) {
|
||||||
out += "modelURL";
|
out += "modelURL";
|
||||||
}
|
}
|
||||||
|
if (modelScaleChanged()) {
|
||||||
|
out += "scale";
|
||||||
|
}
|
||||||
if (jointRotationsSetChanged()) {
|
if (jointRotationsSetChanged()) {
|
||||||
out += "jointRotationsSet";
|
out += "jointRotationsSet";
|
||||||
}
|
}
|
||||||
|
|
|
@ -279,6 +279,7 @@ public:
|
||||||
|
|
||||||
// Model
|
// Model
|
||||||
DEFINE_PROPERTY_REF(PROP_MODEL_URL, ModelURL, modelURL, QString, "");
|
DEFINE_PROPERTY_REF(PROP_MODEL_URL, ModelURL, modelURL, QString, "");
|
||||||
|
DEFINE_PROPERTY_REF(PROP_MODEL_SCALE, ModelScale, modelScale, glm::vec3, glm::vec3(1.0f));
|
||||||
DEFINE_PROPERTY_REF(PROP_JOINT_ROTATIONS_SET, JointRotationsSet, jointRotationsSet, QVector<bool>, QVector<bool>());
|
DEFINE_PROPERTY_REF(PROP_JOINT_ROTATIONS_SET, JointRotationsSet, jointRotationsSet, QVector<bool>, QVector<bool>());
|
||||||
DEFINE_PROPERTY_REF(PROP_JOINT_ROTATIONS, JointRotations, jointRotations, QVector<glm::quat>, QVector<glm::quat>());
|
DEFINE_PROPERTY_REF(PROP_JOINT_ROTATIONS, JointRotations, jointRotations, QVector<glm::quat>, QVector<glm::quat>());
|
||||||
DEFINE_PROPERTY_REF(PROP_JOINT_TRANSLATIONS_SET, JointTranslationsSet, jointTranslationsSet, QVector<bool>, QVector<bool>());
|
DEFINE_PROPERTY_REF(PROP_JOINT_TRANSLATIONS_SET, JointTranslationsSet, jointTranslationsSet, QVector<bool>, QVector<bool>());
|
||||||
|
|
|
@ -202,22 +202,23 @@ enum EntityPropertyList {
|
||||||
|
|
||||||
// Model
|
// Model
|
||||||
PROP_MODEL_URL = PROP_DERIVED_0,
|
PROP_MODEL_URL = PROP_DERIVED_0,
|
||||||
PROP_JOINT_ROTATIONS_SET = PROP_DERIVED_1,
|
PROP_MODEL_SCALE = PROP_DERIVED_1,
|
||||||
PROP_JOINT_ROTATIONS = PROP_DERIVED_2,
|
PROP_JOINT_ROTATIONS_SET = PROP_DERIVED_2,
|
||||||
PROP_JOINT_TRANSLATIONS_SET = PROP_DERIVED_3,
|
PROP_JOINT_ROTATIONS = PROP_DERIVED_3,
|
||||||
PROP_JOINT_TRANSLATIONS = PROP_DERIVED_4,
|
PROP_JOINT_TRANSLATIONS_SET = PROP_DERIVED_4,
|
||||||
PROP_RELAY_PARENT_JOINTS = PROP_DERIVED_5,
|
PROP_JOINT_TRANSLATIONS = PROP_DERIVED_5,
|
||||||
PROP_GROUP_CULLED = PROP_DERIVED_6,
|
PROP_RELAY_PARENT_JOINTS = PROP_DERIVED_6,
|
||||||
|
PROP_GROUP_CULLED = PROP_DERIVED_7,
|
||||||
// Animation
|
// Animation
|
||||||
PROP_ANIMATION_URL = PROP_DERIVED_7,
|
PROP_ANIMATION_URL = PROP_DERIVED_8,
|
||||||
PROP_ANIMATION_ALLOW_TRANSLATION = PROP_DERIVED_8,
|
PROP_ANIMATION_ALLOW_TRANSLATION = PROP_DERIVED_9,
|
||||||
PROP_ANIMATION_FPS = PROP_DERIVED_9,
|
PROP_ANIMATION_FPS = PROP_DERIVED_10,
|
||||||
PROP_ANIMATION_FRAME_INDEX = PROP_DERIVED_10,
|
PROP_ANIMATION_FRAME_INDEX = PROP_DERIVED_11,
|
||||||
PROP_ANIMATION_PLAYING = PROP_DERIVED_11,
|
PROP_ANIMATION_PLAYING = PROP_DERIVED_12,
|
||||||
PROP_ANIMATION_LOOP = PROP_DERIVED_12,
|
PROP_ANIMATION_LOOP = PROP_DERIVED_13,
|
||||||
PROP_ANIMATION_FIRST_FRAME = PROP_DERIVED_13,
|
PROP_ANIMATION_FIRST_FRAME = PROP_DERIVED_14,
|
||||||
PROP_ANIMATION_LAST_FRAME = PROP_DERIVED_14,
|
PROP_ANIMATION_LAST_FRAME = PROP_DERIVED_15,
|
||||||
PROP_ANIMATION_HOLD = PROP_DERIVED_15,
|
PROP_ANIMATION_HOLD = PROP_DERIVED_16,
|
||||||
|
|
||||||
// Light
|
// Light
|
||||||
PROP_IS_SPOTLIGHT = PROP_DERIVED_0,
|
PROP_IS_SPOTLIGHT = PROP_DERIVED_0,
|
||||||
|
|
|
@ -63,6 +63,7 @@ EntityItemProperties ModelEntityItem::getProperties(const EntityPropertyFlags& d
|
||||||
COPY_ENTITY_PROPERTY_TO_PROPERTIES(textures, getTextures);
|
COPY_ENTITY_PROPERTY_TO_PROPERTIES(textures, getTextures);
|
||||||
|
|
||||||
COPY_ENTITY_PROPERTY_TO_PROPERTIES(modelURL, getModelURL);
|
COPY_ENTITY_PROPERTY_TO_PROPERTIES(modelURL, getModelURL);
|
||||||
|
COPY_ENTITY_PROPERTY_TO_PROPERTIES(modelScale, getModelScale);
|
||||||
COPY_ENTITY_PROPERTY_TO_PROPERTIES(jointRotationsSet, getJointRotationsSet);
|
COPY_ENTITY_PROPERTY_TO_PROPERTIES(jointRotationsSet, getJointRotationsSet);
|
||||||
COPY_ENTITY_PROPERTY_TO_PROPERTIES(jointRotations, getJointRotations);
|
COPY_ENTITY_PROPERTY_TO_PROPERTIES(jointRotations, getJointRotations);
|
||||||
COPY_ENTITY_PROPERTY_TO_PROPERTIES(jointTranslationsSet, getJointTranslationsSet);
|
COPY_ENTITY_PROPERTY_TO_PROPERTIES(jointTranslationsSet, getJointTranslationsSet);
|
||||||
|
@ -85,6 +86,7 @@ bool ModelEntityItem::setProperties(const EntityItemProperties& properties) {
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(textures, setTextures);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(textures, setTextures);
|
||||||
|
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(modelURL, setModelURL);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(modelURL, setModelURL);
|
||||||
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(modelScale, setModelScale);
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(jointRotationsSet, setJointRotationsSet);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(jointRotationsSet, setJointRotationsSet);
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(jointRotations, setJointRotations);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(jointRotations, setJointRotations);
|
||||||
SET_ENTITY_PROPERTY_FROM_PROPERTIES(jointTranslationsSet, setJointTranslationsSet);
|
SET_ENTITY_PROPERTY_FROM_PROPERTIES(jointTranslationsSet, setJointTranslationsSet);
|
||||||
|
@ -128,6 +130,7 @@ int ModelEntityItem::readEntitySubclassDataFromBuffer(const unsigned char* data,
|
||||||
READ_ENTITY_PROPERTY(PROP_TEXTURES, QString, setTextures);
|
READ_ENTITY_PROPERTY(PROP_TEXTURES, QString, setTextures);
|
||||||
|
|
||||||
READ_ENTITY_PROPERTY(PROP_MODEL_URL, QString, setModelURL);
|
READ_ENTITY_PROPERTY(PROP_MODEL_URL, QString, setModelURL);
|
||||||
|
READ_ENTITY_PROPERTY(PROP_MODEL_SCALE, glm::vec3, setModelScale);
|
||||||
READ_ENTITY_PROPERTY(PROP_JOINT_ROTATIONS_SET, QVector<bool>, setJointRotationsSet);
|
READ_ENTITY_PROPERTY(PROP_JOINT_ROTATIONS_SET, QVector<bool>, setJointRotationsSet);
|
||||||
READ_ENTITY_PROPERTY(PROP_JOINT_ROTATIONS, QVector<glm::quat>, setJointRotations);
|
READ_ENTITY_PROPERTY(PROP_JOINT_ROTATIONS, QVector<glm::quat>, setJointRotations);
|
||||||
READ_ENTITY_PROPERTY(PROP_JOINT_TRANSLATIONS_SET, QVector<bool>, setJointTranslationsSet);
|
READ_ENTITY_PROPERTY(PROP_JOINT_TRANSLATIONS_SET, QVector<bool>, setJointTranslationsSet);
|
||||||
|
@ -165,6 +168,7 @@ EntityPropertyFlags ModelEntityItem::getEntityProperties(EncodeBitstreamParams&
|
||||||
requestedProperties += PROP_TEXTURES;
|
requestedProperties += PROP_TEXTURES;
|
||||||
|
|
||||||
requestedProperties += PROP_MODEL_URL;
|
requestedProperties += PROP_MODEL_URL;
|
||||||
|
requestedProperties += PROP_MODEL_SCALE;
|
||||||
requestedProperties += PROP_JOINT_ROTATIONS_SET;
|
requestedProperties += PROP_JOINT_ROTATIONS_SET;
|
||||||
requestedProperties += PROP_JOINT_ROTATIONS;
|
requestedProperties += PROP_JOINT_ROTATIONS;
|
||||||
requestedProperties += PROP_JOINT_TRANSLATIONS_SET;
|
requestedProperties += PROP_JOINT_TRANSLATIONS_SET;
|
||||||
|
@ -192,6 +196,7 @@ void ModelEntityItem::appendSubclassData(OctreePacketData* packetData, EncodeBit
|
||||||
APPEND_ENTITY_PROPERTY(PROP_TEXTURES, getTextures());
|
APPEND_ENTITY_PROPERTY(PROP_TEXTURES, getTextures());
|
||||||
|
|
||||||
APPEND_ENTITY_PROPERTY(PROP_MODEL_URL, getModelURL());
|
APPEND_ENTITY_PROPERTY(PROP_MODEL_URL, getModelURL());
|
||||||
|
APPEND_ENTITY_PROPERTY(PROP_MODEL_SCALE, getModelScale());
|
||||||
APPEND_ENTITY_PROPERTY(PROP_JOINT_ROTATIONS_SET, getJointRotationsSet());
|
APPEND_ENTITY_PROPERTY(PROP_JOINT_ROTATIONS_SET, getJointRotationsSet());
|
||||||
APPEND_ENTITY_PROPERTY(PROP_JOINT_ROTATIONS, getJointRotations());
|
APPEND_ENTITY_PROPERTY(PROP_JOINT_ROTATIONS, getJointRotations());
|
||||||
APPEND_ENTITY_PROPERTY(PROP_JOINT_TRANSLATIONS_SET, getJointTranslationsSet());
|
APPEND_ENTITY_PROPERTY(PROP_JOINT_TRANSLATIONS_SET, getJointTranslationsSet());
|
||||||
|
@ -708,3 +713,15 @@ bool ModelEntityItem::applyNewAnimationProperties(AnimationPropertyGroup newProp
|
||||||
}
|
}
|
||||||
return somethingChanged;
|
return somethingChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
glm::vec3 ModelEntityItem::getModelScale() const {
|
||||||
|
return _modelScaleLock.resultWithReadLock<glm::vec3>([&] {
|
||||||
|
return getSNScale();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void ModelEntityItem::setModelScale(const glm::vec3& modelScale) {
|
||||||
|
_modelScaleLock.withWriteLock([&] {
|
||||||
|
setSNScale(modelScale);
|
||||||
|
});
|
||||||
|
}
|
|
@ -126,6 +126,9 @@ public:
|
||||||
QVector<glm::vec3> getJointTranslations() const;
|
QVector<glm::vec3> getJointTranslations() const;
|
||||||
QVector<bool> getJointTranslationsSet() const;
|
QVector<bool> getJointTranslationsSet() const;
|
||||||
|
|
||||||
|
glm::vec3 getModelScale() const;
|
||||||
|
void setModelScale(const glm::vec3& modelScale);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void setAnimationSettings(const QString& value); // only called for old bitstream format
|
void setAnimationSettings(const QString& value); // only called for old bitstream format
|
||||||
bool applyNewAnimationProperties(AnimationPropertyGroup newProperties);
|
bool applyNewAnimationProperties(AnimationPropertyGroup newProperties);
|
||||||
|
@ -141,6 +144,7 @@ protected:
|
||||||
// they aren't currently updated from data in the model/rig, and they don't have a direct effect
|
// they aren't currently updated from data in the model/rig, and they don't have a direct effect
|
||||||
// on what's rendered.
|
// on what's rendered.
|
||||||
ReadWriteLockable _jointDataLock;
|
ReadWriteLockable _jointDataLock;
|
||||||
|
ReadWriteLockable _modelScaleLock;
|
||||||
|
|
||||||
bool _jointRotationsExplicitlySet { false }; // were the joints set as a property or just side effect of animations
|
bool _jointRotationsExplicitlySet { false }; // were the joints set as a property or just side effect of animations
|
||||||
bool _jointTranslationsExplicitlySet{ false }; // were the joints set as a property or just side effect of animations
|
bool _jointTranslationsExplicitlySet{ false }; // were the joints set as a property or just side effect of animations
|
||||||
|
|
|
@ -262,6 +262,7 @@ enum class EntityVersion : PacketVersion {
|
||||||
RingGizmoEntities,
|
RingGizmoEntities,
|
||||||
ShowKeyboardFocusHighlight,
|
ShowKeyboardFocusHighlight,
|
||||||
WebBillboardMode,
|
WebBillboardMode,
|
||||||
|
ModelScale,
|
||||||
|
|
||||||
// Add new versions above here
|
// Add new versions above here
|
||||||
NUM_PACKET_TYPE,
|
NUM_PACKET_TYPE,
|
||||||
|
|
|
@ -861,7 +861,7 @@ void SpatiallyNestable::setSNScale(const glm::vec3& scale, bool& success) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (success && changed) {
|
if (success && changed) {
|
||||||
locationChanged();
|
dimensionsChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue