class MAGES::Interaction::Interactables::Grabbable¶
Overview¶
A Grabbable interactable. More…
class Grabbable: public MAGES::Interaction::Interactables::BaseInteractable, public MAGES::Interaction::IReticleProvider { public: // enums enum GrabMode; enum GrabMovementMode; // structs struct RigidBodyProperties; // classes class HandPoseGroup; // properties List<HandPoseGroup> HandPoses; float ResetDistance; bool ManualReset; bool EnableThrow; float ThrowVelocityMultiplier; uint ThrowVelocityWindow; override ListColliders; // methods virtual override bool CanBeHovered(IInteractor interactor); virtual override bool CanBeActivated(IInteractor interactor); virtual override bool CanBeSelected(IInteractor interactor); virtual override void ProcessInteractable(UpdatePhase updatePhase); bool TryGetReticleForInteractor(IInteractor interactor, out GameObject reticle); };
Inherited Members¶
public: // properties IInteractionManager InteractionManager; Transform Transform; Rigidbody Rigidbody; Transform AttachTransform; ListColliders; InteractionMode InteractionMode; bool DisableKinematicOnSelectEnter; bool EnableKinematicOnSelectExit; UnityEvent<InteractableRegisterEventArgs> RegisterEntered; UnityEvent<InteractableDeregisterEventArgs> DeregisterEntered; UnityEvent<HoverEnterInteractionEventArgs> HoverEntered; UnityEvent<HoverExitInteractionEventArgs> HoverExited; UnityEvent<HoverEnterInteractionEventArgs> FirstHoverEntered; UnityEvent<HoverExitInteractionEventArgs> LastHoverExited; UnityEvent<SelectEnterInteractionEventArgs> SelectEntered; UnityEvent<SelectExitInteractionEventArgs> SelectExited; UnityEvent<SelectEnterInteractionEventArgs> FirstSelectEntered; UnityEvent<SelectExitInteractionEventArgs> LastSelectExited; UnityEvent<ActivateEnterInteractionEventArgs> ActivateEntered; UnityEvent<ActivateExitInteractionEventArgs> ActivateExited; UnityEvent<ActivateEnterInteractionEventArgs> FirstActivateEntered; UnityEvent<ActivateExitInteractionEventArgs> LastActivateExited; bool IsHovered; bool IsSelected; bool IsActivated; List<IInteractor> HoveringInteractors; List<IInteractor> SelectingInteractors; List<IInteractor> ActivatingInteractors; IInteractor FirstHoverInteractor; IInteractor LastHoverInteractor; IInteractor FirstSelectInteractor; IInteractor LastSelectInteractor; IInteractor FirstActivateInteractor; IInteractor LastActivateInteractor; IInteractionManager InteractionManager; Transform Transform; Rigidbody Rigidbody; List Colliders; Transform AttachTransform; InteractionMode InteractionMode; bool DisableKinematicOnSelectEnter; bool EnableKinematicOnSelectExit; UnityEvent<InteractableRegisterEventArgs> RegisterEntered; UnityEvent<InteractableDeregisterEventArgs> DeregisterEntered; UnityEvent<HoverEnterInteractionEventArgs> HoverEntered; UnityEvent<HoverExitInteractionEventArgs> HoverExited; UnityEvent<HoverEnterInteractionEventArgs> FirstHoverEntered; UnityEvent<HoverExitInteractionEventArgs> LastHoverExited; UnityEvent<SelectEnterInteractionEventArgs> SelectEntered; UnityEvent<SelectExitInteractionEventArgs> SelectExited; UnityEvent<SelectEnterInteractionEventArgs> FirstSelectEntered; UnityEvent<SelectExitInteractionEventArgs> LastSelectExited; UnityEvent<ActivateEnterInteractionEventArgs> ActivateEntered; UnityEvent<ActivateExitInteractionEventArgs> ActivateExited; UnityEvent<ActivateEnterInteractionEventArgs> FirstActivateEntered; UnityEvent<ActivateExitInteractionEventArgs> LastActivateExited; bool EnableHoverMaterial; Material HoverMaterial; bool IsHovered; bool IsSelected; bool IsActivated; List<IInteractor> HoveringInteractors; List<IInteractor> SelectingInteractors; List<IInteractor> ActivatingInteractors; IInteractor FirstHoverInteractor; IInteractor LastHoverInteractor; IInteractor FirstSelectInteractor; IInteractor LastSelectInteractor; IInteractor FirstActivateInteractor; IInteractor LastActivateInteractor; // methods bool IsHoveredBy(IInteractor interactor); bool IsSelectedBy(IInteractor interactor); bool IsActivatedBy(IInteractor interactor); bool CanBeHovered(IInteractor interactor); bool CanBeSelected(IInteractor interactor); bool CanBeActivated(IInteractor interactor); float GetSelectionIntensity(); float GetSelectionIntensity(IInteractor interactor); float GetActivationIntensity(); float GetActivationIntensity(IInteractor interactor); void OnHoverEnter(HoverEnterInteractionEventArgs args); void OnHoverEntered(HoverEnterInteractionEventArgs args); void OnHoverExit(HoverExitInteractionEventArgs args); void OnHoverExited(HoverExitInteractionEventArgs args); void OnSelectEnter(SelectEnterInteractionEventArgs args); void OnSelectEntered(SelectEnterInteractionEventArgs args); void OnSelectExit(SelectExitInteractionEventArgs args); void OnSelectExited(SelectExitInteractionEventArgs args); void OnActivateEnter(ActivateEnterInteractionEventArgs args); void OnActivateEntered(ActivateEnterInteractionEventArgs args); void OnActivateExit(ActivateExitInteractionEventArgs args); void OnActivateExited(ActivateExitInteractionEventArgs args); void OnRegisterEnter(InteractableRegisterEventArgs args); void OnRegisterEntered(InteractableRegisterEventArgs args); void OnDeregisterEnter(InteractableDeregisterEventArgs args); void OnDeregisterEntered(InteractableDeregisterEventArgs args); void ExitHover(); void ExitHover(IInteractor interactor); void ExitSelection(); void ExitSelection(IInteractor interactor); void ExitActivation(); void ExitActivation(IInteractor interactor); void PreprocessInteractable(UpdatePhase updatePhase); void ProcessInteractorInput(UpdatePhase updatePhase); void ProcessInteractable(UpdatePhase updatePhase); bool TryGetAttachPose(IInteractor interactor, out Transform attachPose); bool IsHoveredBy(IInteractor interactor); bool IsSelectedBy(IInteractor interactor); bool IsActivatedBy(IInteractor interactor); virtual bool CanBeHovered(IInteractor interactor); virtual bool CanBeSelected(IInteractor interactor); virtual bool CanBeActivated(IInteractor interactor); void ExitHover(); void ExitHover(IInteractor interactor); void ExitSelection(); void ExitSelection(IInteractor interactor); void ExitActivation(); void ExitActivation(IInteractor interactor); float GetSelectionIntensity(); float GetSelectionIntensity(IInteractor interactor); float GetActivationIntensity(); float GetActivationIntensity(IInteractor interactor); virtual void PreprocessInteractable(UpdatePhase updatePhase); virtual void ProcessInteractable(UpdatePhase updatePhase); virtual void ProcessInteractorInput(UpdatePhase updatePhase); bool TryGetAttachPose(IInteractor interactor, out Transform attachPose); bool TryGetReticleForInteractor(IInteractor interactor, out GameObject reticle);
Detailed Documentation¶
A Grabbable interactable.
Attach it to a GameObject to enable grabbing with Interactors.
See also:
BaseInteractable, IInteractable, Interaction.Interactors.BaseInteractor, Interaction.Interactors.HandInteractor
Properties¶
List<HandPoseGroup> HandPoses
Gets or sets the handposes to be used with the grabbable.
float ResetDistance
Gets or sets the distance between prefab’s starting and current position to enable the reset.
bool ManualReset
Gets or sets a value indicating whether or not the prefab will reset to starting position when the Reset Distance it exceeded.
bool EnableThrow
Gets or sets a value indicating whether throw velocity should be applied when releasing the grabbable.
float ThrowVelocityMultiplier
Gets or sets the factor with which the throw velocity should be multiplied.
uint ThrowVelocityWindow
Gets or sets the window in fixed update frames in which the throw velocity is calculated.
override ListColliders
Gets The colliders of this interactable.
Methods¶
virtual override bool CanBeHovered(IInteractor interactor)
Gets if this interactable can be hovered by the specified interactor.
Parameters:
interactor |
The interactor to check if this interactable can receive hover events from. |
Returns:
true
if this interactable can be hovered by the specified interactor.
virtual override bool CanBeActivated(IInteractor interactor)
Gets if this interactable can be activated by the specified interactor.
Parameters:
interactor |
The interactor to check if this interactable can receive activate events from. |
Returns:
true
if this interactable can be activated by the specified interactor.
virtual override bool CanBeSelected(IInteractor interactor)
Gets if this interactable can be selected by the specified interactor.
Parameters:
interactor |
The interactor to check if this interactable can receive select events from. |
Returns:
true
if this interactable can be selected by the specified interactor.
virtual override void ProcessInteractable(UpdatePhase updatePhase)
Called by the InteractionManager after the Interactable is processed by the interaction manager, in the given update phase.
Parameters:
updatePhase |
The update phase this method is called. |
bool TryGetReticleForInteractor(IInteractor interactor, out GameObject reticle)
Gets the reticle.
Parameters:
interactor |
The interactor to get a reticle for. |
reticle |
The reticle gameobject. |
Returns:
Returns true if a reticle exists.