Meta SDK2 Beta  2.7.0
Meta.Interaction Class Referenceabstract

Implement base Interaction class to define new types of Interaction that can occur with the MetaHands. More...

Inheritance diagram for Meta.Interaction:
Meta.MetaBehaviour Meta.IInteractibleObject Meta.BaseMetaBehaviour< IMetaContext > Meta.GrabInteraction Meta.TwoHandInteraction Meta.TwoHandScaleInteraction Meta.TwoHandGrabInteraction Meta.TwoHandGrabRotateInteraction Meta.TwoHandGrabScaleInteraction Meta.TwoHandGrabSwitchRotationInteraction

Public Member Functions

void OnGrabEngaged (Hand grabbingHand)
 Called when grabbed by CenterHandFeature. More...
 
void OnGrabDisengaged (Hand releasingHand)
 Called when released by a CenterHandFeature. More...
 
void OnHoverStart (Hand hand)
 Called object is first hovered upon. More...
 
void OnHoverEnd (Hand hand)
 Called object is no longer hovered upon. More...
 
Collider [] GetAffectingColliders ()
 Returns all colliders affecting this interaction script. More...
 

Protected Member Functions

virtual void Awake ()
 
virtual void Update ()
 
virtual bool CanEngage (Hand hand)
 Returns true when proper conditions are met to engage this manipulation. More...
 
abstract void Engage ()
 Called when Engaged. More...
 
virtual bool CanDisengage (Hand hand)
 Returns true when proper conditions are met to disengage this manipulation. More...
 
abstract void Disengage ()
 Called when Disengaged. More...
 
abstract void Manipulate ()
 Called every frame to perform manipulation. More...
 
void Move (Vector3 position)
 Translate target transform. More...
 
void Rotate (Quaternion rotation)
 Rotate target transform. More...
 
void PrepareRigidbodyForInteraction ()
 Set the rigidbody to kinematic and clear its constraints so as not to interfere with interaction translation. More...
 
void RestoreRigidbodySettingsAfterInteraction ()
 Restore the rigidbody's kinematic state and constraints as they were prior to the most recent interaction. More...
 
void SetGrabOffset (Vector3 handPosition)
 Calculates the difference in position between the grabbing hand and the GameObject More...
 

Protected Attributes

List< HandFeatureGrabbingHands = new List<HandFeature>()
 
List< HandFeatureHoveringHands = new List<HandFeature>()
 
bool IsHoveredUpon
 
Vector3 GrabOffset
 Offset of the grabbing hand/s from the main affected transform at the moment of grab. More...
 

Properties

bool HigherPriorityRunning [get, set]
 Set via the InteractionOrder component to cause interactions to give priority to Interactions above them in the InteractionOrder priority list. More...
 
InteractionState State [get]
 The Interaction's current manipulation state More...
 
Transform TargetTransform [get, set]
 Call to retrieve transform onto which any operation should be applied. More...
 
InteractionEvents Events [get]
 
- Properties inherited from Meta.BaseMetaBehaviour< IMetaContext >
metaContext [get]
 Contains references to modules used to provide Meta functionality in the scene. More...
 

Detailed Description

Implement base Interaction class to define new types of Interaction that can occur with the MetaHands.

Member Function Documentation

◆ Awake()

virtual void Meta.Interaction.Awake ( )
inlineprotectedvirtual

◆ CanDisengage()

virtual bool Meta.Interaction.CanDisengage ( Hand  hand)
inlineprotectedvirtual

Returns true when proper conditions are met to disengage this manipulation.

Reimplemented in Meta.TwoHandScaleInteraction, Meta.GrabInteraction, and Meta.TwoHandInteraction.

◆ CanEngage()

virtual bool Meta.Interaction.CanEngage ( Hand  hand)
inlineprotectedvirtual

Returns true when proper conditions are met to engage this manipulation.

Reimplemented in Meta.TwoHandScaleInteraction, Meta.TwoHandInteraction, and Meta.GrabInteraction.

◆ Disengage()

abstract void Meta.Interaction.Disengage ( )
protectedpure virtual

◆ Engage()

◆ GetAffectingColliders()

Collider [] Meta.Interaction.GetAffectingColliders ( )
inline

Returns all colliders affecting this interaction script.

Returns

◆ Manipulate()

abstract void Meta.Interaction.Manipulate ( )
protectedpure virtual

◆ Move()

void Meta.Interaction.Move ( Vector3  position)
inlineprotected

Translate target transform.

◆ OnGrabDisengaged()

void Meta.Interaction.OnGrabDisengaged ( Hand  releasingHand)
inline

Called when released by a CenterHandFeature.

Implements Meta.IInteractibleObject.

◆ OnGrabEngaged()

void Meta.Interaction.OnGrabEngaged ( Hand  grabbingHand)
inline

Called when grabbed by CenterHandFeature.

Implements Meta.IInteractibleObject.

◆ OnHoverEnd()

void Meta.Interaction.OnHoverEnd ( Hand  hand)
inline

Called object is no longer hovered upon.

◆ OnHoverStart()

void Meta.Interaction.OnHoverStart ( Hand  hand)
inline

Called object is first hovered upon.

◆ PrepareRigidbodyForInteraction()

void Meta.Interaction.PrepareRigidbodyForInteraction ( )
inlineprotected

Set the rigidbody to kinematic and clear its constraints so as not to interfere with interaction translation.

◆ RestoreRigidbodySettingsAfterInteraction()

void Meta.Interaction.RestoreRigidbodySettingsAfterInteraction ( )
inlineprotected

Restore the rigidbody's kinematic state and constraints as they were prior to the most recent interaction.

◆ Rotate()

void Meta.Interaction.Rotate ( Quaternion  rotation)
inlineprotected

Rotate target transform.

◆ SetGrabOffset()

void Meta.Interaction.SetGrabOffset ( Vector3  handPosition)
inlineprotected

Calculates the difference in position between the grabbing hand and the GameObject

◆ Update()

virtual void Meta.Interaction.Update ( )
inlineprotectedvirtual

Reimplemented in Meta.TwoHandScaleInteraction.

Member Data Documentation

◆ GrabbingHands

List<HandFeature> Meta.Interaction.GrabbingHands = new List<HandFeature>()
protected

◆ GrabOffset

Vector3 Meta.Interaction.GrabOffset
protected

Offset of the grabbing hand/s from the main affected transform at the moment of grab.

◆ HoveringHands

List<HandFeature> Meta.Interaction.HoveringHands = new List<HandFeature>()
protected

◆ IsHoveredUpon

bool Meta.Interaction.IsHoveredUpon
protected

Property Documentation

◆ Events

InteractionEvents Meta.Interaction.Events
get

◆ HigherPriorityRunning

bool Meta.Interaction.HigherPriorityRunning
getset

Set via the InteractionOrder component to cause interactions to give priority to Interactions above them in the InteractionOrder priority list.

◆ State

InteractionState Meta.Interaction.State
get

The Interaction's current manipulation state

◆ TargetTransform

Transform Meta.Interaction.TargetTransform
getset

Call to retrieve transform onto which any operation should be applied.