class MAGES::Interaction::TeleportProvider¶
Overview¶
A locomotion provider that teleports the Rig to a specified transform. More…
class TeleportProvider: public MAGES::Interaction::BaseLocomotionProvider { public: // methods bool TeleportRig(Transform transform); bool TeleportRig(Vector3 position); bool TeleportRig(Vector3 position, Vector3 forward); };
Inherited Members¶
public: // properties ILocomotionSystem LocomotionSystem; LocomotionPhase LocomotionPhase; UnityEvent<LocomotionStartEventArgs> LocomotionStarted; UnityEvent<LocomotionEndEventArgs> LocomotionEnded; List<ILocomotionProvider> ActiveLocomotionProviders; ILocomotionSystem LocomotionSystem; LocomotionPhase LocomotionPhase; UnityEvent<LocomotionStartEventArgs> LocomotionStarted; UnityEvent<LocomotionEndEventArgs> LocomotionEnded; // methods bool CanStartLocomotion(); bool StartLocomotion(float time); bool EndLocomotion(); void ResetProvider(); bool CanStartLocomotion(); bool StartLocomotion(float time = 10f); bool EndLocomotion(); virtual void ResetProvider();
Detailed Documentation¶
A locomotion provider that teleports the Rig to a specified transform.
Methods¶
bool TeleportRig(Transform transform)
Teleports the PlayerRig to the specified position and rotation, for a specific amount of time.
Parameters:
transform |
The rig transform. |
Returns:
true
if the teleportation was successful.
bool TeleportRig(Vector3 position)
Teleports the PlayerRig to the specified position, for a specific amount of time.
Parameters:
position |
The final position. |
Returns:
true
if the teleportation was successful.
bool TeleportRig(Vector3 position, Vector3 forward)
Teleports the PlayerRig to the specified position, and rotates the rig to face towards forward.
Parameters:
position |
The final position. |
forward |
The forward vector of the rig, after teleporation. |
Returns:
true
if the teleportation was successful.