Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Thomas Pitiot
SocialAgents3D
Commits
0a8ade23
Commit
0a8ade23
authored
Sep 27, 2013
by
pitiot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merge
parent
9138316e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
15 deletions
+33
-15
include/viewer.h
include/viewer.h
+1
-1
src/viewer.cpp
src/viewer.cpp
+32
-14
No files found.
include/viewer.h
View file @
0a8ade23
...
...
@@ -59,7 +59,7 @@
#define DRAW_REGISTRATION //montre l'enregistrement des obstacles mobiles
//#define AFFICHE_MESH
//#define EXPORTING
//
#define ONERING
#define ONERING
//#define SHADOWSHELL
using
namespace
CGoGN
;
...
...
src/viewer.cpp
View file @
0a8ade23
...
...
@@ -516,11 +516,20 @@ void SocialAgents::updateVBOprimitives(int upType)
{
#ifdef ONERING
CellMarker
<
FACE
>
cmF
(
simulator
.
envMap_
.
map
);
TraversorF
<
PFP
::
MAP
>
tF
(
simulator
.
envMap_
.
map
);
for
(
Dart
d
=
tF
.
begin
()
;
d
!=
tF
.
end
()
;
d
=
tF
.
next
())
for
(
unsigned
int
i
=
0
;
i
<
simulator
.
movingObstacles_
.
size
()
;
++
i
)
{
MovingObstacle
*
mo
=
simulator
.
movingObstacles_
[
i
];
for
(
std
::
vector
<
std
::
pair
<
Dart
,
int
>
>::
iterator
it
=
mo
->
general_belonging
.
begin
();
it
!=
mo
->
general_belonging
.
end
();
++
it
)
{
if
(
simulator
.
envMap_
.
neighborObstvect
[
d
].
size
()
>
0
&&
!
(
simulator
.
envMap_
.
obstvect
[
d
].
size
()
>
0
))
cmF
.
mark
(
d
);
if
(
!
cmF
.
isMarked
((
*
it
).
first
))
{
cmF
.
mark
((
*
it
).
first
);
}
}
}
MapBrowserSelector
mbs1
(
simulator
.
envMap_
.
map
,
SelectorCellMarked
<
FACE
>
(
cmF
));
...
...
@@ -532,12 +541,21 @@ void SocialAgents::updateVBOprimitives(int upType)
simulator
.
envMap_
.
map
.
setBrowser
(
NULL
);
CellMarker
<
FACE
>
cmF2
(
simulator
.
envMap_
.
map
);
TraversorF
<
PFP
::
MAP
>
tF2
(
simulator
.
envMap_
.
map
);
for
(
Dart
d
=
tF
.
begin
()
;
d
!=
tF
.
end
()
;
d
=
tF
.
next
())
for
(
unsigned
int
i
=
0
;
i
<
simulator
.
movingObstacles_
.
size
()
;
++
i
)
{
if
(
simulator
.
envMap_
.
obstvect
[
d
].
size
()
>
0
)
MovingObstacle
*
mo
=
simulator
.
movingObstacles_
[
i
];
int
n
=
mo
->
nbParticles
;
for
(
int
i
=
0
;
i
<
n
-
1
;
i
++
)
{
cmF2
.
mark
(
d
);
for
(
std
::
vector
<
Dart
>::
iterator
it
=
mo
->
neighbor_cells
[
i
].
begin
();
it
!=
mo
->
neighbor_cells
[
i
].
end
();
++
it
)
{
if
(
!
cmF
.
isMarked
(
*
it
)
&&
!
cmF2
.
isMarked
(
*
it
))
{
cmF2
.
mark
(
*
it
);
}
}
}
}
...
...
@@ -1072,12 +1090,12 @@ void SocialAgents::cb_redraw()
//--------------->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
qglviewer
::
Vec
lookfrom
,
lookat
,
upvector
;
qglviewer
::
Camera
*
cam
=
getQGLWidget
()
->
camera
();
cerr
<<
"---------------------------------------------"
<<
endl
;
cerr
<<
cam
->
position
()[
0
]
<<
" "
<<
cam
->
position
()[
1
]
<<
" "
<<
cam
->
position
()[
2
]
<<
endl
;
cerr
<<
cam
->
viewDirection
()[
0
]
<<
" "
<<
cam
->
viewDirection
()[
1
]
<<
" "
<<
cam
->
viewDirection
()[
2
]
<<
endl
;
cerr
<<
cam
->
upVector
()[
0
]
<<
" "
<<
cam
->
upVector
()[
1
]
<<
" "
<<
cam
->
upVector
()[
2
]
<<
endl
;
//
qglviewer::Vec lookfrom, lookat, upvector;
//
qglviewer::Camera* cam = getQGLWidget()->camera();
//
cerr << "---------------------------------------------" << endl;
//
cerr << cam->position()[0] << " " << cam->position()[1] << " " << cam->position()[2] << endl;
//
cerr << cam->viewDirection()[0] << " " << cam->viewDirection()[1] << " " << cam->viewDirection()[2] << endl;
//
cerr << cam->upVector()[0] << " " << cam->upVector()[1] << " " << cam->upVector()[2] << endl;
}
void
SocialAgents
::
drawCell
(
Dart
d
,
float
width
,
float
r
,
float
g
,
float
b
)
...
...
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