Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
SocialAgents3D
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thomas Pitiot
SocialAgents3D
Commits
9af93cb2
Commit
9af93cb2
authored
Mar 28, 2013
by
Thomas Jund
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ajout info brin dans obst
parent
7f81911e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
8 deletions
+20
-8
include/env_generator.hpp
include/env_generator.hpp
+1
-1
include/env_map.h
include/env_map.h
+1
-1
include/obstacle.h
include/obstacle.h
+4
-2
src/env_map.cpp
src/env_map.cpp
+4
-3
src/moving_obstacle.cpp
src/moving_obstacle.cpp
+10
-1
No files found.
include/env_generator.hpp
View file @
9af93cb2
...
...
@@ -375,7 +375,7 @@ Dart generateBuilding(EnvMap& envMap, Dart d, float height, unsigned int buildin
Dart
next
=
map
.
phi1
(
dd
)
;
Dart
previous
=
map
.
phi_1
(
dd
)
;
Obstacle
*
o
=
new
Obstacle
(
position
[
dd
],
position
[
next
],
position
[
previous
],
position
[
map
.
phi1
(
next
)],
NULL
,
0
);
position
[
map
.
phi1
(
next
)],
N
IL
,
NIL
,
N
ULL
,
0
);
#ifdef SPATIAL_HASHING
VEC3
ov
=
o
->
p2
-
o
->
p1
;
...
...
include/env_map.h
View file @
9af93cb2
...
...
@@ -33,7 +33,7 @@ class ArticulatedObstacle;
#include "pfp.h"
//#define EXPORTING3
#define TWO_AND_HALF_DIM
//
#define TWO_AND_HALF_DIM
#ifdef EXPORTING3
#include "Utils/Shaders/shaderPhongTexture.h"
...
...
include/obstacle.h
View file @
9af93cb2
...
...
@@ -6,9 +6,9 @@
class
Obstacle
{
public:
Obstacle
(
const
VEC3
point1
,
const
VEC3
point2
,
const
VEC3
prevPoint
,
const
VEC3
nextPoint
,
Obstacle
(
const
VEC3
point1
,
const
VEC3
point2
,
const
VEC3
prevPoint
,
const
VEC3
nextPoint
,
Dart
d_1
,
Dart
d_2
,
MovingObstacle
*
moving1
=
NULL
,
unsigned
int
ind
=
0
)
:
p1
(
point1
),
p2
(
point2
),
prevP
(
prevPoint
),
nextP
(
nextPoint
),
d1
(
d_1
),
d2
(
d_2
),
p1
(
point1
),
p2
(
point2
),
prevP
(
prevPoint
),
nextP
(
nextPoint
),
mo
(
moving1
),
index
(
ind
)
{
// p1[2] = 0 ;
...
...
@@ -17,6 +17,8 @@ public:
// nextP[2] = 0 ;
}
Dart
d1
;
Dart
d2
;
VEC3
p1
;
VEC3
p2
;
VEC3
prevP
;
...
...
src/env_map.cpp
View file @
9af93cb2
...
...
@@ -206,7 +206,7 @@ void EnvMap::init(unsigned int config, REAL width, REAL height, REAL minSize, RE
#ifndef SPATIAL_HASHING
map
.
init
()
;
//
registerObstaclesInFaces();
registerObstaclesInFaces
();
// TODO Check registerWallInFaces();
// registerWallInFaces() ;
// subdivideAllToMaxLevel();
...
...
@@ -613,7 +613,7 @@ void EnvMap::registerWallInFaces()
Dart
next
=
map
.
phi1
(
dd2
)
;
Dart
previous
=
map
.
phi_1
(
dd2
)
;
Obstacle
*
o
=
new
Obstacle
(
position
[
next
],
position
[
dd2
],
position
[
previous
],
position
[
map
.
phi1
(
next
)],
NULL
,
0
)
;
position
[
map
.
phi1
(
next
)],
next
,
dd2
,
NULL
,
0
)
;
obstvect
[
dd2
].
push_back
(
o
)
;
}
dd
=
map
.
phi1
(
dd
)
;
...
...
@@ -660,6 +660,7 @@ void EnvMap::registerObstaclesInFaces()
Dart
previous
=
map
.
phi_1
(
dd2
)
;
Obstacle
*
o
=
new
Obstacle
(
position
[
dd2
],
position
[
next
],
position
[
previous
],
position
[
map
.
phi1
(
next
)],
next
,
dd2
,
NULL
,
0
)
;
obstvect
[
d
].
push_back
(
o
)
;
}
...
...
@@ -711,7 +712,7 @@ void EnvMap::addNeighborObstacles(PFP::OBSTACLES& obst, Dart d, bool edgeNeighbo
Dart
next
=
map
.
phi1
(
dd2
)
;
Dart
previous
=
map
.
phi_1
(
dd2
)
;
Obstacle
*
o
=
new
Obstacle
(
position
[
dd2
],
position
[
next
],
position
[
previous
],
position
[
map
.
phi1
(
next
)],
NULL
,
0
)
;
position
[
map
.
phi1
(
next
)],
next
,
dd2
,
NULL
,
0
)
;
obst
.
push_back
(
o
)
;
// }
}
...
...
src/moving_obstacle.cpp
View file @
9af93cb2
...
...
@@ -272,7 +272,7 @@ MovingObstacle::MovingObstacle(Simulator* sim, int ind, std::vector<VEC3> pos, s
Obstacle
*
o
=
new
Obstacle
(
parts_
[
i
]
->
getPosition
(),
parts_
[(
i
+
1
)
%
nbVertices
]
->
getPosition
(),
parts_
[(
i
-
1
+
nbVertices
)
%
nbVertices
]
->
getPosition
(),
parts_
[(
i
+
2
)
%
nbVertices
]
->
getPosition
(),
this
,
i
);
parts_
[(
i
+
2
)
%
nbVertices
]
->
getPosition
(),
i
,
(
i
+
1
)
%
nbVertices
,
this
,
i
);
obstacles_
[
i
]
=
o
;
// CGoGNout<<" obstacle :"<< i << " num : "<< o<<CGoGNendl;
sim_
->
envMap_
.
pushObstacleInCells
(
o
);
...
...
@@ -750,7 +750,16 @@ void MovingObstacle::update()
// position[map.phi<211>(d)] += (velocity_ * sim_->timeStep_);
bary
+=
position
[
d
];
#ifdef TWO_AND_HALF_DIM
std
::
cout
<<
" dist supp "
<<
(
getDilatedPosition
(
i
)
-
parts_
[
i
]
->
getPosition
()).
norm
()
<<
std
::
endl
;
#endif
parts_
[
i
]
->
move
(
getDilatedPosition
(
i
));
#ifdef TWO_AND_HALF_DIM
std
::
cout
<<
" dist "
<<
parts_
[
i
]
->
getDistance
()
<<
std
::
endl
;
position
[
d
]
=
parts_
[
i
]
->
getPosition
();
#endif
map
.
next
(
d
);
}
...
...
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