mirror of
https://github.com/overte-org/overte.git
synced 2025-04-19 13:43:49 +02:00
First version.
This commit is contained in:
parent
d276adc3a9
commit
fd2b0da76d
3 changed files with 37 additions and 1 deletions
|
@ -58,7 +58,7 @@ void Light::setOrientation(const glm::quat& orientation) {
|
|||
}
|
||||
|
||||
void Light::setDirection(const Vec3& direction) {
|
||||
_lightSchemaBuffer.edit().volume.direction = (direction);
|
||||
_lightSchemaBuffer.edit().volume.direction = (_transform.getRotation() * direction);
|
||||
}
|
||||
|
||||
const Vec3& Light::getDirection() const {
|
||||
|
|
|
@ -514,6 +514,11 @@
|
|||
<div class="sub-section-header zone-group zone-section keylight-section">
|
||||
<label>Key Light</label>
|
||||
</div>
|
||||
<form>
|
||||
<input type="radio" name="keyLightMode" value="inherit" id="property-zone-keylight-mode-inherit" checked> Inherit
|
||||
<input type="radio" name="keyLightMode" value="disabled" id="property-zone-keylight-mode-disabled"> Off
|
||||
<input type="radio" name="keyLightMode" value="enabled" id="property-zone-keylight-mode-enabled"> On
|
||||
</form>
|
||||
<div class="zone-section keylight-section zone-group property rgb">
|
||||
<div class="color-picker" id="property-zone-key-light-color"></div>
|
||||
<label>Key light color</label>
|
||||
|
|
|
@ -146,6 +146,22 @@ function createEmitTextPropertyUpdateFunction(propertyName) {
|
|||
};
|
||||
}
|
||||
|
||||
function createZoneComponentModeChangedFunction(zoneComponent, zoneComponentModeInherit, zoneComponentModeDisabled, zoneComponentModeEnabled) {
|
||||
return function() {
|
||||
var zoneComponentMode;
|
||||
|
||||
if (zoneComponentModeInherit.checked) {
|
||||
zoneComponentMode = 'inherit';
|
||||
} else if (zoneComponentModeDisabled.checked) {
|
||||
zoneComponentMode = 'disabled';
|
||||
} else if (zoneComponentModeEnabled.checked) {
|
||||
zoneComponentMode = 'enabled';
|
||||
}
|
||||
|
||||
updateProperty(zoneComponent, zoneComponentMode);
|
||||
}
|
||||
}
|
||||
|
||||
function createEmitGroupTextPropertyUpdateFunction(group, propertyName) {
|
||||
return function() {
|
||||
var properties = {};
|
||||
|
@ -644,6 +660,11 @@ function loaded() {
|
|||
|
||||
var elZoneSections = document.querySelectorAll(".zone-section");
|
||||
allSections.push(elZoneSections);
|
||||
|
||||
var elZoneKeyLightModeInherit = document.getElementById("property-zone-component-mode-inherit");
|
||||
var elZoneKeyLightModeDisabled = document.getElementById("property-zone-component-mode-disabled");
|
||||
var elZoneKeyLightModeEnabled = document.getElementById("property-zone-component-mode-enabled");
|
||||
|
||||
var elZoneStageSunModelEnabled = document.getElementById("property-zone-stage-sun-model-enabled");
|
||||
|
||||
var elZoneKeyLightColor = document.getElementById("property-zone-key-light-color");
|
||||
|
@ -983,6 +1004,11 @@ function loaded() {
|
|||
elLightExponent.value = properties.exponent.toFixed(2);
|
||||
elLightCutoff.value = properties.cutoff.toFixed(2);
|
||||
} else if (properties.type == "Zone") {
|
||||
|
||||
elZoneKeyLightModeInherit.checked = (properties.keyLightMode == 'inherit');
|
||||
elZoneKeyLightModeDisabled.checked = (properties.keyLightMode == 'disabled');
|
||||
elZoneKeyLightModeEnabled.checked = (properties.keyLightMode == 'enabled');
|
||||
|
||||
elZoneStageSunModelEnabled.checked = properties.stage.sunModelEnabled;
|
||||
elZoneKeyLightColor.style.backgroundColor = "rgb(" + properties.keyLight.color.red + "," + properties.keyLight.color.green + "," + properties.keyLight.color.blue + ")";
|
||||
elZoneKeyLightColorRed.value = properties.keyLight.color.red;
|
||||
|
@ -1361,6 +1387,11 @@ function loaded() {
|
|||
}
|
||||
}));
|
||||
|
||||
var keyLightModeChanged = createZoneComponentModeChangedFunction('keyLightMode', elZoneKeyLightModeInherit, elZoneKeyLightModeDisabled, elZoneKeyLightModeEnabled)
|
||||
elZoneKeyLightModeInherit.addEventListener('change', keyLightModeChanged);
|
||||
elZoneKeyLightModeDisabled.addEventListener('change', keyLightModeChanged);
|
||||
elZoneKeyLightModeEnabled.addEventListener('change', keyLightModeChanged);
|
||||
|
||||
elZoneStageSunModelEnabled.addEventListener('change', createEmitGroupCheckedPropertyUpdateFunction('stage', 'sunModelEnabled'));
|
||||
colorPickers.push($('#property-zone-key-light-color').colpick({
|
||||
colorScheme: 'dark',
|
||||
|
|
Loading…
Reference in a new issue