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
7f72f657
Commit
7f72f657
authored
Mar 05, 2015
by
pitiot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
up
parent
bbc8a3a9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
6 deletions
+13
-6
include/surface.h
include/surface.h
+1
-0
include/utils.h
include/utils.h
+6
-1
src/surface.cpp
src/surface.cpp
+6
-5
No files found.
include/surface.h
View file @
7f72f657
...
...
@@ -25,6 +25,7 @@ public:
SURFACE
surfaceMap
;
// map
VertexAttribute
<
VEC3
,
SURFACE
>
positionSurface
;
//position
VertexAttribute
<
int
,
SURFACE
>
indexParticule
;
// index des particules de chaque sommet
EdgeAttribute
<
int
,
SURFACE
>
indexSegment
;
void
initPlane
();
//initialisation d'une grille
// visualisation
...
...
include/utils.h
View file @
7f72f657
...
...
@@ -8,7 +8,6 @@
#include "Geometry/vector_gen.h"
#define abs(x) ((x) >= 0 ? (x) : -(x))
typedef
CGoGN
::
Geom
::
Vec3f
VEC3
;
static
const
float
RVO_EPSILON
=
0
.
00001
f
;
...
...
@@ -25,6 +24,12 @@ inline float det2D(const VEC3& vector1, const VEC3& vector2)
}
inline
float
abs
(
float
x
)
{
return
(
x
)
>=
0
?
(
x
)
:
-
(
x
);
}
// dist3D_Segment_to_Segment(): get the 3D minimum distance between 2 segments
// Input: two 3D line segments S1 and S2
// Return: the shortest distance between S1 and S2
...
...
src/surface.cpp
View file @
7f72f657
...
...
@@ -6,6 +6,7 @@ Surface::Surface(Simulator* sim,VEC3 offset)
surfaceMap
.
initImplicitProperties
();
positionSurface
=
surfaceMap
.
addAttribute
<
VEC3
,
VERTEX
,
SURFACE
>
(
"positionSurface"
);
indexParticule
=
surfaceMap
.
addAttribute
<
int
,
VERTEX
,
SURFACE
>
(
"indexParticule"
);
indexSegment
=
surfaceMap
.
addAttribute
<
int
,
EDGE
,
SURFACE
>
(
"indexSegment"
);
initPlane
();
index_articulated
=
sim
->
objects
.
size
();
...
...
@@ -38,7 +39,7 @@ Surface::Surface(Simulator* sim,VEC3 offset)
CGoGNout
<<
" init Segment :"
<<
nbEdges
;
CGoGNout
<<
" || nb_segments :"
<<
Segments_
.
size
()
<<
CGoGNendl
;
#endif
indexSegment
[
d
]
=
nbEdges
;
unsigned
int
ind1
=
indexParticule
[
d
];
unsigned
int
ind2
=
indexParticule
[
surfaceMap
.
phi1
(
d
)];
Segment
*
o
=
new
Segment
(
parts_
[
ind1
]
->
getPosition
(),
...
...
@@ -63,16 +64,16 @@ void Surface::initGL()
m_simpleColorShader
->
setAttributePosition
(
m_positionVBO
);
m_simpleColorShader
->
setColor
(
Geom
::
Vec4f
(
0.
,
1.
,
0.
,
0.
));
m_positionVBO
->
updateData
(
position
)
;
m_positionVBO
->
updateData
(
position
Surface
)
;
m_render
->
initPrimitives
<
PFP
2
>
(
m
ap
,
Algo
::
Render
::
GL2
::
TRIANGLES
)
;
m_render
->
initPrimitives
<
PFP
2
>
(
m
ap
,
Algo
::
Render
::
GL2
::
LINES
)
;
m_render
->
initPrimitives
<
PFP
Surface
>
(
surfaceM
ap
,
Algo
::
Render
::
GL2
::
TRIANGLES
)
;
m_render
->
initPrimitives
<
PFP
Surface
>
(
surfaceM
ap
,
Algo
::
Render
::
GL2
::
LINES
)
;
}
void
Surface
::
draw
()
{
m_positionVBO
->
updateData
(
position
)
;
m_positionVBO
->
updateData
(
position
Surface
)
;
m_simpleColorShader
->
setColor
(
Geom
::
Vec4f
(
1.0
,
0.627
,
0.0
,
0.
));
m_render
->
draw
(
m_simpleColorShader
,
Algo
::
Render
::
GL2
::
TRIANGLES
);
...
...
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