Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
erp5
Commits
37d0a9bd
Commit
37d0a9bd
authored
Jul 30, 2024
by
Léo-Paul Géneau
👾
Browse files
Options
Browse Files
Download
Plain Diff
erp5_officejs_drone_capture_flag: fix projection proportionality
See merge request
!1959
parents
40aad952
3c4eeac8
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
352 additions
and
266 deletions
+352
-266
bt5/erp5_officejs_drone_capture_flag/PathTemplateItem/web_page_module/drone_capture_flag_logic_js.js
...mplateItem/web_page_module/drone_capture_flag_logic_js.js
+26
-26
bt5/erp5_officejs_drone_capture_flag/PathTemplateItem/web_page_module/drone_capture_flag_logic_js.xml
...plateItem/web_page_module/drone_capture_flag_logic_js.xml
+2
-2
bt5/erp5_officejs_drone_capture_flag/PathTemplateItem/web_page_module/drone_capture_flag_map_utils_js.js
...teItem/web_page_module/drone_capture_flag_map_utils_js.js
+149
-137
bt5/erp5_officejs_drone_capture_flag/PathTemplateItem/web_page_module/drone_capture_flag_map_utils_js.xml
...eItem/web_page_module/drone_capture_flag_map_utils_js.xml
+2
-2
bt5/erp5_officejs_drone_capture_flag_test/PathTemplateItem/portal_tests/drone_capture_flag_ui_site_zuite/testDroneCaptureFlagFlight.zpt
...capture_flag_ui_site_zuite/testDroneCaptureFlagFlight.zpt
+5
-5
bt5/erp5_officejs_drone_simulator/PathTemplateItem/web_page_module/drone_simulator_logic_js.js
...hTemplateItem/web_page_module/drone_simulator_logic_js.js
+161
-87
bt5/erp5_officejs_drone_simulator/PathTemplateItem/web_page_module/drone_simulator_logic_js.xml
...TemplateItem/web_page_module/drone_simulator_logic_js.xml
+2
-2
bt5/erp5_officejs_drone_simulator_test/PathTemplateItem/portal_tests/drone_simulator_ui_site_zuite/testDroneSimulatorFlight.zpt
...rone_simulator_ui_site_zuite/testDroneSimulatorFlight.zpt
+5
-5
No files found.
bt5/erp5_officejs_drone_capture_flag/PathTemplateItem/web_page_module/drone_capture_flag_logic_js.js
View file @
37d0a9bd
...
...
@@ -524,14 +524,11 @@ var MapManager = /** @class */ (function () {
_this
.
map_info
.
initial_position
.
longitude
,
_this
.
map_info
.
initial_position
.
altitude
);
max
=
_this
.
map_info
.
width
;
if
(
_this
.
map_info
.
depth
>
max
)
{
max
=
_this
.
map_info
.
depth
;
}
if
(
_this
.
map_info
.
height
>
max
)
{
max
=
_this
.
map_info
.
height
;
}
max
=
max
<
_this
.
map_info
.
depth
?
_this
.
map_info
.
depth
:
max
;
max
=
Math
.
max
(
_this
.
map_info
.
depth
,
_this
.
map_info
.
height
,
_this
.
map_info
.
width
);
// Skybox
max_sky
=
(
max
*
15
<
20000
)
?
max
*
15
:
20000
;
//skybox scene limit
skybox
=
BABYLON
.
MeshBuilder
.
CreateBox
(
"
skyBox
"
,
{
size
:
max_sky
},
scene
);
...
...
@@ -558,13 +555,13 @@ var MapManager = /** @class */ (function () {
largeGroundBottom
.
renderingGroupId
=
1
;
// Terrain
// Give map some margin from the flight limits
width
=
_this
.
map_info
.
width
*
1.
1
0
;
depth
=
_this
.
map_info
.
depth
*
1.
1
0
;
width
=
_this
.
map_info
.
width
*
1.
3
0
;
depth
=
_this
.
map_info
.
depth
*
1.
3
0
;
//height = _this.map_info.height;
terrain
=
scene
.
getMeshByName
(
"
terrain001
"
);
terrain
.
isVisible
=
true
;
terrain
.
position
=
BABYLON
.
Vector3
.
Zero
();
terrain
.
scaling
=
new
BABYLON
.
Vector3
(
depth
/
50000
,
depth
/
50000
,
terrain
.
scaling
=
new
BABYLON
.
Vector3
(
depth
/
50000
,
_this
.
map_info
.
height
/
50000
,
width
/
50000
);
// Enemies
_this
.
_enemy_list
=
[];
...
...
@@ -697,12 +694,6 @@ var MapManager = /** @class */ (function () {
MapManager
.
prototype
.
latLonDistance
=
function
(
c1
,
c2
)
{
return
this
.
mapUtils
.
latLonDistance
(
c1
,
c2
);
};
MapManager
.
prototype
.
longitudToX
=
function
(
lon
)
{
return
this
.
mapUtils
.
longitudToX
(
lon
);
};
MapManager
.
prototype
.
latitudeToY
=
function
(
lat
)
{
return
this
.
mapUtils
.
latitudeToY
(
lat
);
};
MapManager
.
prototype
.
convertToLocalCoordinates
=
function
(
latitude
,
longitude
,
altitude
)
{
return
this
.
mapUtils
.
convertToLocalCoordinates
(
...
...
@@ -862,12 +853,14 @@ var GameManager = /** @class */ (function () {
GameManager
.
prototype
.
_checkDroneOut
=
function
(
drone
)
{
if
(
drone
.
position
)
{
var
map_limit
=
this
.
_mapManager
.
getMapInfo
().
map_size
/
2
;
return
(
drone
.
position
.
z
>
this
.
_mapManager
.
getMapInfo
().
height
)
||
(
drone
.
position
.
x
<
-
map_limit
)
||
(
drone
.
position
.
x
>
map_limit
)
||
(
drone
.
position
.
y
<
-
map_limit
)
||
(
drone
.
position
.
y
>
map_limit
);
var
map_info
=
this
.
_mapManager
.
getMapInfo
(),
width_limit
=
map_info
.
width
/
2
,
depth_limit
=
map_info
.
depth
/
2
;
return
(
drone
.
position
.
z
>
map_info
.
height
)
||
(
drone
.
position
.
x
<
-
width_limit
)
||
(
drone
.
position
.
x
>
width_limit
)
||
(
drone
.
position
.
y
<
-
depth_limit
)
||
(
drone
.
position
.
y
>
depth_limit
);
}
};
...
...
@@ -1159,7 +1152,12 @@ var GameManager = /** @class */ (function () {
GameManager
.
prototype
.
_init
=
function
()
{
var
_this
=
this
,
canvas
,
hemi_north
,
hemi_south
,
camera
,
cam_radius
,
on3DmodelsReady
,
map_size
=
900
;
//GAMEPARAMETERS.map.map_size
on3DmodelsReady
,
mapUtils
=
new
MapUtils
(
GAMEPARAMETERS
.
map
),
map_size
=
Math
.
max
(
mapUtils
.
map_info
.
depth
,
mapUtils
.
map_info
.
height
,
mapUtils
.
map_info
.
width
);
canvas
=
this
.
_canvas
;
this
.
_delayed_defer_list
=
[];
this
.
_dispose
();
...
...
@@ -1196,9 +1194,11 @@ var GameManager = /** @class */ (function () {
this
.
_scene
);
hemi_south
.
intensity
=
0.75
;
//HARDCODE camera to a hardcoded map_size
//skybox scene limit
cam_radius
=
(
map_size
*
1.10
<
6000
)
?
map_size
*
1.10
:
6000
;
cam_radius
=
Math
.
min
(
1.10
*
Math
.
sqrt
(
mapUtils
.
map_info
.
width
*
mapUtils
.
map_info
.
depth
),
6000
);
camera
=
new
BABYLON
.
ArcRotateCamera
(
"
camera
"
,
0
,
1.25
,
cam_radius
,
BABYLON
.
Vector3
.
Zero
(),
this
.
_scene
);
camera
.
wheelPrecision
=
10
;
...
...
bt5/erp5_officejs_drone_capture_flag/PathTemplateItem/web_page_module/drone_capture_flag_logic_js.xml
View file @
37d0a9bd
...
...
@@ -246,7 +246,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
101
6.21978.22579.46609
</string>
</value>
<value>
<string>
101
7.22735.36044.31948
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -266,7 +266,7 @@
</tuple>
<state>
<tuple>
<float>
171
4742387.62
</float>
<float>
171
8719762.65
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs_drone_capture_flag/PathTemplateItem/web_page_module/drone_capture_flag_map_utils_js.js
View file @
37d0a9bd
This diff is collapsed.
Click to expand it.
bt5/erp5_officejs_drone_capture_flag/PathTemplateItem/web_page_module/drone_capture_flag_map_utils_js.xml
View file @
37d0a9bd
...
...
@@ -242,7 +242,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
101
1.57448.22674.29627
</string>
</value>
<value>
<string>
101
7.22488.12960.6280
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -262,7 +262,7 @@
</tuple>
<state>
<tuple>
<float>
1
697557365.44
</float>
<float>
1
718708011.02
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs_drone_capture_flag_test/PathTemplateItem/portal_tests/drone_capture_flag_ui_site_zuite/testDroneCaptureFlagFlight.zpt
View file @
37d0a9bd
...
...
@@ -44,11 +44,6 @@
<td>
//div[contains(text(), 'CONSOLE LOG ENTRIES:')]
</td>
<td></td>
<tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//div[contains(text(), 'Simulation finished')]
</td>
<td></td>
<tr>
<tr>
<td>
assertElementPresent
</td>
<td>
//div[contains(text(), 'Initial speed: OK')]
</td>
...
...
@@ -84,6 +79,11 @@
<td>
//div[contains(text(), 'Altitude: OK')]
</td>
<td></td>
<tr>
<tr>
<td>
assertElementPresent
</td>
<td>
//div[contains(text(), 'Timeout: OK')]
</td>
<td></td>
<tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
bt5/erp5_officejs_drone_simulator/PathTemplateItem/web_page_module/drone_simulator_logic_js.js
View file @
37d0a9bd
This diff is collapsed.
Click to expand it.
bt5/erp5_officejs_drone_simulator/PathTemplateItem/web_page_module/drone_simulator_logic_js.xml
View file @
37d0a9bd
...
...
@@ -240,7 +240,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
101
6.21987.28184.16844
</string>
</value>
<value>
<string>
101
7.22776.49981.4147
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -260,7 +260,7 @@
</tuple>
<state>
<tuple>
<float>
171
4742619.34
</float>
<float>
171
8722284.77
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs_drone_simulator_test/PathTemplateItem/portal_tests/drone_simulator_ui_site_zuite/testDroneSimulatorFlight.zpt
View file @
37d0a9bd
...
...
@@ -54,11 +54,6 @@
<td>
//div[contains(text(), 'CONSOLE LOG ENTRIES:')]
</td>
<td></td>
<tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//div[contains(text(), 'Simulation finished')]
</td>
<td></td>
<tr>
<tr>
<td>
assertElementPresent
</td>
<td>
//div[contains(text(), 'Initial speed: OK')]
</td>
...
...
@@ -94,6 +89,11 @@
<td>
//div[contains(text(), 'Altitude: OK')]
</td>
<td></td>
<tr>
<tr>
<td>
assertElementPresent
</td>
<td>
//div[contains(text(), 'Timeout: OK')]
</td>
<td></td>
<tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
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