forked from LeenkxTeam/LNXSDK
Update
This commit is contained in:
@ -133,7 +133,7 @@ class VrInterface extends kha.vr.VrInterface {
|
|||||||
canvas = kha_SystemImpl.khanvas;
|
canvas = kha_SystemImpl.khanvas;
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
trace('kha_SystemImpl access failed: ' + e.message;
|
trace('kha_SystemImpl access failed: ' + e.message);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!canvas) {
|
if (!canvas) {
|
||||||
@ -362,7 +362,7 @@ class VrInterface extends kha.vr.VrInterface {
|
|||||||
|
|
||||||
self.currentFrame = frame;
|
self.currentFrame = frame;
|
||||||
self.currentViews = views;
|
self.currentViews = views;
|
||||||
self.currentViewerPose = pose; /
|
self.currentViewerPose = pose;
|
||||||
if (self.xrSession && self.xrSession.inputSources) {
|
if (self.xrSession && self.xrSession.inputSources) {
|
||||||
self.currentInputSources = self.xrSession.inputSources;
|
self.currentInputSources = self.xrSession.inputSources;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -72,6 +72,8 @@ class CameraControls extends Trait {
|
|||||||
if (!enableUI) return;
|
if (!enableUI) return;
|
||||||
if (Input.getKeyboard().started(toggleKey)) {
|
if (Input.getKeyboard().started(toggleKey)) {
|
||||||
controlsVisible = !controlsVisible;
|
controlsVisible = !controlsVisible;
|
||||||
|
if (!controlsVisible) Input.occupied = false;
|
||||||
|
|
||||||
if (controlsVisible && ui == null) {
|
if (controlsVisible && ui == null) {
|
||||||
Data.getFont(Canvas.defaultFontName, function(font: kha.Font) {
|
Data.getFont(Canvas.defaultFontName, function(font: kha.Font) {
|
||||||
ui = new Zui({font: font});
|
ui = new Zui({font: font});
|
||||||
@ -79,8 +81,7 @@ class CameraControls extends Trait {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (controlsVisible) Input.occupied = true;
|
||||||
Input.occupied = controlsVisible;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function render(g: Graphics) {
|
function render(g: Graphics) {
|
||||||
|
|||||||
@ -14,7 +14,7 @@ import leenkx.ui.Canvas;
|
|||||||
* Light Controls Trait for parameter controls via ZUI
|
* Light Controls Trait for parameter controls via ZUI
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class LightControl extends Trait {
|
class LightControls extends Trait {
|
||||||
|
|
||||||
@prop var enableUI: Bool = true;
|
@prop var enableUI: Bool = true;
|
||||||
@prop var toggleKey: String = "l";
|
@prop var toggleKey: String = "l";
|
||||||
@ -47,6 +47,7 @@ class LightControl extends Trait {
|
|||||||
|
|
||||||
if (Input.getKeyboard().started(toggleKey)) {
|
if (Input.getKeyboard().started(toggleKey)) {
|
||||||
controlsVisible = !controlsVisible;
|
controlsVisible = !controlsVisible;
|
||||||
|
if (!controlsVisible) Input.occupied = false;
|
||||||
|
|
||||||
if (controlsVisible) {
|
if (controlsVisible) {
|
||||||
gatherLights();
|
gatherLights();
|
||||||
@ -57,7 +58,7 @@ class LightControl extends Trait {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Input.occupied = controlsVisible;
|
if (controlsVisible) Input.occupied = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function render(g: Graphics) {
|
function render(g: Graphics) {
|
||||||
Reference in New Issue
Block a user