Skip to content

RayTeleport

MathiasBaumgartinger edited this page Mar 16, 2020 · 2 revisions

Inherits: ARVRControllerExtension

Inspired by https://developer.oculus.com/blog/teleport-curves-with-the-gear-vr-controller/ this node uses two RayCasts to teleport the player with high effeciency and a relatively intuitive visualization: A TallRay and a HorizontalRay.

The cast_height is the position from where the TallRay starts. It is always the player's position plus a given distance above. With the max_distance you can find a point along the HorizontalRay. The current degrees of the control will get clamped between a max_pitch and a min_pitch and then get normalized to 0 (min_pitch or below) 1 (max_pitch or above). The distance will be multiplied by the resulting value and a position along the HorizontalRay will be found. This is where the TallRay's property cast_to will be set to.

The logic is basically the same as the described one in the link above using GDScript. To visualize the curve i used an Curve3D to get the points and then visualized it using an ImmediateGeometry-Node.

Clone this wiki locally