mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 04:12:46 +02:00
Check keyLight is defined
This commit is contained in:
parent
c237072195
commit
8b46ed7dff
2 changed files with 3 additions and 3 deletions
|
@ -1510,7 +1510,7 @@ PropertiesTool = function(opts) {
|
||||||
if (entity.properties.rotation !== undefined) {
|
if (entity.properties.rotation !== undefined) {
|
||||||
entity.properties.rotation = Quat.safeEulerAngles(entity.properties.rotation);
|
entity.properties.rotation = Quat.safeEulerAngles(entity.properties.rotation);
|
||||||
}
|
}
|
||||||
if (entity.properties.type === "Zone" && entity.properties.keyLight.direction !== undefined) {
|
if (entity.properties.keyLight !== undefined && entity.properties.keyLight.direction !== undefined) {
|
||||||
entity.properties.keyLight.direction = Vec3.multiply(RADIANS_TO_DEGREES, Vec3.toPolar(entity.properties.keyLight.direction));
|
entity.properties.keyLight.direction = Vec3.multiply(RADIANS_TO_DEGREES, Vec3.toPolar(entity.properties.keyLight.direction));
|
||||||
entity.properties.keyLight.direction.z = 0.0;
|
entity.properties.keyLight.direction.z = 0.0;
|
||||||
}
|
}
|
||||||
|
@ -1541,7 +1541,7 @@ PropertiesTool = function(opts) {
|
||||||
var rotation = data.properties.rotation;
|
var rotation = data.properties.rotation;
|
||||||
data.properties.rotation = Quat.fromPitchYawRollDegrees(rotation.x, rotation.y, rotation.z);
|
data.properties.rotation = Quat.fromPitchYawRollDegrees(rotation.x, rotation.y, rotation.z);
|
||||||
}
|
}
|
||||||
if (entity.properties.type === "Zone" && data.properties.keyLight.direction !== undefined) {
|
if (data.properties.keyLight !== undefined && data.properties.keyLight.direction !== undefined) {
|
||||||
data.properties.keyLight.direction = Vec3.fromPolar(
|
data.properties.keyLight.direction = Vec3.fromPolar(
|
||||||
data.properties.keyLight.direction.x * DEGREES_TO_RADIANS, data.properties.keyLight.direction.y * DEGREES_TO_RADIANS);
|
data.properties.keyLight.direction.x * DEGREES_TO_RADIANS, data.properties.keyLight.direction.y * DEGREES_TO_RADIANS);
|
||||||
}
|
}
|
||||||
|
|
|
@ -830,7 +830,7 @@
|
||||||
elZoneKeyLightColorRed.addEventListener('change', zoneKeyLightColorChangeFunction);
|
elZoneKeyLightColorRed.addEventListener('change', zoneKeyLightColorChangeFunction);
|
||||||
elZoneKeyLightColorGreen.addEventListener('change', zoneKeyLightColorChangeFunction);
|
elZoneKeyLightColorGreen.addEventListener('change', zoneKeyLightColorChangeFunction);
|
||||||
elZoneKeyLightColorBlue.addEventListener('change', zoneKeyLightColorChangeFunction);
|
elZoneKeyLightColorBlue.addEventListener('change', zoneKeyLightColorChangeFunction);
|
||||||
elZoneKeyLightIntensity.addEventListener('change', createEmitGroupNumberPropertyUpdateFunction('intensity','keyLight'));
|
elZoneKeyLightIntensity.addEventListener('change', createEmitGroupNumberPropertyUpdateFunction('keyLight','intensity'));
|
||||||
elZoneKeyLightAmbientIntensity.addEventListener('change', createEmitGroupNumberPropertyUpdateFunction('keyLight','ambientIntensity'));
|
elZoneKeyLightAmbientIntensity.addEventListener('change', createEmitGroupNumberPropertyUpdateFunction('keyLight','ambientIntensity'));
|
||||||
var zoneKeyLightDirectionChangeFunction = createEmitGroupVec3PropertyUpdateFunction('keyLight','direction', elZoneKeyLightDirectionX, elZoneKeyLightDirectionY, elZoneKeyLightDirectionZ);
|
var zoneKeyLightDirectionChangeFunction = createEmitGroupVec3PropertyUpdateFunction('keyLight','direction', elZoneKeyLightDirectionX, elZoneKeyLightDirectionY, elZoneKeyLightDirectionZ);
|
||||||
elZoneKeyLightDirectionX.addEventListener('change', zoneKeyLightDirectionChangeFunction);
|
elZoneKeyLightDirectionX.addEventListener('change', zoneKeyLightDirectionChangeFunction);
|
||||||
|
|
Loading…
Reference in a new issue