Skip to content

Add a new Redirection Technique

Hannah edited this page Apr 13, 2021 · 2 revisions

Inherit from the right class

All Redirection Techniques inherit from the Abstract Class Hand Redirector.cs.

BodyWarping Initial Situation

The Hand Redirector splits up into the Conceptual Approaches of hand redirection. We have created and used three conceptual approaches in our toolkit: Body and World Warping as well as Interpolation. You can directly inherit from one of them or from the base class. So, if you want to create a new Body Warping approach, we recommand you to inherit from the BodyWarping.cs class. This helps to apply the correct thresholds for each conceptual approach.

You have to implement the following three methods to make use of the intern calling structure:

Init()

Get's called on the activation of this redirection technique. It aims to help the redirection technique to do all computations that do not need to be done every frame.

public override void Init(RedirectedPrefab redirectedPrefab, Transform head)
        {
            
        }
ApplyRedirection()

Get's called every frame during an active redirection. In this method, the redirection will be applied to the virtual hand or virtual world.

public override void ApplyRedirection(Transform realHandPos, Transform virtualHandPos, 
            Transform warpOrigin, RedirectedPrefab target, Transform bodyTransform)
        {
            
        }
EndRedirection()

Get's called at the end of a redirection.

public override void EndRedirection()
        {
            
        }

Create a Prefab

  • Add the new script as a component to a new empty game object
  • Create a prefab from this game object
Clone this wiki locally