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
9138316e
Commit
9138316e
authored
Sep 27, 2013
by
pitiot
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
6e030631
392f19e9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
5 deletions
+48
-5
include/env_map.h
include/env_map.h
+3
-2
include/viewer.h
include/viewer.h
+2
-0
src/viewer.cpp
src/viewer.cpp
+43
-3
No files found.
include/env_map.h
View file @
9138316e
...
...
@@ -32,11 +32,12 @@ class ArticulatedObstacle;
#include "pfp.h"
//#define EXPORTING3
//
#define EXPORTING3
//#define TWO_AND_HALF_DIM
#ifdef EXPORTING3
#include "Utils/Shaders/shaderPhongTexture.h"
#include "Utils/Shaders/shaderSimpleTexture.h"
...
...
@@ -60,7 +61,7 @@ public:
REAL
maxCellSize
;
REAL
minCellSize
;
REAL
obstacleDistance
;
unsigned
int
config
;
EnvMap
()
;
...
...
include/viewer.h
View file @
9138316e
...
...
@@ -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 @
9138316e
...
...
@@ -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
;
}
...
...
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