Skip to content

Scaling Ray Interactor

eisclimber edited this page Nov 3, 2024 · 3 revisions

Scaling Ray Interactor

class in ExPresSXR.Rig / Extends ExPresSXR.Rig.XRRayInteractor
Component added via Component Menu

Description

Allows ray interactions with XRInteractables whilst also allowing them to be scaled, if they were configured as a Scalable Grab Interactable.

Uses the RayInteractors anchorControl-Mode to de-/activate scaling or translation. The differentiation for anchorControl and scaling is handled via the anchorControlMode.

Members

Public Properties

  • AnchorControlMode anchorControlMode: Determines how the anchorControl/scaling InputActions (Joystick up/down) are handled. Default: ScaleWithTranslateFallback
  • bool scaleSpeed: How fast the scale is in-/decreased. Will be synchronized with deltaTime.

Public Methods

  • bool CanSetHighlighterScaleWithCollider(): Can be checked if the SocketInteractor has a SphereCollider- or BoxCollider-Component, thus useColliderSizeAsScale can be set to true.
  • void SetHighlighterVisible(bool visible): Used to show or hide the highlighterObject. Can be overwritten to modify the behavior of when the highlighter is allowed to be shown.

Protected Methods

  • bool TryRead2DAxis(InputAction action, out Vector2 output): Copied from the XRRayInteractor because it is not accessible in this scope. Reads the value from the given InputAction as Vector2.
  • void TranslateAnchor(Transform rayOrigin, Transform anchor, float directionAmount): Translates or scales the selection by the directionAmount (+/-1.0f) if it is a ScalableGrabInteractable.

Enums

  • AnchorControlMode: How anchorControl is handled on Interactables. The option ScaleWithTranslateFallback will scale interactables if they are a Scalable Grab Interactables or translate the interactable if not.

ExPresS XR Wiki

Tutorial Pages

Code Documentation

Clone this wiki locally