• Content Count

  • Joined

  • Last visited

  1. Oh wow, moving to TS 3 and BabylonJS 3.3.0 made it work! I had been on TS 2.9.2 before.
  2. I don't have a GearVR to hand, so I don't have a sense of how similar they are (GearVR is described as "powered by Oculus" and it's also 3DoF). I'm very happy so far with how the Oculus Go controller works in babylonjs 3.3.0b4, it feels very close to the native controller UX on the device.
  3. Wow that was fast! Do you know if it's possible to try this out using npm? I thought I'd be able to do repo#commit: "dependencies": { "babylonjs": "git+https://github.com/BabylonJS/Babylon.js.git#685b8f0f4babca6fa1fef13f24991f5cafa107d8" But the new method doesn't seem to be included
  4. I'm able to pick sprites with Scene.pickSprite, but is there a way to pick them with scene.pickWithRay? PickWithRay only seems to return meshes (I've set isPickable to true on the sprites and confirmed that they're pickable with Scene.pickSprite). The use-case is, I'm trying to pick sprites with a 3DoF VR Controller, so I don't have a 2d pointerX and pointerY to work with, only the controller's forward ray. I'm thinking that my options are: a. Use Vector3.Project to try to unproject the pickedPoint of pickWithRay (I'm using a skybox, so the ray will always hit something), then put that point into Scene.pickSprite. I tried this quickly, but I think the unprojected point might be off b. replace the sprites with billboarded mesh instances that can directly be hit with pickWithRay. I suspect this might be the easiest option? Or is there some easier way to pick a sprite with a ray?
  5. Definitely learning a lot! Thanks for your help with this
  6. Latest update: All my issues with the Oculus Go controller have been fixed by moving from babylonjs 3.2.0 to the latest beta 3.3.0b4. I no longer need to supply my own GLTF controller model, or mess around with the pivot point to reposition it. While googling, I found this PR which addresses the issue I was having above with the controller not being down by your right hand side and so on https://github.com/BabylonJS/Babylon.js/pull/4289/files , then realised it was merged in July, after the 3.2.0 release.
  7. Findings so far: 1. PickingInfo Sadly, pointerObservables don't work on the Oculus Go when in full VR mode (apparently other headsets do map the controllers to pointer events). However, you can get pickingInfo using the controller's forward ray, eg: vrHelper.onControllerMeshLoadedObservable.add(controller => { controller.onButtonStateChange((controlIndex, buttonIndex, button) => { const ray = controller.getForwardRay(48); const pickInfo = scene.pickWithRay(ray, mesh => { return !mesh.name.includes("laserPointer"); }); If you're showing the laser beam, you'll need to exclude it from the ray's mesh predicate. If you're using a gazeTrackerMesh though, you could just use the position of the tracker mesh, and save yourself an extra raycast. 2. customizing the controller mesh Babylon attempts to load a controller model from a .babylon file. This fails for me, possibly because of a mimetype issue with .babylon files. As a fallback, a long thin cylinder is shown. This is quite ugly though, as the origin of the cylinder is your head, so it pokes you right in the eye. controller.AttachToMesh has no effect in this case, the cylinder remains visible (unless I've misunderstood the API this doesn't seem like the desired behaviour, I think I'd like to raise this as a bug). To get round this, I converted the controller.babylon file to gltf using a playground https://playground.babylonjs.com/ts.html#D1N0MZ#4 put the GLTF files in my project, and override them as the default controller the method suggested by @brianzinn: BABYLON.GearVRController.MODEL_BASE_URL = "assets/geometries/vrController/"; BABYLON.GearVRController.MODEL_FILENAME = "controller.gltf"; It feels like I should be able to use controller.AttachToMesh to use the gltf model rather than overriding these static values. The next thing I need to work out is: 3. how to offset the position of the controller Oculus Go is a 3DoF system, meaning that the position of the controller is somewhat arbitrary. Throughout the rest of the Oculus UX, the controller appears in the lower-right corner of your field-of-vision, as if you're holding it in your righthand at around waist height. In WebVR mode though, it's position is right in front of your face. So far I've just been manipulating the pivot matrix of the controller mesh to move it down to the corner. This isn't the correct way to do this though, because if I rotate the controller in my hands around its forward axis, the onscreen controller will loop around to the top of the screen, because of the large pivot offset I've given it. I'm sure there must be some attribute somewhere that I need to set (I thought I might be able to set controller.devicePosition but it doesn't appear to have an effect), I'll continue digging. Massive thanks to @brianzinn for all his help so far!
  8. Oh wait a minute I think I know what it is. Logging those MODEL_FILENAME that you posted, they all point to .babylon files. Maybe its the same issue I'm having on the .env thread of not being able to serve certain file types, and that long thin cylinder is a fallback.
  9. Yeah, scene.onPointerObservable definitely doesn't fire on the Oculus Go when you're in full VR mode (but does fire in browser mode). That annoying cylinder I see poking me in the eye can be turned off with controller.mesh.setEnabled(false) What's weird, is that when I go to the Fruit Ninja playground, that same controller mesh is an actual model of the controller (looks a bit different, maybe its a model of the GearVR), kind of like what you see elsewhere in the Oculus Go UX. How come the controller.mesh I see is just a long thin cylinder, but the one in the playground is an actual model of the controller? I'm running on the npm version of BabylonJS 3.2.0, could it be that the playground uses a slightly different version, with different bundled assets?
  10. @brianzinn thanks for that, loads of things for me to try out there. On your first point, I do have scene.onPointerObservable set up, and it doesn't seem to be firing when in full VR mode (though it does when in "browser" mode, when you're looking at a virtual screen showing the web browser), I'll need to double-check that it isn't firing.
  11. I borrowed an Oculus Go from work, here are some first impressions/ questions. Overall I'm really impressed with the hardware. It's comfortable to wear, resolution and FPS seem fine to me. My only other VR headset experiences have been cardboard and a Samsung one (forget which it was), Oculus Go is better than either of those. As a dev device, I've not downloaded any SDK or looked at any dev doc, I just point the device's browser at http://<my laptop's IP address>:8080 and off I go (no JS console tho!) It's amazing how much the following one line of code gets you: const vrHelper = scene.createDefaultVRExperience({ createDeviceOrientationCamera: false }); it gives you a VR icon on the screen. When you tap it, Oculus Go launches into fullscreen VR. Looking around looks great, works seamlessly out the box. Worth noting that Oculus Go is a 3 DOF system, rather than 6 DoF. Meaning that it only tracks orientation of the headset (and the controller too? Need to double-check this), not its position. Where I have run into some difficulties is with the controller. I'm currently trying to implement so that the user can point at a mesh with the controller, and pull the trigger to select a point on that mesh. I'm going to list some of these in this thread. Bearing in mind I've only had the device for a few hours. If anyone has suggestions for these issues, would be great to hear. 1. getting PickingInfo So far I've only been able to get PickingInfo with vrHelper.onNewMeshPicked this only fires when the pointer first moves over the mesh, regardless of whether the user is pressing one of the buttons or not. The callback for picking up button changes controller.onButtonStateChange returns info about the button, but no pickInfo. I guess I need to call scene.Pick inside the button state change callback, haven't had time to try this yet. 2. customizing the controller mesh When you enable interactivity with vrHelper.enableInteractions(); The default mesh for the controller is a long, thin cylinder that stretches from where you're pointing, right up to your eyes. It's really in-your-face, and I haven't found a way to modify or disable it yet. This doesn't have any effect: vrHelper.displayGaze = false; And neither did trying to apply a custom mesh with controller[0].attachToMesh(mesh) I've got to be offline for a few hours now, but I'll keep experimenting. If anyone has questions, tips, please do post.
  12. @Deltakosh sorry about that. I'm struggling actually to get npm/webpack to send babylon-max instead of the minified one. I upload the source and then the build happens on the server, so I can't just manually copy the max file across. edit: I think I've thought of a way to do this, I'll try again tomorrow.
  13. @Deltakosh sure, here's a version that falls down right away with the "cannot load cubemap" issue https://sky-explorer-birfeajogq.now.sh/ You can view the source here https://sky-explorer-birfeajogq.now.sh/_src
  14. If it is a mimetype issue though, how come I get a 200 network response for the .env file when I try loading it with assetManager.addBinaryFileTask?