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
grains
grains-web
Commits
a5c0e727
Commit
a5c0e727
authored
May 09, 2017
by
Jens-Christian Fischer
Browse files
Tune acceleration threshold
parent
1250b919
Changes
3
Hide whitespace changes
Inline
Side-by-side
mix.exs
View file @
a5c0e727
...
@@ -3,7 +3,7 @@ defmodule Grains.Mixfile do
...
@@ -3,7 +3,7 @@ defmodule Grains.Mixfile do
def
project
do
def
project
do
[
app:
:grains
,
[
app:
:grains
,
version:
"0.0.5
0
"
,
version:
"0.0.5
1
"
,
elixir:
"~> 1.2"
,
elixir:
"~> 1.2"
,
elixirc_paths:
elixirc_paths
(
Mix
.
env
),
elixirc_paths:
elixirc_paths
(
Mix
.
env
),
compilers:
[
:phoenix
,
:gettext
]
++
Mix
.
compilers
,
compilers:
[
:phoenix
,
:gettext
]
++
Mix
.
compilers
,
...
...
web/static/js/acceleration.js
View file @
a5c0e727
...
@@ -7,7 +7,7 @@ let AccelerationPanel = {
...
@@ -7,7 +7,7 @@ let AccelerationPanel = {
sliders
:
{},
sliders
:
{},
slider_titles
:
[
"
z
"
],
slider_titles
:
[
"
z
"
],
old_values
:
[
0
,
0
,
0
],
old_values
:
[
0
],
init
(
socket
,
domId
)
{
init
(
socket
,
domId
)
{
...
@@ -36,7 +36,7 @@ let AccelerationPanel = {
...
@@ -36,7 +36,7 @@ let AccelerationPanel = {
console
.
log
(
"
adding acceleration
"
);
console
.
log
(
"
adding acceleration
"
);
this
.
orientation
=
new
Interface
.
Accelerometer
({
this
.
orientation
=
new
Interface
.
Accelerometer
({
onvaluechange
:
function
(
_x
,
_y
,
z
)
{
onvaluechange
:
function
(
_x
,
_y
,
z
)
{
that
.
sliders
[
'
z
'
].
setValue
(
z
);
that
.
sliders
[
'
z
'
].
setValue
(
z
);
that
.
send_value
([
z
]);
that
.
send_value
([
z
]);
}
}
...
...
web/static/js/presencesketch.js
View file @
a5c0e727
...
@@ -16,12 +16,10 @@ function Boid(p, x, y) {
...
@@ -16,12 +16,10 @@ function Boid(p, x, y) {
this
.
maxforce
=
0.05
;
// Maximum steering force
this
.
maxforce
=
0.05
;
// Maximum steering force
};
};
Boid
.
prototype
.
set_velocity
=
function
(
dx
,
dy
)
{
this
.
velocity
=
this
.
p
.
createVector
(
dx
,
dy
);
};
Boid
.
prototype
.
set_acceleration
=
function
(
z
)
{
Boid
.
prototype
.
set_acceleration
=
function
(
z
)
{
this
.
radius
=
32
;
if
(
Math
.
abs
(
z
)
>
0.5
)
{
this
.
radius
=
32
;
}
};
};
...
...
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