WebXR Teleportation Questions / Feature requests

@RaananW thanks for fixing the teleportation “sticking” issue! That was really bothering me and I was about to ask in here about that but did a search first and saw a github issue investigation about it with 4.2 milestone. I upgraded my cdn to use preview and bam! Works like a charm now in Oculus Quest. Thanks so much!

If I’m nitpicking, I wonder if the following things can be easily tweaked/configured?

  1. The arc rendering only kicks in when trying to teleport very far away. If I teleport any closer, I don’t see an arc I only see a straight line to the target circle which is not as pretty. In fact the arc only shows up when I lift up a controller to about 40-45 degrees above horizontal. Is there a way to make this configurable? In some games that I play I see the teleportation arc rendering for even 1 or 2 meters away, which I like. And in those games they render smaller arcs instead of the extremely high parabola that is currently rendered by Babylonjs teleporation.

  2. In my experience the target circle being drawn is bit big. Any thoughts on allowing options to change the radius of the circle?

  3. Is it possible to have no color for the circle fill?

  4. Is there a way to adjust the arc color or arc thickness?

  5. I feel like if I disable the rotation-while-teleporting feature, then maybe the arrow mesh should just be removed/hidden entirely as well since I don’t care so much about the direction, only the location.

  6. It sometimes seems like I don’t teleport completely to the location I specified. I’m just a few feet shy of getting there, like 98%. Though, this is minor and might be because the circle being drawn is too big and I’m not accurate at picking my destination. :laughing:

Anyway, thanks again. Really great work!

pinging @RaananW

Great suggestions! let’s answer one by one :slight_smile:

  1. I had it configured exactly the other way - the parabolic (arc) ray only triggers as a secondary ray is the main (direct) ray couldnt find anything (In your case, in an angle > 45). This was done because we keep backwards compatibility, and this was the WebVR behavior. However! I like the idea very much of having the arc ray the main ray and ignore the direct ray. I guess I won’t make it for 4.2, but I have no problem adding it to the lit of improvements to be done.
  2. You can fully configure the ring mesh yourself. But that would require you creating your own mesh andprovide it with teleportationTargetMesh option. The mesh is exposed in the options object you provide to the teleportation feature (unless using the default configuration). I can try exposing the object in a different way, would be a part of the improvements :slight_smile:
  3. No color meaning transparent?
  4. The Arc is a line mesh, and a line mesh has a specific thickness. But I just noticed I forgot to update the lines mesh on each frame (it creates a new one every frame), so thanks for making me look at the code again! If you do want a different mesh I can try providing a function to create the mesh istead of the way I am creating it.
  5. Sure! Makes sense. Part of the above mentioned improvements
  6. That’s interesting. You mean that the ring is in the right place but you land somewhere else? I very much like to see an example of that, as this should never happen. Might it be that you are trying to teleport beyond the ground mesh?
1 Like
  1. Cool. Yes, in my experience playing games on the Oculus Quest: The Starwars games, Arizona Sunshine, BigScreen etc. The emerging convention seems to be displaying an arc for where you want to go. I don’t recall seeing a straight ray being very popular for teleportation, at least I haven’t see it. In Babylonjs was my first time seeing it done that way.
  2. I think a circle is fine. I wasn’t thinking to completely customize the mesh. If it is possible to expose the circle radius to the default options that might suffice.
  3. Yes, or allow color with opacity. Hmm… is that possible already? I haven’t tried it, but can we do something like set css color with alpha? rgba(255, 0, 0, 0.4);
  4. Thanks. Replacing the mesh sounds like an advanced capability. Although nice, some simple default options for being able to change the arc-color/arc-opacity and perceived “thickness” of the arc would go a long way without having to completely write our own. :slight_smile:
  5. Ah, I suppose we can hide this ourselves if we can set the opacity of the rotation mesh to zero? It just made sense to me that if rotation is disabled, this goes hand in hand with hiding the rotation gizmo since I thought that mesh existed only for me to also see what direction I’m going to be in.
  6. I don’t have precise data, it’s my subjective perception that the teleportation “could be more accurate”, but maybe if the maths are accurate then I’m the one that’s wrong? But maybe if you have a chance you can try teleporting to the corner of a plane and try to position yourself as accurately as you can as if you want to stand on it’s very corner edge looking down. For me, sometimes, instead of looking down and seeing the precise corner of the plane where I placed my arc and target circle, instead I see I’m about 2-3 feet behind that area and I need to teleport a little bit more to refine my placement. I never overshoot a target, when/if this happens I undershoot and need to go a little bit further if that makes sense.
2 Likes

Sorry @owen - haven’t forgotten about this. Just have some work on my plate.
I will create a github issue for that very soon so we can follow the needed work

1 Like

This is the issue - [XR] Teleportation improvements · Issue #9266 · BabylonJS/Babylon.js · GitHub , PR was already submitted :slight_smile:

HI @RaananW I saw your PR was merged with a checked mark in the description re: “Allow making parabolic teleportation the main one”. That’s exciting. Does that mean we’ll soon be able to see an arc for short distances instead of the current straight ray? I just checked a random webxr enabled playground yesterday and it still appears to use a straight ray. When would I be able to test an arc rendered as the default?

Additional thoughts for improvements:

  1. Is there a way to dynamically limit the teleportation distance? It’s useful for only allowing players to move in small increments when in close combat like 3-5 meters instead of a huge distance like 50 meters. Additionally it could be useful to change this dynamically during game play if under certain game circumstances you are allowed to teleport further.

  2. It would be useful to display a “teleportation denied” arc that shows up in red, where the user is not allowed to teleport. This is useful feed back in a game like Arizona Sunshine where you can see teleportation arc is working, in that you can see it, but you aren’t allowed to use it right now because you are being attacked. (hubs.mozilla also does something similar by showing a green arc where teleportation is allowed.). A parameter that allows denying teleportation dynamically based on a custom function would be useful for keeping players close to each other in a scene rather than having them run too far away from each other.

Thank you!

1 Like

So! this feature is already integrated, but is not the default behavior.

You should set the straightRayEnabled to false, and only parabolic line will be enabled.

Those are flags on the feature itself especially so that you wouldn’t need to restart the feature to change it. The can be changed on each frame.

parabolicCheckRadius will allow you to provide different distances for the ray (can also be changed on each frame).

And I like the feature request! makes a lot of sense. A gitHub issue will be nice, otherwise I won’t track it correctly. Thanks!

1 Like

Was trying to test it out tonight. Is this the correct way to set those flags?

xrHelper.teleportation.straightRayEnabled = false
xrHelper.teleportation.parabolicCheckRadius = 1

Here is a playground:

What I’m noticing is that the parabola unexpectedly arcs underneath the target instead of over the target spot for short distances. And assigning a number like 1 or 2 to parabolicCheckRadius, attempting to limit traveling to 1 or 2 meters per teleport does not appear to restrict anything for me. The arc still can be cast a great distance longer than that. Should I expect to see the parabola only cast up to 1 or 2 meters away if that property is set?

And also, new issue created WebXR Teleportation Arc Disabled Check · Issue #9402 · BabylonJS/Babylon.js · GitHub re: the teleportation denied state.

Thanks!

1 Like

Yes, this is the right way to use it, and yes - it should be limited. I will check and let you know :slight_smile:

We’ll get it to work!

Follow up bump.

parabolicCheckRadius set to 1 does not appear to limit teleportation ray to 1 meter.

Setting straightRayEnabled produces an “under” arc instead of an “over” arc when pointing down.

See playground below for how to reproduce on Oculus Quest 1

https://playground.babylonjs.com/pg/9K3MRA/revision/270

Thank you!

Assigned myself and will find the time to check that.

regarding the “under” arc - this is actually a feature. If you have straight-line disabled you will not see it, but the ray sent by the teleportation will always try to “find its way” to the ground, which it clearly does now. I guess you expect the line to find the floor nearer you from above?

That’s true, it does “find it’s way” to the ground. :slight_smile: I guess I expected that when straight line is disabled that the arc would always cast as a rainbow shape or upside down parabola, be it shorter or longer or nearly straight based on distance, but always slightly curved downward. To me, it’s a bit odd to curve the other way and gives me the confusing impression that the floor is transparent and I’m seeing the ray come from beneath the floor.

1 Like