mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
more property work
This commit is contained in:
parent
8219e6c4af
commit
b509eed59a
3 changed files with 48 additions and 7 deletions
|
@ -1648,7 +1648,7 @@ function handeMenuEvent(menuItem){
|
|||
array.push({ label: "Velocity X:", value: properties.velocity.x.toFixed(decimals) });
|
||||
array.push({ label: "Velocity Y:", value: properties.velocity.y.toFixed(decimals) });
|
||||
array.push({ label: "Velocity Z:", value: properties.velocity.z.toFixed(decimals) });
|
||||
array.push({ label: "Damping:", value: properties.damping.toFixed(decimals) });
|
||||
array.push({ label: "Damping:", value: properties.damping });
|
||||
|
||||
if (properties.type == "Box") {
|
||||
array.push({ label: "Red:", value: properties.color.red });
|
||||
|
@ -1679,7 +1679,7 @@ function handeMenuEvent(menuItem){
|
|||
properties.velocity.x = array[index++].value;
|
||||
properties.velocity.y = array[index++].value;
|
||||
properties.velocity.z = array[index++].value;
|
||||
properties.damping = array[index++].value / 2;
|
||||
properties.damping = array[index++].value;
|
||||
|
||||
if (properties.type == "Box") {
|
||||
properties.color.red = array[index++].value;
|
||||
|
|
|
@ -85,11 +85,8 @@ void BoxEntityItem::setProperties(const EntityItemProperties& properties, bool f
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
int BoxEntityItem::readEntityDataFromBuffer(const unsigned char* data, int bytesLeftToRead, ReadBitstreamToTreeParams& args) {
|
||||
|
||||
|
||||
qDebug() << "BoxEntityItem::readEntityDataFromBuffer()... <<<<<<<<<<<<<<<< <<<<<<<<<<<<<<<<<<<<<<<<<";
|
||||
|
||||
// Header bytes
|
||||
|
|
|
@ -483,8 +483,6 @@ void EntityItem::copyChangedProperties(const EntityItem& other) {
|
|||
|
||||
EntityItemProperties EntityItem::getProperties() const {
|
||||
EntityItemProperties properties;
|
||||
//properties.copyFromEntityItem(*this);
|
||||
|
||||
|
||||
properties._id = getID();
|
||||
properties._idSet = true;
|
||||
|
@ -496,10 +494,23 @@ EntityItemProperties EntityItem::getProperties() const {
|
|||
properties._rotation = getRotation();
|
||||
properties._shouldBeDeleted = getShouldBeDeleted();
|
||||
|
||||
properties._mass = getMass();
|
||||
properties._velocity = getVelocity() * (float) TREE_SCALE;
|
||||
properties._gravity = getGravity() * (float) TREE_SCALE;
|
||||
properties._damping = getDamping();
|
||||
properties._lifetime = getLifetime();
|
||||
properties._script = getScript();
|
||||
|
||||
properties._positionChanged = false;
|
||||
properties._radiusChanged = false;
|
||||
properties._rotationChanged = false;
|
||||
properties._shouldBeDeletedChanged = false;
|
||||
properties._massChanged = false;
|
||||
properties._velocityChanged = false;
|
||||
properties._gravityChanged = false;
|
||||
properties._dampingChanged = false;
|
||||
properties._lifetimeChanged = false;
|
||||
properties._scriptChanged = false;
|
||||
|
||||
properties._defaultSettings = false;
|
||||
|
||||
|
@ -528,6 +539,39 @@ void EntityItem::setProperties(const EntityItemProperties& properties, bool forc
|
|||
somethingChanged = true;
|
||||
}
|
||||
|
||||
if (properties._massChanged || forceCopy) {
|
||||
setMass(properties._mass);
|
||||
somethingChanged = true;
|
||||
}
|
||||
|
||||
if (properties._velocityChanged || forceCopy) {
|
||||
setVelocity(properties._velocity / (float) TREE_SCALE);
|
||||
somethingChanged = true;
|
||||
}
|
||||
|
||||
if (properties._massChanged || forceCopy) {
|
||||
setMass(properties._mass);
|
||||
somethingChanged = true;
|
||||
}
|
||||
if (properties._gravityChanged || forceCopy) {
|
||||
setGravity(properties._gravity / (float) TREE_SCALE);
|
||||
somethingChanged = true;
|
||||
}
|
||||
|
||||
if (properties._dampingChanged || forceCopy) {
|
||||
setDamping(properties._damping);
|
||||
somethingChanged = true;
|
||||
}
|
||||
if (properties._lifetimeChanged || forceCopy) {
|
||||
setLifetime(properties._lifetime);
|
||||
somethingChanged = true;
|
||||
}
|
||||
|
||||
if (properties._scriptChanged || forceCopy) {
|
||||
setScript(properties._script);
|
||||
somethingChanged = true;
|
||||
}
|
||||
|
||||
if (somethingChanged) {
|
||||
bool wantDebug = false;
|
||||
if (wantDebug) {
|
||||
|
|
Loading…
Reference in a new issue