brianzinn Posted December 2, 2017 Share Posted December 2, 2017 Just a question about floorMeshName. export interface VRTeleportationOptions { floorMeshName?: string; // If you'd like to provide a mesh acting as the floor floorMeshes?: Mesh[]; } I was expecting from that comment a different comparison than (https://github.com/BabylonJS/Babylon.js/blob/master/src/Cameras/VR/babylon.vrExperienceHelper.ts#L498) if (this._floorMeshName && mesh.name === this._floorMeshName) { return true; } Otherwise if you set the floor mesh name to 'ground' and then had another mesh like 'ground-cover' or any mesh 'ground' as a substring would be teleportable. Quote Link to comment Share on other sites More sharing options...
Sebavan Posted December 2, 2017 Share Posted December 2, 2017 yup definitely agree. Ping @davrous Quote Link to comment Share on other sites More sharing options...
brianzinn Posted December 2, 2017 Author Share Posted December 2, 2017 If that's the case then assuming the mesh already exists you could do here (https://github.com/BabylonJS/Babylon.js/blob/master/src/Cameras/VR/babylon.vrExperienceHelper.ts#L511): if (vrTeleportationOptions) { if (vrTeleportationOptions.floorMeshes && Array.isArray(vrTeleportationOptions.floorMeshes)) { this._floorMeshesCollection = vrTeleportationOptions.floorMeshes; } if (vrTeleportationOptions.floorMeshName) { let floorMesh = this_scene.getMeshByName(vrTeleportationOptions.floorMeshName); if (floorMesh) { this.addFloorMesh(floorMesh); // assuming you added a method to add/remove meshes or this._floorMeshesCollection.push(floorMesh) } } } I like highlightLayer addMesh() and removeMesh(). Glad to see the floor mesh collection added, as I have a bunch of teleportable meshes! I guess I'm just expecting it to work like HighlightLayer/ShadowGenerator to allow changed after enabling teleportation I'm happy to do a PR. Looks incredible in Windows Mixed Reality. Quote Link to comment Share on other sites More sharing options...
davrous Posted December 2, 2017 Share Posted December 2, 2017 Yep you're right! Please do a PR to change that. When providing a collection of meshes I'm comparing to the ID. So, we won't have this problem. Quote Link to comment Share on other sites More sharing options...
Sebavan Posted December 2, 2017 Share Posted December 2, 2017 PR in progress will test Monday before merging Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.