mirror of
https://github.com/lubosz/overte.git
synced 2025-08-08 03:08:00 +02:00
don't overwrite physical properties with those from the entity during editEntity -- only set those that the script didn't.
This commit is contained in:
parent
48705d33c5
commit
5f6e608207
2 changed files with 19 additions and 12 deletions
|
@ -1211,11 +1211,21 @@ EntityItemProperties EntityItem::getProperties(EntityPropertyFlags desiredProper
|
||||||
|
|
||||||
void EntityItem::getAllTerseUpdateProperties(EntityItemProperties& properties) const {
|
void EntityItem::getAllTerseUpdateProperties(EntityItemProperties& properties) const {
|
||||||
// a TerseUpdate includes the transform and its derivatives
|
// a TerseUpdate includes the transform and its derivatives
|
||||||
properties._position = getLocalPosition();
|
if (!properties._positionChanged) {
|
||||||
properties._velocity = getLocalVelocity();
|
properties._position = getLocalPosition();
|
||||||
properties._rotation = getLocalOrientation();
|
}
|
||||||
properties._angularVelocity = getLocalAngularVelocity();
|
if (!properties._velocityChanged) {
|
||||||
properties._acceleration = _acceleration;
|
properties._velocity = getLocalVelocity();
|
||||||
|
}
|
||||||
|
if (!properties._rotationChanged) {
|
||||||
|
properties._rotation = getLocalOrientation();
|
||||||
|
}
|
||||||
|
if (!properties._angularVelocityChanged) {
|
||||||
|
properties._angularVelocity = getLocalAngularVelocity();
|
||||||
|
}
|
||||||
|
if (!properties._accelerationChanged) {
|
||||||
|
properties._acceleration = _acceleration;
|
||||||
|
}
|
||||||
|
|
||||||
properties._positionChanged = true;
|
properties._positionChanged = true;
|
||||||
properties._velocityChanged = true;
|
properties._velocityChanged = true;
|
||||||
|
|
|
@ -723,13 +723,10 @@ void EntityTree::fixupTerseEditLogging(EntityItemProperties& properties, QList<Q
|
||||||
int index = changedProperties.indexOf("velocity");
|
int index = changedProperties.indexOf("velocity");
|
||||||
if (index >= 0) {
|
if (index >= 0) {
|
||||||
glm::vec3 value = properties.getVelocity();
|
glm::vec3 value = properties.getVelocity();
|
||||||
QString changeHint = "0";
|
changedProperties[index] = QString("velocity:") +
|
||||||
if (value.x + value.y + value.z > 0) {
|
QString::number((int)value.x) + "," +
|
||||||
changeHint = "+";
|
QString::number((int)value.y) + "," +
|
||||||
} else if (value.x + value.y + value.z < 0) {
|
QString::number((int)value.z);
|
||||||
changeHint = "-";
|
|
||||||
}
|
|
||||||
changedProperties[index] = QString("velocity:") + changeHint;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue