Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Amanda Ghassaei
OrigamiSimulator
Commits
ace4602c
Commit
ace4602c
authored
May 12, 2017
by
amandaghassaei
Browse files
better handling of dragging
parent
28bc7d9e
Changes
1
Hide whitespace changes
Inline
Side-by-side
js/ViveInterface.js
View file @
ace4602c
...
...
@@ -47,7 +47,6 @@ function initViveInterface(globals){
});
var
nodes
=
[
null
,
null
];
var
draggingEvent
=
[
false
,
false
];
var
releaseEvent
=
[
false
,
false
];
var
effect
=
new
THREE
.
VREffect
(
globals
.
threeView
.
renderer
);
...
...
@@ -84,11 +83,9 @@ function initViveInterface(globals){
function
setControllerEvents
(){
controller1
.
addEventListener
(
'
triggerdown
'
,
function
()
{
controllerStates
[
0
]
=
true
;
draggingEvent
[
0
]
=
true
;
});
controller2
.
addEventListener
(
'
triggerdown
'
,
function
()
{
controllerStates
[
1
]
=
true
;
draggingEvent
[
1
]
=
true
;
});
controller1
.
addEventListener
(
'
triggerup
'
,
function
()
{
controllerStates
[
0
]
=
false
;
...
...
@@ -118,10 +115,9 @@ function initViveInterface(globals){
if
(
controllerStates
[
i
]
&&
nodes
[
i
]){
//drag node
if
(
draggingEvent
[
i
]
)
{
if
(
!
nodes
[
i
].
isFixed
()
)
{
nodes
[
i
].
setFixed
(
true
);
globals
.
fixedHasChanged
=
true
;
draggingEvent
[
i
]
=
false
;
}
position
.
y
-=
yOffset
;
position
.
multiplyScalar
(
1
/
scale
);
...
...
@@ -135,7 +131,6 @@ function initViveInterface(globals){
globals
.
fixedHasChanged
=
true
;
}
draggingEvent
[
i
]
=
false
;
releaseEvent
[
i
]
=
false
;
var
direction
=
new
THREE
.
Vector3
(
0
,
0
,
-
1
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment