Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OrigamiSimulator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Amanda Ghassaei
OrigamiSimulator
Commits
e7a451b9
Commit
e7a451b9
authored
Oct 03, 2017
by
Amanda Ghassaei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleaning up vr
parent
1a0a4727
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
js/VRInterface.js
js/VRInterface.js
+11
-11
No files found.
js/VRInterface.js
View file @
e7a451b9
...
...
@@ -44,12 +44,13 @@ function initViveInterface(globals){
position
:
new
THREE
.
Vector3
(
0
,
1.6
,
0
)
};
dat
.
GUIVR
.
disableMouse
();
//
dat.GUIVR.disableMouse();
var
gui
=
dat
.
GUIVR
.
create
(
'
Settings
'
);
gui
.
position
.
set
(
0.2
,
0.8
,
-
1
);
gui
.
rotation
.
set
(
Math
.
PI
/
-
6
,
0
,
0
);
gui
.
position
.
set
(
-
0.033949220776551325
,
2.2973055921574033
,
-
1.0077168687920643
);
gui
.
rotation
.
set
(
0
,
0
,
0
);
scene
.
add
(
gui
);
gui
.
visible
=
false
;
window
.
gui
=
gui
;
gui
.
add
(
variables
,
"
foldPercent
"
).
min
(
-
100
).
max
(
100
).
step
(
1
).
name
(
"
Fold Percent
"
).
onChange
(
function
(
val
){
globals
.
creasePercent
=
val
/
100
;
...
...
@@ -73,10 +74,10 @@ function initViveInterface(globals){
globals
.
materialHasChanged
=
true
;
globals
.
controls
.
setSliderInputVal
(
"
#percentDamping
"
,
val
);
});
gui
.
add
(
variables
,
"
stepsPerFrame
"
).
min
(
1
).
max
(
200
).
step
(
1
).
name
(
"
Num Steps Per Frame
"
).
onChange
(
function
(
val
)
{
var
numStepsSlider
=
gui
.
add
(
variables
,
"
stepsPerFrame
"
).
min
(
1
).
max
(
200
).
step
(
1
).
name
(
"
Num Steps Per Frame
"
).
onChange
(
function
(
val
)
{
globals
.
numSteps
=
val
;
$
(
"
.numStepsPerRender
"
).
val
(
val
);
});
})
.
listen
();
;
gui
.
add
(
variables
,
"
scale
"
).
min
(
0.01
).
max
(
1
).
step
(
0.001
).
name
(
"
Scale
"
).
onChange
(
function
(
val
)
{
globals
.
threeView
.
modelWrapper
.
scale
.
set
(
val
,
val
,
val
);
});
...
...
@@ -176,7 +177,9 @@ function initViveInterface(globals){
renderer
.
vr
.
enabled
=
globals
.
vrEnabled
;
if
(
globals
.
vrEnabled
)
{
dat
.
GUIVR
.
enableMouse
(
camera
);
globals
.
numSteps
=
30
;
$
(
"
.numStepsPerRender
"
).
val
(
globals
.
numSteps
);
variables
.
stepsPerFrame
=
globals
.
numSteps
;
globals
.
threeView
.
modelWrapper
.
scale
.
set
(
variables
.
scale
,
variables
.
scale
,
variables
.
scale
);
globals
.
threeView
.
modelWrapper
.
position
.
copy
(
variables
.
position
);
$link
.
html
(
"
EXIT VR
"
);
...
...
@@ -184,7 +187,8 @@ function initViveInterface(globals){
renderer
.
vr
.
standing
=
true
;
globals
.
threeView
.
setBackgroundColor
(
"
000000
"
);
}
else
{
dat
.
GUIVR
.
disableMouse
();
globals
.
numSteps
=
100
;
$
(
"
.numStepsPerRender
"
).
val
(
globals
.
numSteps
);
globals
.
model
.
reset
();
// globals.threeView.onWindowResize();
globals
.
threeView
.
resetCamera
();
...
...
@@ -251,10 +255,6 @@ function initViveInterface(globals){
continue
;
}
// position = transformToMeshCoords(position);
//todo get position and mesh in same reference frame
var
cast
=
new
THREE
.
Raycaster
(
position
,
tDirection
,
0
,
0.1
);
var
intersects
=
cast
.
intersectObjects
(
globals
.
model
.
getMesh
(),
false
);
if
(
intersects
.
length
>
0
){
...
...
Write
Preview
Markdown
is supported
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