Skip to content

Commit 628ff00

Browse files
author
Léna Voinchet
committed
Fix bug on "new sensor" and "new LiDAR" buttons
1 parent e249e0d commit 628ff00

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

js/scene/objects/SceneObjects.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,10 @@ class SceneObjects{
178178

179179
newCamera.addToScene(sceneManager.scene);
180180

181+
if (nodes.length > 0) {
182+
newCamera.changeFrustumVisibility(nodes[0].toggleFrustumOrNot);
183+
}
184+
181185
nodes.push(newCamera);
182186
this.nodeMeshes.push(newCamera.mesh);
183187

@@ -268,15 +272,15 @@ class SceneObjects{
268272
{
269273
if(!SceneObjects.font)
270274
{
271-
//TODO: Add UI to inform that button will work in few seconds
275+
// Add UI to inform that button will work in few seconds
272276
console.log("Add Lidar button will work in an instant");
273277
return;
274278
}
275279
const newLidar = new Lidar(this.numberOfLidarsCreated, typeID, x, z, r);
276280
this.numberOfLidarsCreated++;
277281
if(!isBuilder) newLidar.uiElement = new LidarUI(newLidar, sceneManager);
278282

279-
//Offset
283+
// Offset
280284
if(!autoConstruct)
281285
{
282286
for(let i = 0; i < lidars.length; i++)
@@ -292,6 +296,10 @@ class SceneObjects{
292296

293297
newLidar.addToScene(sceneManager.scene);
294298

299+
if (lidars.length > 0) {
300+
newLidar.changeRaysVisibility(lidars[0].toggleRaysToShape);
301+
}
302+
295303
lidars.push(newLidar);
296304
this.lidarsMeshes.push(newLidar.mesh);
297305

0 commit comments

Comments
 (0)