From d4199e6092800672a72b8b977775c6272562d355 Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Wed, 23 Jul 2014 13:59:21 -0700 Subject: [PATCH] Edit properties tweaks --- examples/editModels.js | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/examples/editModels.js b/examples/editModels.js index 458ddf7b4a..6a692394ba 100644 --- a/examples/editModels.js +++ b/examples/editModels.js @@ -748,18 +748,19 @@ function Tooltip() { this.updateText = function(properties) { var angles = Quat.safeEulerAngles(properties.modelRotation); var text = "Model Properties:\n" - text += "x: " + properties.position.x.toFixed(this.decimals) + "\n" - text += "y: " + properties.position.y.toFixed(this.decimals) + "\n" - text += "z: " + properties.position.z.toFixed(this.decimals) + "\n" - text += "pitch: " + angles.x.toFixed(this.decimals) + "\n" - text += "yaw: " + angles.y.toFixed(this.decimals) + "\n" - text += "roll: " + angles.z.toFixed(this.decimals) + "\n" + text += "X: " + properties.position.x.toFixed(this.decimals) + "\n" + text += "Y: " + properties.position.y.toFixed(this.decimals) + "\n" + text += "Z: " + properties.position.z.toFixed(this.decimals) + "\n" + text += "Pitch: " + angles.x.toFixed(this.decimals) + "\n" + text += "Yaw: " + angles.y.toFixed(this.decimals) + "\n" + text += "Roll: " + angles.z.toFixed(this.decimals) + "\n" text += "Scale: " + 2 * properties.radius.toFixed(this.decimals) + "\n" text += "ID: " + properties.id + "\n" - text += "model url: " + properties.modelURL + "\n" - text += "animation url: " + properties.animationURL + "\n" + text += "Model URL: " + properties.modelURL + "\n" + text += "Animation URL: " + properties.animationURL + "\n" + text += "Animation is playing: " + properties.animationIsPlaying + "\n" if (properties.sittingPoints.length > 0) { - text += properties.sittingPoints.length + " sitting points: " + text += properties.sittingPoints.length + " Sitting points: " for (var i = 0; i < properties.sittingPoints.length; ++i) { text += properties.sittingPoints[i].name + " " } @@ -1146,6 +1147,7 @@ function handeMenuEvent(menuItem){ var decimals = 3; array.push({ label: "Model URL:", value: selectedModelProperties.modelURL }); array.push({ label: "Animation URL:", value: selectedModelProperties.animationURL }); + array.push({ label: "Animation is playing:", value: selectedModelProperties.animationIsPlaying }); array.push({ label: "X:", value: selectedModelProperties.position.x.toFixed(decimals) }); array.push({ label: "Y:", value: selectedModelProperties.position.y.toFixed(decimals) }); array.push({ label: "Z:", value: selectedModelProperties.position.z.toFixed(decimals) }); @@ -1158,16 +1160,18 @@ function handeMenuEvent(menuItem){ var propertyName = Window.form("Edit Properties", array); modelSelected = false; - selectedModelProperties.modelURL = array[0].value; - selectedModelProperties.animationURL = array[1].value; - selectedModelProperties.position.x = array[2].value; - selectedModelProperties.position.y = array[3].value; - selectedModelProperties.position.z = array[4].value; - angles.x = array[5].value; - angles.y = array[6].value; - angles.z = array[7].value; + var index = 0; + selectedModelProperties.modelURL = array[index++].value; + selectedModelProperties.animationURL = array[index++].value; + selectedModelProperties.animationIsPlaying = array[index++].value; + selectedModelProperties.position.x = array[index++].value; + selectedModelProperties.position.y = array[index++].value; + selectedModelProperties.position.z = array[index++].value; + angles.x = array[index++].value; + angles.y = array[index++].value; + angles.z = array[index++].value; selectedModelProperties.modelRotation = Quat.fromVec3Degrees(angles); - selectedModelProperties.radius = array[8].value / 2; + selectedModelProperties.radius = array[9].value / 2; print(selectedModelProperties.radius); Models.editModel(selectedModelID, selectedModelProperties);