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
392f19e9
Commit
392f19e9
authored
Sep 26, 2013
by
Arash HABIBI
Browse files
fini la superstition
parent
31b1668a
Changes
3
Hide whitespace changes
Inline
Side-by-side
include/env_map.h
View file @
392f19e9
...
...
@@ -32,9 +32,9 @@ class ArticulatedObstacle;
#include
"pfp.h"
//#define EXPORTING3
//
#define EXPORTING3
#define TWO_AND_HALF_DIM
//
#define TWO_AND_HALF_DIM
#ifdef EXPORTING3
...
...
@@ -60,7 +60,7 @@ public:
REAL
maxCellSize
;
REAL
minCellSize
;
REAL
obstacleDistance
;
unsigned
int
config
;
EnvMap
()
;
...
...
include/viewer.h
View file @
392f19e9
...
...
@@ -240,6 +240,8 @@ public:
bool
display_times
;
bool
percent
;
public
slots
:
void
setCameraDebug
();
void
animate
()
;
void
slot_timer
(
bool
b
)
...
...
src/viewer.cpp
View file @
392f19e9
...
...
@@ -1069,6 +1069,15 @@ void SocialAgents::cb_redraw()
#endif
popTransfoMatrix
();
//--------------->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
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
)
...
...
@@ -1081,7 +1090,32 @@ void SocialAgents::drawCell(Dart d, float width, float r, float g, float b)
}
//------------------------------------------------------------
void
SocialAgents
::
setCameraDebug
()
{
qglviewer
::
Vec
lookfrom
,
lookat
,
upvector
;
qglviewer
::
Camera
*
cam
=
getQGLWidget
()
->
camera
();
lookfrom
.
setValue
(
-
52.2146
,
-
1045.85
,
557.488
);
lookat
.
setValue
(
-
47.8132
,
-
957.687
,
510.494
);
upvector
.
setValue
(
-
0.000967862
,
0.47043
,
0.882437
);
/*
lookfrom.setValue(0,0,1000);
lookat.setValue(0,0,0);
upvector.setValue(0.5,0.5,0.0);
*/
/*
lookfrom.setValue(0,-1000,0);
lookat.setValue(0,0,0);
upvector.setValue(0.5,0.0,0.5);
*/
cam
->
setPosition
(
lookfrom
);
cam
->
lookAt
(
lookat
);
cam
->
setUpVector
(
upvector
);
}
//------------------------------------------------------------
void
SocialAgents
::
animate
()
{
...
...
@@ -1095,9 +1129,9 @@ void SocialAgents::animate()
// if (CityGenerator::animateCity<PFP>(&simulator.envMap_)) simulator.addPathToCorner() ;
// simulator.addPathsToAgents() ;
//
//
//
// std::cout << "t : " << nbIterations << std::endl ;
//
//
//
// timeval startTime ;
// gettimeofday(&startTime, NULL) ;
...
...
@@ -1106,6 +1140,9 @@ void SocialAgents::animate()
nbIterations
++
;
// setCameraDebug();
/*
if(cif_exists)
{
qglviewer::Vec lookfrom, lookat, upvector;
...
...
@@ -1134,7 +1171,7 @@ void SocialAgents::animate()
cam->lookAt(lookat);
cam->setUpVector(upvector,true);
}
*/
if
(
maxIterations
>
0
&&
nbIterations
>
maxIterations
)
{
// std::cout << "t : " << simulator.globalTime_ << std::endl ;
...
...
@@ -2017,6 +2054,8 @@ void SocialAgents::keyPressEvent(QKeyEvent *e)
}
case
Qt
::
Key_V
:
{
setCameraDebug
();
/*
qglviewer::Camera* cam = getQGLWidget()->camera();
if(simulator.config==0)
...
...
@@ -2047,6 +2086,7 @@ void SocialAgents::keyPressEvent(QKeyEvent *e)
cam->lookAt(qglviewer::Vec(0,0,0));
cam->setSceneRadius(10000);
}
*/
break
;
}
...
...
@@ -2170,21 +2210,21 @@ int main(int argc, char** argv)
glewInit
();
//
sa.cam_output_file.open("cams/cam.out",std::ofstream::out);
//
char camfile[100];
//
sprintf(camfile,"cams/cam.scn%d.spline",config);
//
//
sa.readCameraInputFile(
"
cam
s/toto"
);
//
if(sa.cif_exists)
//
{
//
unsigned int i;
//
//
for(i=0;i<sa.cif_begin;i++)
//
{
//
sa.nbIterations = sa.cif_begin;
sa
.
cam_output_file
.
open
(
"cams/cam.out"
,
std
::
ofstream
::
out
);
char
camfile
[
100
];
sprintf
(
camfile
,
"cams/cam.scn%d.spline"
,
config
);
sa
.
readCameraInputFile
(
cam
file
);
if
(
sa
.
cif_exists
)
{
unsigned
int
i
;
for
(
i
=
0
;
i
<
sa
.
cif_begin
;
i
++
)
{
sa
.
nbIterations
=
sa
.
cif_begin
;
sa
.
simulator
.
doStep
();
//
}
//
}
}
}
sa
.
show
()
;
// if (argc > 1)
...
...
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