Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
NetWorld
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Fatus
NetWorld
Commits
200074e4
Commit
200074e4
authored
Oct 20, 2020
by
guillaume
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
triangle visualisation of edges
parent
cd2ad1d2
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
1435 additions
and
2 deletions
+1435
-2
README.md
README.md
+7
-0
controlpanel.c
src/controlpanel.c
+16
-1
controlpanel.h
src/controlpanel.h
+9
-0
main-risky
src/main-risky
+0
-0
main-viewer.c
src/main-viewer.c
+1
-1
raymath.h
src/raymath.h
+1402
-0
No files found.
README.md
View file @
200074e4
...
...
@@ -11,6 +11,13 @@ Projet conçu pour une compilation avec GCC et la librairie Raylib. De par la na
⚠️ Bien prendre le temps de lire la section d'installation qui vous concerne ⚠️
```
mermaid
graph TD;
Antho-->Bobby;
Antho-->Clariss;
Bobby-->Dede;
Clariss-->Dede;
```
### Linux (Debian based, *e.g.* Ubuntu) - Fortement recommandé
---
...
...
src/controlpanel.c
View file @
200074e4
#include "controlpanel.h"
#include "raylib.h"
#include "raymath.h"
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
// Tools
void
printVector2
(
Vector2
v
)
{
printf
(
"[%3f, %3f]"
,
v
.
x
,
v
.
y
);
}
// Constructor / Destructor
Panel
*
Panel_new
()
{
...
...
@@ -86,7 +93,15 @@ void Panel_drawEdge(Panel * self, Edge * e)
Vector2
source
=
Panel_pixelFromPosition
(
self
,
&
(
e
->
_source
->
position
)
);
Vector2
target
=
Panel_pixelFromPosition
(
self
,
&
(
e
->
_target
->
position
)
);
DrawLineV
(
source
,
target
,
BLUE
);
Vector2
ortho
=
(
Vector2
){
target
.
x
-
source
.
x
,
target
.
y
-
source
.
y
};
// Vector from Source to Target
float
ratio
=
10
.
f
/
Vector2Length
(
ortho
);
ortho
=
(
Vector2
){
-
ortho
.
y
*
ratio
,
ortho
.
x
*
ratio
};
// 10 ortho-normal vector from v
Vector2
source1
=
(
Vector2
){
source
.
x
-
ortho
.
x
,
source
.
y
-
ortho
.
y
};
Vector2
source2
=
(
Vector2
){
source
.
x
+
ortho
.
x
,
source
.
y
+
ortho
.
y
};
DrawTriangle
(
source1
,
source2
,
target
,
BLUE
);
}
Vector2
Panel_pixelFromPosition
(
Panel
*
self
,
Vector2
*
p
)
...
...
src/controlpanel.h
View file @
200074e4
...
...
@@ -3,6 +3,15 @@
#include "networld.h"
// Tools
void
printVector2
(
Vector2
v
);
//-----------------------------------//
//-- Cotrol Panel --//
//-----------------------------------//
struct
Str_Panel
{
Vector2
camera
,
screenCenter
;
float
scale
;
// meter per pixel
...
...
src/main-risky
0 → 100644
View file @
200074e4
src/main-viewer.c
View file @
200074e4
...
...
@@ -37,7 +37,7 @@ int main(int nbArg, char ** arg)
NetWorld_connect
(
world
,
0
,
1
);
NetWorld_connect
(
world
,
1
,
2
);
NetWorld_connect
(
world
,
2
,
0
);
NetWorld_
bi
connect
(
world
,
2
,
0
);
Panel
*
panel
=
Panel_new
();
Panel_initialize
(
panel
,
world
);
...
...
src/raymath.h
0 → 100644
View file @
200074e4
This diff is collapsed.
Click to expand it.
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