Commit 71fa7636 authored by Léo-Paul Géneau's avatar Léo-Paul Géneau 👾

erp5_officejs_drone_capture_flag: fix camera zoom in for small maps

parent a4b99d99
...@@ -1152,7 +1152,12 @@ var GameManager = /** @class */ (function () { ...@@ -1152,7 +1152,12 @@ var GameManager = /** @class */ (function () {
GameManager.prototype._init = function () { GameManager.prototype._init = function () {
var _this = this, canvas, hemi_north, hemi_south, camera, cam_radius, 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; canvas = this._canvas;
this._delayed_defer_list = []; this._delayed_defer_list = [];
this._dispose(); this._dispose();
...@@ -1189,9 +1194,11 @@ var GameManager = /** @class */ (function () { ...@@ -1189,9 +1194,11 @@ var GameManager = /** @class */ (function () {
this._scene this._scene
); );
hemi_south.intensity = 0.75; hemi_south.intensity = 0.75;
//HARDCODE camera to a hardcoded map_size
//skybox scene limit //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, camera = new BABYLON.ArcRotateCamera("camera", 0, 1.25, cam_radius,
BABYLON.Vector3.Zero(), this._scene); BABYLON.Vector3.Zero(), this._scene);
camera.wheelPrecision = 10; camera.wheelPrecision = 10;
......
...@@ -246,7 +246,7 @@ ...@@ -246,7 +246,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1017.22488.12960.6280</string> </value> <value> <string>1017.22725.640.819</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -266,7 +266,7 @@ ...@@ -266,7 +266,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1718705497.6</float> <float>1718719147.27</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -240,7 +240,7 @@ ...@@ -240,7 +240,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1017.22507.46137.47957</string> </value> <value> <string>1017.22776.41595.21691</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -260,7 +260,7 @@ ...@@ -260,7 +260,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1718706020.19</float> <float>1718722125.71</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment