Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ofxaddons
ofxCloudLib
Commits
635f93a1
Commit
635f93a1
authored
Dec 07, 2017
by
artificiel
Browse files
ClientsManager: debut de prise en charge du stickymesh
parent
6d90ee96
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/ofxCloudLib/ClientsManager.cpp
View file @
635f93a1
...
...
@@ -29,8 +29,8 @@ ClientsManager::ClientsManager()
gui_
.
setName
(
"client editors visibiliy"
);
gui_
.
setPosition
(
10
,
ofGetHeight
()
-
gui_
.
getHeight
());
add_player
(
"player 1"
);
add_player
(
"player 2"
);
//
add_player("player 1");
//
add_player("player 2");
}
void
ClientsManager
::
add_player
(
std
::
string
player_name
)
...
...
@@ -96,6 +96,7 @@ bool ClientsManager::receive_mesh(ofMesh &mesh)
bool
is_new
=
false
;
for
(
const
auto
&
client
:
client_connectors_
)
{
client
.
second
->
receive_mesh
();
if
(
client
.
second
->
is_xyz_new
())
{
is_new
=
true
;
...
...
@@ -111,20 +112,19 @@ bool ClientsManager::receive_mesh(ofMesh &mesh)
mesh
.
setMode
(
OF_PRIMITIVE_POINTS
);
for
(
const
auto
&
client
:
client_connectors_
)
{
if
(
client
.
second
->
enabled_
)
{
for
(
const
auto
&
v
:
client
.
second
->
get_mesh
().
getVertices
())
{
mesh
.
addVertex
(
v
);
if
(
ofRandom
(
1.0
)
<
sticky_mesh_input_prob_
)
{
tmp_mesh
.
addVertex
(
v
);
tmp_mesh
.
addColor
(
sticky_mesh_color_
);
for
(
const
auto
&
v
:
client
.
second
->
get_mesh
().
getVertices
())
{
mesh
.
addVertex
(
v
);
if
(
ofRandom
(
1.0
)
<
sticky_mesh_input_prob_
)
{
tmp_mesh
.
addVertex
(
v
);
tmp_mesh
.
addColor
(
sticky_mesh_color_
);
}
}
}
}
}
}
/*
for
(
unsigned
int
i
=
0
;
i
<
tmp_mesh
.
getNumVertices
();
i
++
)
{
auto
color
=
tmp_mesh
.
getColors
()[
i
];
color
.
a
=
color
.
a
*
(
1.0
-
sticky_mesh_attenuation_amnt_
);
...
...
@@ -137,12 +137,10 @@ bool ClientsManager::receive_mesh(ofMesh &mesh)
if
(
sticky_mesh_dither_amnt_
>
0
)
{
auto
v
=
tmp_mesh
.
getVertices
()[
i
];
v.x =
v.x + ofRandom(-sticky_mesh_dither_amnt_, sticky_mesh_dither_amnt_);
v.y =
v.y + ofRandom(-sticky_mesh_dither_amnt_, sticky_mesh_dither_amnt_);
v.z =
v.z + ofRandom(-sticky_mesh_dither_amnt_, sticky_mesh_dither_amnt_);
v
.
x
+=
ofRandom
(
-
sticky_mesh_dither_amnt_
,
sticky_mesh_dither_amnt_
);
v
.
z
+=
ofRandom
(
-
sticky_mesh_dither_amnt_
,
sticky_mesh_dither_amnt_
);
v
.
y
+=
ofRandom
(
-
sticky_mesh_dither_amnt_
,
0
);
if
(
v
.
y
<
0.0
)
v
.
y
=
0.0
;
sticky_mesh_
.
addVertex
(
v
);
}
else
{
sticky_mesh_
.
addVertex
(
tmp_mesh
.
getVertices
()[
i
]);
...
...
@@ -150,9 +148,8 @@ bool ClientsManager::receive_mesh(ofMesh &mesh)
sticky_mesh_
.
addColor
(
color
);
}
}
}
*/
// }
return
is_new
;
}
...
...
src/ofxCloudLib/ClientsManager.hpp
View file @
635f93a1
...
...
@@ -38,7 +38,7 @@ class ClientsManager
ofParameter
<
float
>
sticky_mesh_dither_amnt_
;
ofParameter
<
ofFloatColor
>
sticky_mesh_color_
;
ofMesh
sticky_mesh_
;
of
Vbo
Mesh
sticky_mesh_
;
ofMesh
registered_mesh_
;
ofxPanel
gui_
;
map
<
std
::
string
,
shared_ptr
<
AbstractClient
>>
client_connectors_
;
...
...
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