Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Thomas Pitiot
CGoGN
Commits
bc3fdd63
Commit
bc3fdd63
authored
Feb 01, 2011
by
Pierre Kraemer
Browse files
Options
Browse Files
Download
Plain Diff
Merge cgogn:~jund/CGoGN
parents
d4283bc0
5b0bb7a3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
19 deletions
+23
-19
Apps/Examples/SocialAgents/src/env_map.cpp
Apps/Examples/SocialAgents/src/env_map.cpp
+14
-11
include/Algo/MovingObjects/particle_cell_2D.hpp
include/Algo/MovingObjects/particle_cell_2D.hpp
+9
-8
No files found.
Apps/Examples/SocialAgents/src/env_map.cpp
View file @
bc3fdd63
...
...
@@ -218,18 +218,21 @@ Dart EnvMap::getBelongingCell(const PFP::VEC3& pos)
void
EnvMap
::
insertObstacleOfFace
(
PFP
::
AGENTS
agents
,
const
Dart
d
)
{
Dart
dd
=
d
;
do
{
if
(
closeMark
.
isMarked
(
dd
)
/*&& (position[map.phi2(dd)][2]==0.0 || position[map.phi1(map.phi2(dd))][2] ==0.0f)*/
)
{
for
(
PFP
::
AGENTS
::
iterator
it
=
agents
.
begin
();
it
!=
agents
.
end
();
++
it
)
{
// if(leftOf((*it)->part->m_position,position[dd],position[map.phi1(dd)])<0.0f) {
(
*
it
)
->
insertObstacleNeighbor
(
dd
);
// }
if
(
map
.
getDartLevel
(
map
.
faceOldestDart
(
d
))
==
0
)
{
Dart
dd
=
d
;
do
{
if
(
closeMark
.
isMarked
(
dd
)
/*&& (position[map.phi2(dd)][2]==0.0 || position[map.phi1(map.phi2(dd))][2] ==0.0f)*/
)
{
for
(
PFP
::
AGENTS
::
iterator
it
=
agents
.
begin
();
it
!=
agents
.
end
();
++
it
)
{
// if(leftOf((*it)->part->m_position,position[dd],position[map.phi1(dd)])<0.0f) {
(
*
it
)
->
insertObstacleNeighbor
(
dd
);
// }
}
// return;
}
// return;
}
dd
=
map
.
phi1
(
dd
);
}
while
(
dd
!=
d
);
dd
=
map
.
phi1
(
dd
);
}
while
(
dd
!=
d
);
}
}
void
EnvMap
::
getAllFacesOfAgents
(
Dart
d
)
...
...
include/Algo/MovingObjects/particle_cell_2D.hpp
View file @
bc3fdd63
...
...
@@ -75,10 +75,9 @@ void ParticleCell2D<PFP>::vertexState(const VEC3& current)
}
else
{
//orientation step
if
(
m_positions
[
d
][
0
]
==
m_positions
[
m
.
phi1
(
d
)][
0
]
&&
m_positions
[
d
][
1
]
==
m_positions
[
m
.
phi1
(
d
)][
1
])
d
=
m
.
alpha1
(
d
);
if
(
getOrientationEdge
(
current
,
m
.
alpha1
(
d
))
!=
Geom
::
RIGHT
)
{
if
(
m_positions
[
d
][
0
]
==
m_positions
[
m
.
phi1
(
d
)][
0
]
&&
m_positions
[
d
][
1
]
==
m_positions
[
m
.
phi1
(
d
)][
1
])
d
=
m
.
alpha1
(
d
);
Dart
dd_vert
=
d
;
do
{
d
=
m
.
alpha1
(
d
);
...
...
@@ -100,21 +99,24 @@ void ParticleCell2D<PFP>::vertexState(const VEC3& current)
}
}
else
{
if
(
m_positions
[
d
][
0
]
==
m_positions
[
m
.
phi1
(
d
)][
0
]
&&
m_positions
[
d
][
1
]
==
m_positions
[
m
.
phi1
(
d
)][
1
])
d
=
m
.
alpha1
(
d
);
std
::
cout
<<
"ploc"
<<
std
::
endl
;
Dart
dd_vert
=
m
.
alpha1
(
d
);
while
(
getOrientationEdge
(
current
,
d
)
==
Geom
::
RIGHT
&&
dd_vert
!=
d
)
{
std
::
cout
<<
"tourne"
<<
std
::
endl
;
d
=
m
.
alpha_1
(
d
);
if
(
m_positions
[
d
][
0
]
==
m_positions
[
m
.
phi1
(
d
)][
0
]
&&
m_positions
[
d
][
1
]
==
m_positions
[
m
.
phi1
(
d
)][
1
])
if
(
m_positions
[
d
][
0
]
==
m_positions
[
m
.
phi1
(
d
)][
0
]
&&
m_positions
[
d
][
1
]
==
m_positions
[
m
.
phi1
(
d
)][
1
])
{
d
=
m
.
alpha_1
(
d
);
}
}
}
//displacement step
// if(!obstacle.isMarked(d)) {
if
(
getOrientationEdge
(
current
,
d
)
==
Geom
::
ALIGNED
)
if
(
getOrientationEdge
(
current
,
d
)
==
Geom
::
ALIGNED
&&
Algo
::
Geometry
::
isPointOnHalfEdge
<
PFP
>
(
m
,
d
,
m_positions
,
current
))
{
std
::
cout
<<
m
.
vertexDegree
(
d
)
<<
std
::
endl
;
edgeState
(
current
);
}
else
{
d
=
m
.
phi1
(
d
);
faceState
(
current
);
...
...
@@ -200,7 +202,6 @@ void ParticleCell2D<PFP>::faceState(const VEC3& current)
edgeState
(
current
);
return
;
case
Geom
::
RIGHT
:
std
::
cout
<<
std
::
setprecision
(
10
);
std
::
cout
<<
"smthg went bad "
<<
m_position
<<
" "
<<
current
<<
std
::
endl
;
std
::
cout
<<
"d1 "
<<
m_positions
[
d
]
<<
" d2 "
<<
m_positions
[
m
.
phi1
(
d
)]
<<
std
::
endl
;
m_position
=
intersectLineEdge
(
current
,
m_position
,
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