mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 15:50:37 +02:00
Merge branch 'master' of http://github.com/highfidelity/hifi into fade
This commit is contained in:
commit
3c8cd48dfb
20 changed files with 393 additions and 373 deletions
|
@ -312,7 +312,7 @@ if (APPLE)
|
|||
COMPONENT ${CLIENT_COMPONENT}
|
||||
)
|
||||
|
||||
set(RESOURCES_INSTALL_DIR "${INTERFACE_INSTALL_APP_PATH}/Contents/Resources")
|
||||
set(SCRIPTS_INSTALL_DIR "${INTERFACE_INSTALL_APP_PATH}/Contents/Resources")
|
||||
set(RESOURCES_DEV_DIR "$<TARGET_FILE_DIR:${TARGET_NAME}>/../Resources")
|
||||
|
||||
# copy script files beside the executable
|
||||
|
@ -326,13 +326,14 @@ if (APPLE)
|
|||
fixup_interface()
|
||||
|
||||
else()
|
||||
set(RESOURCES_DEV_DIR "$<TARGET_FILE_DIR:${TARGET_NAME}>/resources")
|
||||
set(INTERFACE_EXEC_DIR "$<TARGET_FILE_DIR:${TARGET_NAME}>")
|
||||
set(RESOURCES_DEV_DIR "${INTERFACE_EXEC_DIR}/resources")
|
||||
|
||||
# copy the resources files beside the executable
|
||||
add_custom_command(TARGET ${TARGET_NAME} POST_BUILD
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy_if_different
|
||||
"${RESOURCES_RCC}"
|
||||
"$<TARGET_FILE_DIR:interface>"
|
||||
"${INTERFACE_EXEC_DIR}"
|
||||
# FIXME, the edit script code loads HTML from the scripts folder
|
||||
# which in turn relies on CSS that refers to the fonts. In theory
|
||||
# we should be able to modify the CSS to reference the QRC path to
|
||||
|
@ -340,13 +341,13 @@ else()
|
|||
# so we have to retain a copy of the fonts outside of the resources binary
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy_directory
|
||||
"${PROJECT_SOURCE_DIR}/resources/fonts"
|
||||
"$<TARGET_FILE_DIR:${TARGET_NAME}>/resources/fonts"
|
||||
"${RESOURCES_DEV_DIR}/fonts"
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy_directory
|
||||
"${CMAKE_SOURCE_DIR}/scripts"
|
||||
"${RESOURCES_DEV_DIR}/scripts"
|
||||
"${INTERFACE_EXEC_DIR}/scripts"
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy_if_different
|
||||
"${PROJECT_SOURCE_DIR}/resources/serverless/tutorial.json"
|
||||
"$<TARGET_FILE_DIR:${TARGET_NAME}>/resources/serverless/tutorial.json"
|
||||
"${RESOURCES_DEV_DIR}/serverless/tutorial.json"
|
||||
)
|
||||
|
||||
# link target to external libraries
|
||||
|
@ -363,7 +364,7 @@ else()
|
|||
PATTERN "*.exp" EXCLUDE
|
||||
)
|
||||
|
||||
set(RESOURCES_INSTALL_DIR "${INTERFACE_INSTALL_DIR}")
|
||||
set(SCRIPTS_INSTALL_DIR "${INTERFACE_INSTALL_DIR}")
|
||||
|
||||
set(EXECUTABLE_COMPONENT ${CLIENT_COMPONENT})
|
||||
|
||||
|
@ -371,11 +372,11 @@ else()
|
|||
endif()
|
||||
endif()
|
||||
|
||||
if (RESOURCES_INSTALL_DIR)
|
||||
if (SCRIPTS_INSTALL_DIR)
|
||||
# setup install of scripts beside interface executable
|
||||
install(
|
||||
DIRECTORY "${CMAKE_SOURCE_DIR}/scripts/"
|
||||
DESTINATION ${RESOURCES_INSTALL_DIR}/scripts
|
||||
DESTINATION ${SCRIPTS_INSTALL_DIR}/scripts
|
||||
COMPONENT ${CLIENT_COMPONENT}
|
||||
)
|
||||
endif()
|
||||
|
|
|
@ -67,6 +67,10 @@ Item {
|
|||
fill: parent
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
}
|
||||
|
||||
QmlHifi.WindowHeader {
|
||||
id: header
|
||||
iconSource: "../../../icons/goto-i.svg"
|
||||
|
|
|
@ -270,7 +270,9 @@ ModalWindow {
|
|||
onTriggered: {
|
||||
root.result = null;
|
||||
root.canceled();
|
||||
root.destroy();
|
||||
// FIXME we are leaking memory to avoid a crash
|
||||
// root.destroy();
|
||||
visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -292,7 +294,9 @@ ModalWindow {
|
|||
}
|
||||
root.result = JSON.stringify(result);
|
||||
root.selected(root.result);
|
||||
root.destroy();
|
||||
// FIXME we are leaking memory to avoid a crash
|
||||
// root.destroy();
|
||||
visible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -169,7 +169,9 @@ ModalWindow {
|
|||
shortcut: Qt.Key_Escape
|
||||
onTriggered: {
|
||||
root.canceled();
|
||||
root.destroy();
|
||||
// FIXME we are leaking memory to avoid a crash
|
||||
// root.destroy();
|
||||
visible = false;
|
||||
}
|
||||
}
|
||||
Action {
|
||||
|
@ -179,7 +181,9 @@ ModalWindow {
|
|||
onTriggered: {
|
||||
root.result = items ? comboBox.currentText : textResult.text
|
||||
root.selected(root.result);
|
||||
root.destroy();
|
||||
// FIXME we are leaking memory to avoid a crash
|
||||
// root.destroy();
|
||||
visible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,6 +58,10 @@ Item {
|
|||
width: parent ? parent.width : 0
|
||||
height: parent ? parent.height : 0
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
}
|
||||
|
||||
gradient: Gradient {
|
||||
GradientStop { position: 0.0; color: android.color.gradientTop }
|
||||
GradientStop { position: 1.0; color: android.color.gradientBottom }
|
||||
|
|
|
@ -118,7 +118,7 @@ Item {
|
|||
tabletRoot.playButtonClickSound();
|
||||
}*/
|
||||
}
|
||||
onEntered: {
|
||||
onPressed: {
|
||||
button.isEntered = true;
|
||||
button.entered();
|
||||
if (button.isActive) {
|
||||
|
@ -127,7 +127,7 @@ Item {
|
|||
button.state = "hover state";
|
||||
}
|
||||
}
|
||||
onExited: {
|
||||
onReleased: {
|
||||
button.isEntered = false;
|
||||
button.exited()
|
||||
if (button.isActive) {
|
||||
|
|
|
@ -562,7 +562,11 @@ Windows.ScrollingWindow {
|
|||
id: bakedColumn
|
||||
title: "Use Baked?"
|
||||
role: "baked"
|
||||
width: 100
|
||||
width: 170
|
||||
}
|
||||
|
||||
onSortIndicatorOrderChanged: {
|
||||
Assets.sortProxyModel(sortIndicatorColumn, sortIndicatorOrder);
|
||||
}
|
||||
|
||||
itemDelegate: Loader {
|
||||
|
|
|
@ -560,7 +560,11 @@ Rectangle {
|
|||
id: bakedColumn
|
||||
title: "Use Baked?"
|
||||
role: "baked"
|
||||
width: 100
|
||||
width: 170
|
||||
}
|
||||
|
||||
onSortIndicatorOrderChanged: {
|
||||
Assets.sortProxyModel(sortIndicatorColumn, sortIndicatorOrder);
|
||||
}
|
||||
|
||||
itemDelegate: Loader {
|
||||
|
|
|
@ -959,8 +959,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
|||
setProperty(hifi::properties::STEAM, (steamClient && steamClient->isRunning()));
|
||||
setProperty(hifi::properties::CRASHED, _previousSessionCrashed);
|
||||
|
||||
_entityClipboard->setIsServerlessMode(true);
|
||||
|
||||
{
|
||||
const QString TEST_SCRIPT = "--testScript";
|
||||
const QString TRACE_FILE = "--traceFile";
|
||||
|
|
|
@ -152,6 +152,10 @@ void AssetMappingsScriptingInterface::deleteMappings(QStringList paths, QJSValue
|
|||
request->start();
|
||||
}
|
||||
|
||||
void AssetMappingsScriptingInterface::sortProxyModel(int column, Qt::SortOrder order) {
|
||||
_proxyModel.sort(column, order);
|
||||
}
|
||||
|
||||
void AssetMappingsScriptingInterface::getAllMappings(QJSValue callback) {
|
||||
auto assetClient = DependencyManager::get<AssetClient>();
|
||||
auto request = assetClient->createGetAllMappingsRequest();
|
||||
|
|
|
@ -82,6 +82,7 @@ public:
|
|||
Q_INVOKABLE void getAllMappings(QJSValue callback = QJSValue());
|
||||
Q_INVOKABLE void renameMapping(QString oldPath, QString newPath, QJSValue callback = QJSValue());
|
||||
Q_INVOKABLE void setBakingEnabled(QStringList paths, bool enabled, QJSValue callback = QJSValue());
|
||||
Q_INVOKABLE void sortProxyModel(int column, Qt::SortOrder order = Qt::AscendingOrder);
|
||||
|
||||
protected:
|
||||
QSet<AssetRequest*> _pendingRequests;
|
||||
|
|
|
@ -388,6 +388,21 @@ QString Overlays::getOverlayType(OverlayID overlayId) {
|
|||
return "";
|
||||
}
|
||||
|
||||
QObject* Overlays::getOverlayObject(OverlayID id) {
|
||||
if (QThread::currentThread() != thread()) {
|
||||
QObject* result;
|
||||
PROFILE_RANGE(script, __FUNCTION__);
|
||||
BLOCKING_INVOKE_METHOD(this, "getOverlayObject", Q_RETURN_ARG(QObject*, result), Q_ARG(OverlayID, id));
|
||||
return result;
|
||||
}
|
||||
|
||||
Overlay::Pointer thisOverlay = getOverlay(id);
|
||||
if (thisOverlay) {
|
||||
return qobject_cast<QObject*>(&(*thisOverlay));
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
OverlayID Overlays::getOverlayAtPoint(const glm::vec2& point) {
|
||||
if (!_enabled) {
|
||||
return UNKNOWN_OVERLAY_ID;
|
||||
|
|
|
@ -235,6 +235,50 @@ public slots:
|
|||
*/
|
||||
QString getOverlayType(OverlayID overlayId);
|
||||
|
||||
/**jsdoc
|
||||
* Get the overlay script object. In particular, this is useful for accessing the event bridge for a <code>web3d</code>
|
||||
* overlay.
|
||||
* @function Overlays.getOverlayObject
|
||||
* @param {Uuid} overlayID - The ID of the overlay to get the script object of.
|
||||
* @returns {object} The script object for the overlay if found.
|
||||
* @example <caption>Receive "hello" messages from a <code>web3d</code> overlay.</caption>
|
||||
* // HTML file: name "web3d.html".
|
||||
* <!DOCTYPE html>
|
||||
* <html>
|
||||
* <head>
|
||||
* <title>HELLO</title>
|
||||
* </head>
|
||||
* <body>
|
||||
* <h1>HELLO</h1></h1>
|
||||
* <script>
|
||||
* setInterval(function () {
|
||||
* EventBridge.emitWebEvent("hello");
|
||||
* }, 2000);
|
||||
* </script>
|
||||
* </body>
|
||||
* </html>
|
||||
*
|
||||
* // Script file.
|
||||
* var web3dOverlay = Overlays.addOverlay("web3d", {
|
||||
* position: Vec3.sum(MyAvatar.position, Vec3.multiplyQbyV(MyAvatar.orientation, {x: 0, y: 0.5, z: -3 })),
|
||||
* rotation: MyAvatar.orientation,
|
||||
* url: Script.resolvePath("web3d.html"),
|
||||
* alpha: 1.0
|
||||
* });
|
||||
*
|
||||
* function onWebEventReceived(event) {
|
||||
* print("onWebEventReceived() : " + JSON.stringify(event));
|
||||
* }
|
||||
*
|
||||
* overlayObject = Overlays.getOverlayObject(web3dOverlay);
|
||||
* overlayObject.webEventReceived.connect(onWebEventReceived);
|
||||
*
|
||||
* Script.scriptEnding.connect(function () {
|
||||
* Overlays.deleteOverlay(web3dOverlay);
|
||||
* });
|
||||
*/
|
||||
QObject* getOverlayObject(OverlayID id);
|
||||
|
||||
/**jsdoc
|
||||
* Get the ID of the 2D overlay at a particular point on the screen or HUD.
|
||||
* @function Overlays.getOverlayAtPoint
|
||||
|
|
|
@ -166,18 +166,30 @@ bool OffscreenSurface::eventFilter(QObject* originalDestination, QEvent* event)
|
|||
case QEvent::TouchUpdate:
|
||||
case QEvent::TouchEnd: {
|
||||
QTouchEvent *originalEvent = static_cast<QTouchEvent *>(event);
|
||||
QTouchEvent fakeEvent(*originalEvent);
|
||||
auto newTouchPoints = fakeEvent.touchPoints();
|
||||
for (size_t i = 0; i < newTouchPoints.size(); ++i) {
|
||||
const auto &originalPoint = originalEvent->touchPoints()[i];
|
||||
auto &newPoint = newTouchPoints[i];
|
||||
newPoint.setPos(originalPoint.pos());
|
||||
QEvent::Type fakeMouseEventType = QEvent::None;
|
||||
Qt::MouseButton fakeMouseButton = Qt::LeftButton;
|
||||
Qt::MouseButtons fakeMouseButtons = Qt::NoButton;
|
||||
switch (event->type()) {
|
||||
case QEvent::TouchBegin:
|
||||
fakeMouseEventType = QEvent::MouseButtonPress;
|
||||
fakeMouseButtons = Qt::LeftButton;
|
||||
break;
|
||||
case QEvent::TouchUpdate:
|
||||
fakeMouseEventType = QEvent::MouseMove;
|
||||
fakeMouseButtons = Qt::LeftButton;
|
||||
break;
|
||||
case QEvent::TouchEnd:
|
||||
fakeMouseEventType = QEvent::MouseButtonRelease;
|
||||
fakeMouseButtons = Qt::NoButton;
|
||||
break;
|
||||
}
|
||||
fakeEvent.setTouchPoints(newTouchPoints);
|
||||
if (QCoreApplication::sendEvent(_sharedObject->getWindow(), &fakeEvent)) {
|
||||
qInfo() << __FUNCTION__ << "sent fake touch event:" << fakeEvent.type()
|
||||
<< "_quickWindow handled it... accepted:" << fakeEvent.isAccepted();
|
||||
return false; //event->isAccepted();
|
||||
// Same case as OffscreenUi.cpp::eventFilter: touch events are always being accepted so we now use mouse events and consider one touch, touchPoints()[0].
|
||||
QMouseEvent fakeMouseEvent(fakeMouseEventType, originalEvent->touchPoints()[0].pos(), fakeMouseButton, fakeMouseButtons, Qt::NoModifier);
|
||||
fakeMouseEvent.ignore();
|
||||
if (QCoreApplication::sendEvent(_sharedObject->getWindow(), &fakeMouseEvent)) {
|
||||
/*qInfo() << __FUNCTION__ << "sent fake touch event:" << fakeMouseEvent.type()
|
||||
<< "_quickWindow handled it... accepted:" << fakeMouseEvent.isAccepted();*/
|
||||
return fakeMouseEvent.isAccepted();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -56,7 +56,6 @@ var mode = noMode;
|
|||
var mouseLastX = 0;
|
||||
var mouseLastY = 0;
|
||||
|
||||
|
||||
var center = {
|
||||
x: 0,
|
||||
y: 0,
|
||||
|
@ -83,7 +82,6 @@ var rotatingTowardsTarget = false;
|
|||
var targetCamOrientation;
|
||||
var oldPosition, oldOrientation;
|
||||
|
||||
|
||||
function orientationOf(vector) {
|
||||
var direction,
|
||||
yaw,
|
||||
|
@ -95,7 +93,6 @@ function orientationOf(vector) {
|
|||
return Quat.multiply(yaw, pitch);
|
||||
}
|
||||
|
||||
|
||||
function handleRadialMode(dx, dy) {
|
||||
azimuth += dx / AZIMUTH_RATE;
|
||||
radius += radius * dy * RADIUS_RATE;
|
||||
|
@ -133,7 +130,6 @@ function handleOrbitMode(dx, dy) {
|
|||
Camera.setOrientation(orientationOf(vector));
|
||||
}
|
||||
|
||||
|
||||
function handlePanMode(dx, dy) {
|
||||
var up = Quat.getUp(Camera.getOrientation());
|
||||
var right = Quat.getRight(Camera.getOrientation());
|
||||
|
@ -254,8 +250,6 @@ function keyReleaseEvent(event) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function mousePressEvent(event) {
|
||||
if (alt && !isActive) {
|
||||
mouseLastX = event.x;
|
||||
|
@ -264,19 +258,16 @@ function mousePressEvent(event) {
|
|||
// Compute trajectories related values
|
||||
var pickRay = Camera.computePickRay(mouseLastX, mouseLastY);
|
||||
var modelIntersection = Entities.findRayIntersection(pickRay, true);
|
||||
var avatarIntersection = AvatarList.findRayIntersection(pickRay);
|
||||
|
||||
position = Camera.getPosition();
|
||||
|
||||
var avatarTarget = MyAvatar.getTargetAvatarPosition();
|
||||
|
||||
|
||||
var distance = -1;
|
||||
var string;
|
||||
|
||||
if (modelIntersection.intersects && modelIntersection.accurate) {
|
||||
distance = modelIntersection.distance;
|
||||
if (avatarIntersection.intersects || (modelIntersection.intersects && modelIntersection.accurate)) {
|
||||
if (avatarIntersection.intersects) {
|
||||
center = avatarIntersection.intersection;
|
||||
} else {
|
||||
center = modelIntersection.intersection;
|
||||
string = "Inspecting model";
|
||||
}
|
||||
// We've selected our target, now orbit towards it automatically
|
||||
rotatingTowardsTarget = true;
|
||||
// calculate our target cam rotation
|
||||
|
@ -292,7 +283,6 @@ function mousePressEvent(event) {
|
|||
|
||||
isActive = true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -313,7 +303,6 @@ function mouseMoveEvent(event) {
|
|||
if (mode == panningMode) {
|
||||
handlePanMode(event.x - mouseLastX, event.y - mouseLastY);
|
||||
}
|
||||
|
||||
}
|
||||
mouseLastX = event.x;
|
||||
mouseLastY = event.y;
|
||||
|
@ -327,7 +316,7 @@ function update() {
|
|||
}
|
||||
|
||||
function rotateTowardsTarget() {
|
||||
var newOrientation = Quat.mix(Camera.getOrientation(), targetCamOrientation, .1);
|
||||
var newOrientation = Quat.mix(Camera.getOrientation(), targetCamOrientation, 0.1);
|
||||
Camera.setOrientation(newOrientation);
|
||||
}
|
||||
|
||||
|
|
|
@ -46,7 +46,6 @@ function onMuteClicked() {
|
|||
printd("On Mute Clicked");
|
||||
//Menu.setIsOptionChecked("Mute Microphone", !Menu.isOptionChecked("Mute Microphone"));
|
||||
Audio.muted = !Audio.muted;
|
||||
onMuteToggled();
|
||||
}
|
||||
|
||||
function onMuteToggled() {
|
||||
|
|
|
@ -35,6 +35,7 @@ function fromQml(message) { // messages are {method, params}, like json-rpc. See
|
|||
break;
|
||||
case 'hide':
|
||||
Controller.setVPadHidden(false);
|
||||
module.exports.hide();
|
||||
module.exports.onHidden();
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -33,7 +33,6 @@ function init() {
|
|||
radar.setUniqueColor(uniqueColor);
|
||||
radar.init();
|
||||
setupModesBar();
|
||||
radar.isTouchValid = isRadarModeValidTouch;
|
||||
}
|
||||
|
||||
function shutdown() {
|
||||
|
@ -183,34 +182,6 @@ function onButtonClicked(clickedButton, whatToDo, hideAllAfter) {
|
|||
}
|
||||
}
|
||||
|
||||
function isRadarModeValidTouch(coords) {
|
||||
var qmlFragments = [modesbar.qmlFragment];
|
||||
var windows = [];
|
||||
for (var i=0; i < qmlFragments.length; i++) {
|
||||
var aQmlFrag = qmlFragments[i];
|
||||
if (aQmlFrag != null && aQmlFrag.isVisible() &&
|
||||
coords.x >= aQmlFrag.position.x * 3 && coords.x <= aQmlFrag.position.x * 3 + aQmlFrag.size.x * 3 &&
|
||||
coords.y >= aQmlFrag.position.y * 3 && coords.y <= aQmlFrag.position.y * 3 + aQmlFrag.size.y * 3
|
||||
) {
|
||||
printd("godViewModeTouchValid- false because of qmlFragments!? idx " + i);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
for (var i=0; i < windows.length; i++) {
|
||||
var aWin = windows[i];
|
||||
if (aWin != null && aWin.position() != null &&
|
||||
coords.x >= aWin.position().x * 3 && coords.x <= aWin.position().x * 3 + aWin.width() * 3 &&
|
||||
coords.y >= aWin.position().y * 3 && coords.y <= aWin.position().y * 3 + aWin.height() * 3
|
||||
) {
|
||||
printd("godViewModeTouchValid- false because of windows!?");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
printd("godViewModeTouchValid- true by default ");
|
||||
return true;
|
||||
}
|
||||
|
||||
Script.scriptEnding.connect(function () {
|
||||
shutdown();
|
||||
});
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
var radarModeInterface = {};
|
||||
|
||||
var logEnabled = true;
|
||||
var logEnabled = false;
|
||||
function printd(str) {
|
||||
if (logEnabled) {
|
||||
print("[radar.js] " + str);
|
||||
|
@ -118,19 +118,10 @@ function actionOnObjectFromEvent(event) {
|
|||
}
|
||||
|
||||
function mousePress(event) {
|
||||
if (!isTouchValid(coords)) {
|
||||
currentTouchIsValid = false;
|
||||
return;
|
||||
} else {
|
||||
currentTouchIsValid = true;
|
||||
}
|
||||
mousePressOrTouchEnd(event);
|
||||
}
|
||||
|
||||
function mousePressOrTouchEnd(event) {
|
||||
if (!currentTouchIsValid) {
|
||||
return;
|
||||
}
|
||||
if (radar) {
|
||||
if (actionOnObjectFromEvent(event)) {
|
||||
return;
|
||||
|
@ -155,9 +146,6 @@ function fakeDoubleTap(event) {
|
|||
teleporter.dragTeleportRelease(event);
|
||||
}
|
||||
|
||||
var currentTouchIsValid = false; // Currently used to know if touch hasn't
|
||||
// started on a UI overlay
|
||||
|
||||
var DOUBLE_TAP_TIME = 300;
|
||||
var fakeDoubleTapStart = Date.now();
|
||||
var touchEndCount = 0;
|
||||
|
@ -238,12 +226,6 @@ function touchEnd(event) {
|
|||
return;
|
||||
}
|
||||
|
||||
// if touch is invalid, cancel
|
||||
if (!currentTouchIsValid) {
|
||||
printd("touchEnd fail because !currentTouchIsValid");
|
||||
return;
|
||||
}
|
||||
|
||||
if (analyzeDoubleTap(event))
|
||||
return; // double tap detected, finish
|
||||
|
||||
|
@ -345,20 +327,6 @@ function computePointAtPlaneY(x, y, py) {
|
|||
p2.z, py);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
function isTouchValid(coords) {
|
||||
// TODO: Extend to the detection of touches on new menu bars
|
||||
var radarModeTouchValid = radarModeInterface.isTouchValid(coords);
|
||||
|
||||
// getItemAtPoint does not exist anymore, look for another way to know if we
|
||||
// are touching buttons
|
||||
// is it still needed?
|
||||
return /* !tablet.getItemAtPoint(coords) && */radarModeTouchValid;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
******************************************************************************/
|
||||
|
@ -373,17 +341,9 @@ function touchBegin(event) {
|
|||
x : event.x,
|
||||
y : event.y
|
||||
};
|
||||
if (!isTouchValid(coords)) {
|
||||
printd("analyze touch - RADAR_TOUCH - INVALID");
|
||||
currentTouchIsValid = false;
|
||||
touchStartingCoordinates = null;
|
||||
} else {
|
||||
printd("analyze touch - RADAR_TOUCH - ok");
|
||||
currentTouchIsValid = true;
|
||||
touchStartingCoordinates = coords;
|
||||
touchBeginTime = Date.now();
|
||||
}
|
||||
}
|
||||
|
||||
var startedDraggingCamera = false; // first time
|
||||
var draggingCamera = false; // is trying
|
||||
|
@ -848,9 +808,6 @@ function oneFingerTouchUpdate(event) {
|
|||
}
|
||||
|
||||
function touchUpdate(event) {
|
||||
if (!currentTouchIsValid) {
|
||||
return; // avoid moving and zooming when tap is over UI entities
|
||||
}
|
||||
if (event.isPinching || event.isPinchOpening) {
|
||||
pinchUpdate(event);
|
||||
} else {
|
||||
|
|
|
@ -307,6 +307,10 @@ WebTablet.prototype.setScriptURL = function (scriptURL) {
|
|||
Overlays.editOverlay(this.webOverlayID, { scriptURL: scriptURL });
|
||||
};
|
||||
|
||||
WebTablet.prototype.getOverlayObject = function () {
|
||||
return Overlays.getOverlayObject(this.webOverlayID);
|
||||
};
|
||||
|
||||
WebTablet.prototype.setWidth = function (width) {
|
||||
// imported from libraries/utils.js
|
||||
resizeTablet(width);
|
||||
|
|
Loading…
Reference in a new issue