Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Thomas Pitiot
SocialAgents3D
Commits
48784bb5
Commit
48784bb5
authored
Nov 08, 2012
by
Jund Thomas
Browse files
ajout visu pour bug particle
parent
2f6b2047
Changes
5
Hide whitespace changes
Inline
Side-by-side
include/socialAgents.ui
View file @
48784bb5
...
...
@@ -84,6 +84,13 @@
</property>
</widget>
</item>
<item>
<widget
class=
"QCheckBox"
name=
"check_drawObstPredictionTri"
>
<property
name=
"text"
>
<string>
draw obstacles prediction tri
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QCheckBox"
name=
"check_drawAgentsNeighborDist"
>
<property
name=
"text"
>
...
...
include/viewer.h
View file @
48784bb5
...
...
@@ -95,6 +95,7 @@ public:
bool
drawAgentsNeighborDist
;
bool
drawAgentsObstacleDist
;
bool
drawAgentsPredictionTri
;
bool
drawObstPredictionTri
;
bool
draw_dart
;
unsigned
int
dartSlider
;
...
...
@@ -135,6 +136,11 @@ public slots:
drawAgentsPredictionTri
=
b
;
updateGL
()
;
}
void
slot_drawObstPredictionTri
(
bool
b
)
{
drawObstPredictionTri
=
b
;
updateGL
()
;
}
void
slot_drawAgentsNeighborDist
(
bool
b
)
{
drawAgentsNeighborDist
=
b
;
...
...
src/moving_obstacle.cpp
View file @
48784bb5
...
...
@@ -243,6 +243,7 @@ void MovingObstacle::computePrefVelocity()
// TODO Check position
void
MovingObstacle
::
update
()
{
assert
(
sim_
->
envMap_
.
map
.
getCurrentLevel
()
==
sim_
->
envMap_
.
map
.
getMaxLevel
())
;
// general_belonging.clear();
PFP
::
VEC3
bary
=
0
;
...
...
src/simulator.cpp
View file @
48784bb5
...
...
@@ -35,7 +35,7 @@ void Simulator::init(unsigned int config, int minSize, float dimension, bool ena
setupCircleScenario
(
100
)
;
break
;
case
1
:
setupCorridorScenario
(
500
,
2
5
)
;
setupCorridorScenario
(
500
,
2
)
;
break
;
case
2
:
setupScenario
(
1000
)
;
...
...
src/viewer.cpp
View file @
48784bb5
...
...
@@ -42,6 +42,7 @@ SocialAgents::SocialAgents(int minSize, int iterations) :
drawAgentsNeighborDist
(
false
),
drawAgentsObstacleDist
(
false
),
drawAgentsPredictionTri
(
false
),
drawObstPredictionTri
(
false
),
draw_dart
(
false
)
{
timer
=
new
QTimer
(
this
)
;
...
...
@@ -70,6 +71,7 @@ void SocialAgents::initGUI()
setCallBack
(
dock
.
check_drawMovingObstacles
,
SIGNAL
(
toggled
(
bool
)),
SLOT
(
slot_drawMovingObstacles
(
bool
)))
;
setCallBack
(
dock
.
check_drawAgents
,
SIGNAL
(
toggled
(
bool
)),
SLOT
(
slot_drawAgents
(
bool
)))
;
setCallBack
(
dock
.
check_drawAgentsPredictionTri
,
SIGNAL
(
toggled
(
bool
)),
SLOT
(
slot_drawAgentsPredictionTri
(
bool
)))
;
setCallBack
(
dock
.
check_drawObstPredictionTri
,
SIGNAL
(
toggled
(
bool
)),
SLOT
(
slot_drawObstPredictionTri
(
bool
)))
;
setCallBack
(
dock
.
check_drawAgentsNeighborDist
,
SIGNAL
(
toggled
(
bool
)),
SLOT
(
slot_drawAgentsNeighborDist
(
bool
)))
;
setCallBack
(
dock
.
check_drawAgentsObstacleDist
,
SIGNAL
(
toggled
(
bool
)),
SLOT
(
slot_drawAgentsObstacleDist
(
bool
)))
;
setCallBack
(
dock
.
check_dart
,
SIGNAL
(
toggled
(
bool
)),
SLOT
(
slot_dart
(
bool
)))
;
...
...
@@ -306,6 +308,25 @@ void SocialAgents::cb_redraw()
renderPredictionTriangle
(
sim
.
envMap_
,
(
*
it
)
->
part_
.
d
,
(
*
it
)
->
getPosition
())
;
}
}
if
(
drawObstPredictionTri
)
{
for
(
std
::
vector
<
MovingObstacle
*>::
iterator
it
=
sim
.
movingObstacles_
.
begin
()
;
it
!=
sim
.
movingObstacles_
.
end
()
;
++
it
)
{
for
(
unsigned
int
i
=
0
;
i
<
(
*
it
)
->
nbVertices
;
++
i
)
{
CGoGN
::
Algo
::
MovingObjects
::
ParticleCell2D
<
PFP
>
p
=
*
(
*
it
)
->
parts_
[
i
];
glColor3f
(
p
.
getState
()
/
3.0
f
,
p
.
getState
()
%
2
,
p
.
getState
())
;
glLineWidth
(
1.0
f
)
;
renderPredictionTriangle
(
sim
.
envMap_
,
p
.
d
,
p
.
getPosition
())
;
if
(
p
.
getState
()
==
VERTEX
)
glBegin
(
GL_POINTS
);
glVertex3fv
(
p
.
getPosition
().
data
());
glEnd
();
}
}
}
#endif
//draw the environment
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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