Merge pull request #6232 from Atlante45/master

edit.js fix
This commit is contained in:
Clément Brisset 2015-10-29 15:39:20 -07:00
commit bf7911e517

View file

@ -1510,7 +1510,7 @@ PropertiesTool = function(opts) {
if (entity.properties.rotation !== undefined) {
entity.properties.rotation = Quat.safeEulerAngles(entity.properties.rotation);
}
if (entity.properties.keyLight.direction !== undefined) {
if (entity.properties.type === "Zone" && 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;
}
@ -1541,7 +1541,7 @@ PropertiesTool = function(opts) {
var rotation = data.properties.rotation;
data.properties.rotation = Quat.fromPitchYawRollDegrees(rotation.x, rotation.y, rotation.z);
}
if (data.properties.keyLight.direction !== undefined) {
if (entity.properties.type === "Zone" && 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);
}