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
5d17a127
Commit
5d17a127
authored
Jan 10, 2013
by
Thomas Jund
Browse files
petite amelioration path finding
parent
cc85941a
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/simulator.cpp
View file @
5d17a127
...
...
@@ -853,8 +853,15 @@ void Simulator::addPathsToAgents()
for
(
std
::
vector
<
Dart
>::
iterator
it
=
path
.
begin
()
;
it
!=
path
.
end
()
;
++
it
)
{
Dart
d
=
*
it
;
while
(
envMap_
.
map
.
isBoundaryEdge
(
d
))
{
d
=
envMap_
.
map
.
phi1
(
d
);
}
// VEC3 dest = Algo::Geometry::faceCentroid<PFP>(envMap_.map, *it, envMap_.position);
VEC3
dest
=
envMap_
.
position
[
*
it
]
+
envMap_
.
position
[
envMap_
.
map
.
phi1
(
*
it
)]
;
VEC3
dest
=
envMap_
.
position
[
d
]
+
envMap_
.
position
[
envMap_
.
map
.
phi1
(
d
)]
;
dest
/=
2.0
f
;
dest
[
2
]
=
0
;
...
...
@@ -882,8 +889,14 @@ void Simulator::addPathsToAgents()
for
(
std
::
vector
<
Dart
>::
iterator
it
=
path
.
begin
()
;
it
!=
path
.
end
()
;
++
it
)
{
Dart
d
=
*
it
;
while
(
envMap_
.
map
.
isBoundaryEdge
(
d
))
{
d
=
envMap_
.
map
.
phi1
(
d
);
}
// VEC3 dest = Algo::Geometry::faceCentroid<PFP>(envMap_.map, *it, envMap_.position);
VEC3
dest
=
envMap_
.
position
[
*
it
]
+
envMap_
.
position
[
envMap_
.
map
.
phi1
(
*
it
)]
;
VEC3
dest
=
envMap_
.
position
[
d
]
+
envMap_
.
position
[
envMap_
.
map
.
phi1
(
d
)]
;
dest
/=
2.0
f
;
dest
[
2
]
=
0
;
...
...
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