Fixing the keyLIght Direction ui for edit.js

This commit is contained in:
samcake 2015-10-29 10:13:28 -07:00
parent fd7582ad31
commit 025422792d

View file

@ -1510,9 +1510,9 @@ PropertiesTool = function(opts) {
if (entity.properties.rotation !== undefined) {
entity.properties.rotation = Quat.safeEulerAngles(entity.properties.rotation);
}
if (entity.properties.keyLightDirection !== undefined) {
entity.properties.keyLightDirection = Vec3.multiply(RADIANS_TO_DEGREES, Vec3.toPolar(entity.properties.keyLightDirection));
entity.properties.keyLightDirection.z = 0.0;
if (entity.properties.keyLight.Direction !== undefined) {
entity.properties.keyLight.Direction = Vec3.multiply(RADIANS_TO_DEGREES, Vec3.toPolar(entity.properties.keyLight.Direction));
entity.properties.keyLight.Direction.z = 0.0;
}
selections.push(entity);
}
@ -1541,9 +1541,9 @@ PropertiesTool = function(opts) {
var rotation = data.properties.rotation;
data.properties.rotation = Quat.fromPitchYawRollDegrees(rotation.x, rotation.y, rotation.z);
}
if (data.properties.keyLightDirection !== undefined) {
data.properties.keyLightDirection = Vec3.fromPolar(
data.properties.keyLightDirection.x * DEGREES_TO_RADIANS, data.properties.keyLightDirection.y * DEGREES_TO_RADIANS);
if (data.properties.keyLight.Direction !== undefined) {
data.properties.keyLight.Direction = Vec3.fromPolar(
data.properties.keyLight.Direction.x * DEGREES_TO_RADIANS, data.properties.keyLight.Direction.y * DEGREES_TO_RADIANS);
}
Entities.editEntity(selectionManager.selections[0], data.properties);
if (data.properties.name != undefined) {