mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 12:57:59 +02:00
create panel entity and parent panel to it
This commit is contained in:
parent
378d50d8a3
commit
05467bd5e1
1 changed files with 47 additions and 0 deletions
|
@ -363,6 +363,10 @@ var light = null;
|
||||||
|
|
||||||
function makeSliders(light) {
|
function makeSliders(light) {
|
||||||
|
|
||||||
|
if (USE_PARENTED_PANEL === true) {
|
||||||
|
createPanelEntity(MyAvatar.position);
|
||||||
|
}
|
||||||
|
|
||||||
if (light.type === 'spotlight') {
|
if (light.type === 'spotlight') {
|
||||||
var USE_COLOR_SLIDER = true;
|
var USE_COLOR_SLIDER = true;
|
||||||
var USE_INTENSITY_SLIDER = true;
|
var USE_INTENSITY_SLIDER = true;
|
||||||
|
@ -398,12 +402,55 @@ function makeSliders(light) {
|
||||||
sliders.push(slidersRef.exponent);
|
sliders.push(slidersRef.exponent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
createCloseButton(slidersRef.exponent.endOfAxis);
|
createCloseButton(slidersRef.exponent.endOfAxis);
|
||||||
|
|
||||||
subscribeToSliderMessages();
|
subscribeToSliderMessages();
|
||||||
|
|
||||||
|
if (USE_PARENTED_PANEL === true) {
|
||||||
|
parentEntitiesToPanel();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
function parentEntitiesToPanel(panel) {
|
||||||
|
slidersRef.forEach(function(slider) {
|
||||||
|
Entities.editEntity(slider.axis, {
|
||||||
|
parentID: panel
|
||||||
|
})
|
||||||
|
Entities.editEntity(slider.sliderIndicator, {
|
||||||
|
parentID: panel
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
closeButtons.forEach(function(button) {
|
||||||
|
Entities.editEntity(slider.sliderIndicator, {
|
||||||
|
parentID: panel
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function createPanelEntity(position) {
|
||||||
|
|
||||||
|
var panelProperties = {
|
||||||
|
name: 'Hifi-Slider-Panel',
|
||||||
|
type: 'Box',
|
||||||
|
dimensions: {
|
||||||
|
x: 0.1,
|
||||||
|
y: 0.1,
|
||||||
|
z: 0.1
|
||||||
|
},
|
||||||
|
visible: false,
|
||||||
|
collisionsWillMove: false,
|
||||||
|
ignoreForCollisions: true
|
||||||
|
}
|
||||||
|
|
||||||
|
var panel = Entities.addEntity(panelProperties);
|
||||||
|
return panel
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function createLightModel(position, rotation) {
|
function createLightModel(position, rotation) {
|
||||||
var blockProperties = {
|
var blockProperties = {
|
||||||
name: 'Hifi-Spotlight-Model',
|
name: 'Hifi-Spotlight-Model',
|
||||||
|
|
Loading…
Reference in a new issue