mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 05:17:02 +02:00
panel entity, readme
This commit is contained in:
parent
05467bd5e1
commit
9f0d254739
2 changed files with 28 additions and 17 deletions
|
@ -1,6 +1,8 @@
|
||||||
This PR demonstrates one way in-world editing of objects might work. We start with a spotlight. When you distant grab the sliders, you can move them along their axis to change their values. You may also rotate / move the block to which the spotlight is attached.
|
This PR demonstrates one way in-world editing of objects might work.
|
||||||
|
|
||||||
Enter edit mode by running your distance beam through a light overlay. Exit using the red X.
|
Running this script will show light overlay icons in-world. Enter edit mode by running your distance beam through a light overlay. Exit using the red X.
|
||||||
|
|
||||||
|
When you distant grab the sliders, you can move them along their axis to change their values. You may also rotate / move the block to which the spotlight is attached.
|
||||||
|
|
||||||
To test: https://rawgit.com/imgntn/hifi/light_mod/examples/lights/lightLoader.js
|
To test: https://rawgit.com/imgntn/hifi/light_mod/examples/lights/lightLoader.js
|
||||||
To reset, I recommend stopping all scripts then re-loading lightLoader.js
|
To reset, I recommend stopping all scripts then re-loading lightLoader.js
|
||||||
|
@ -8,14 +10,12 @@ To reset, I recommend stopping all scripts then re-loading lightLoader.js
|
||||||
When you run the lightLoader.js script, several scripts will be loaded:
|
When you run the lightLoader.js script, several scripts will be loaded:
|
||||||
- handControllerGrab.js (custom)
|
- handControllerGrab.js (custom)
|
||||||
- lightModifier.js (listens for message to create sliders for a given light)
|
- lightModifier.js (listens for message to create sliders for a given light)
|
||||||
- lightModifierTestScene.js (creates a light and parents it to a block, then sends a message ^^)
|
- lightModifierTestScene.js (creates a light)
|
||||||
- slider.js (attached to each slider entity)
|
- slider.js (attached to each slider entity)
|
||||||
- lightParent.js (attached to the entity to which a light is parented, so you can move it around)
|
- lightParent.js (attached to a 3d model of a light, to which a light is parented, so you can move it around. or keep the current parent if a light already has a parent)
|
||||||
- closeButton.js (for closing the ui)
|
- closeButton.js (for closing the ui)
|
||||||
- ../libraries/lightOverlayManager.js (custom)
|
- ../libraries/lightOverlayManager.js (shows 2d overlays for lights in the world)
|
||||||
- ../libraries/entitySelectionTool.js
|
- ../libraries/entitySelectionTool.js (visualizes volume of the lights)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Current sliders are (top to bottom):
|
Current sliders are (top to bottom):
|
||||||
red
|
red
|
||||||
|
|
|
@ -16,13 +16,14 @@ var SLIDERS_SHOULD_STAY_WITH_AVATAR = false;
|
||||||
var VERTICAL_SLIDERS = false;
|
var VERTICAL_SLIDERS = false;
|
||||||
var SHOW_OVERLAYS = true;
|
var SHOW_OVERLAYS = true;
|
||||||
var SHOW_LIGHT_VOLUME = true;
|
var SHOW_LIGHT_VOLUME = true;
|
||||||
|
var USE_PARENTED_PANEL = false;
|
||||||
|
|
||||||
//variables for managing overlays
|
//variables for managing overlays
|
||||||
var selectionDisplay;
|
var selectionDisplay;
|
||||||
var selectionManager;
|
var selectionManager;
|
||||||
var lightOverlayManager;
|
var lightOverlayManager;
|
||||||
|
|
||||||
//for when we make a block parent for the light
|
//for when we make a 3d model of a light a parent for the light
|
||||||
var PARENT_SCRIPT_URL = Script.resolvePath('lightParent.js?' + Math.random(0 - 100));
|
var PARENT_SCRIPT_URL = Script.resolvePath('lightParent.js?' + Math.random(0 - 100));
|
||||||
|
|
||||||
if (SHOW_OVERLAYS === true) {
|
if (SHOW_OVERLAYS === true) {
|
||||||
|
@ -362,9 +363,9 @@ var slidersRef = {
|
||||||
var light = null;
|
var light = null;
|
||||||
|
|
||||||
function makeSliders(light) {
|
function makeSliders(light) {
|
||||||
|
var panel;
|
||||||
if (USE_PARENTED_PANEL === true) {
|
if (USE_PARENTED_PANEL === true) {
|
||||||
createPanelEntity(MyAvatar.position);
|
panel = createPanelEntity(MyAvatar.position);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (light.type === 'spotlight') {
|
if (light.type === 'spotlight') {
|
||||||
|
@ -409,10 +410,21 @@ function makeSliders(light) {
|
||||||
subscribeToSliderMessages();
|
subscribeToSliderMessages();
|
||||||
|
|
||||||
if (USE_PARENTED_PANEL === true) {
|
if (USE_PARENTED_PANEL === true) {
|
||||||
parentEntitiesToPanel();
|
parentEntitiesToPanel(panel);
|
||||||
|
}
|
||||||
|
|
||||||
|
if () {
|
||||||
|
parentPanelToAvatar(panel)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function parentPanelToAvatar(panel) {
|
||||||
|
Entities.editEntity(panel, {
|
||||||
|
parentID: MyAvatar.sessionUUID,
|
||||||
|
//actually figure out which one to parent it to -- probably a spine or something.
|
||||||
|
parentJointIndex: 1,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
function parentEntitiesToPanel(panel) {
|
function parentEntitiesToPanel(panel) {
|
||||||
slidersRef.forEach(function(slider) {
|
slidersRef.forEach(function(slider) {
|
||||||
|
@ -493,11 +505,10 @@ function createCloseButton(endOfAxis) {
|
||||||
ignoreForCollisions: true,
|
ignoreForCollisions: true,
|
||||||
script: CLOSE_BUTTON_SCRIPT_URL,
|
script: CLOSE_BUTTON_SCRIPT_URL,
|
||||||
userData: JSON.stringify({
|
userData: JSON.stringify({
|
||||||
grabbableKey: {
|
grabbableKey: {
|
||||||
wantsTrigger: true
|
wantsTrigger: true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
//need to add wantsTrigger stuff so we can interact with it with our beamz
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var button = Entities.addEntity(buttonProperties);
|
var button = Entities.addEntity(buttonProperties);
|
||||||
|
|
Loading…
Reference in a new issue