aframe-extras
aframe-extras copied to clipboard
[nav-mesh] Is it possible to get, if camera has collided with nav-mesh entity?
I am using a joystick that doesn't belong to the movement-controls and I would like to know if it's possible to make that connection.
I want to do the same thing - use the joystick component and constrain it to the navmesh, just like the other movement controls. I suppose the way to go is use the custom-controls method described in the movement-controls readme, but I haven't gotten that to work yet. A temporary solution for me is to attach the event listener of the touch-control to the joystick element rather than the full screen canvas, like so https://servicemedia.net/webxr/lxSD4sRN1. But a constrainable joystick control would be nicer.
Hi @polytropoi How do you do to have navmesh working with aframe 1.2.0 in your demo? it don't work for me, you have something custom? Thanks
edit : your movement-controls is broken on last chrome 97 I posted a issue, I have same problem with aframe 1.1.0 : https://github.com/n5ro/aframe-extras/issues/371
I would like to know that, too! First of all - great example! But the NavMesh in there seems to be somewhat off?
It's not clear to me what the question is here. It seems the question was asked when navmesh was broken? I'm closing the issue. Feel free to reopen to clarify if needed.
It's not clear to me what the question is here. It seems the question was asked when navmesh was broken? I'm closing the issue. Feel free to reopen to clarify if needed.
Hi! When I was doing a project, I was using another component of movement control that doesn't belong to aframe-extras. So what I wanted was match the collision function with that component I mentioned. I dont think this is a problem, but if there was something like that it would make nav-mesh usability more flexible
The navmesh is just an entity with a geometry, you should be able to have like a sphere-collider on camera (but you probably want the collider to go through the ground unless you really have your head on the floor in reality lol) and use the hit or hitend event when it collides with the navmesh entity I think.
In aframe-xr-boilerplate, you have an example of using a sphere-collider on right index finger (with hands tracking on Quest), that can touch the watch on your left hand to exit immersive mode. Relevant code here https://github.com/AdaRoseCannon/aframe-xr-boilerplate/blob/638c4c3693c73f7463137da91b027a62bf868ad8/index.html#L115-L117 and https://github.com/AdaRoseCannon/aframe-xr-boilerplate/blob/638c4c3693c73f7463137da91b027a62bf868ad8/main.js#L69-L81
In your case the watch is the navmesh, the right index finger is your camera I guess.
Reusing the navmesh collision detection from https://github.com/donmccurdy/three-pathfinding, I don't know, you will need to look at the code there I guess. Reading the documentation there I couldn't find an obvious event to use. I'll reopen the issue. If anyone found something, they can answer.
I ended up solving, but I don't think that was the greatest solution. What I did was create a parent entity with movement-controls enabled with constrainToNavMesh ( I don't even know if its still the same way to do it lol ) positioned on the floor and a child entity with the camera property ( this entity would be my user and is using the movement component that doesn't belong in aframe-extras). After that, I copied part of collision code and added in move component which didn't belong in aframe-extras.
This seems to be a correct solution. You more or less implemented a custom controls but without properly using the movement-controls api I guess ;-)
could be, idk lol... But maybe, would be great have a variable like isColliding that allow us to use outside of aframe-extras so you don't need to copy any code. Tbh...idk
Yeah I understand. I'll dig in the three-pathfinding code another day. :)
I'm just reading back the comments here. You implemented your own joystick controls so it is constrained to the navmesh? It wasn't the case with gamepad-controls before? That's why you created the issue initially? I just tested the castle example with the Meta Quest joysticks, it's working properly, I stop on walls, I can't go through.
No, I got a ready code of joystick code so what I did was connect this joystick with navmesh. Gamepad-controls? idk.. What I wanted was when I was using my application in desktop I would use WASD to move, but when I was in my mobile device, I would use this joystick. I created my own nav-mesh geometry but when I was using the joystick I was able to go through walls lol
Ah a virtual joystick on mobile, not physical ones, alright, it makes sense. I also want to add in this repository a new controls to add two virtual joysticks for mobile and tablet at one point.
I just created a feature issue for that #398
Ah a virtual joystick on mobile, not physical ones, alright, it makes sense. I also want to add in this repository a new controls to add two virtual joysticks for mobile and tablet at one point.
It would be awesome!!
I forgot to close this issue. We have nipple-controls now.