-
-
Notifications
You must be signed in to change notification settings - Fork 2
Area Of Interest Ray
eisclimber edited this page Jan 18, 2024
·
1 revision
class in ExPresSXR.Interaction / Extends UnityEngine.XR.Interaction.Toolkit.XRBaseInteractable
GameObject instantiable via ExPresSXR/Eye Tracking/Area Of Interest Ray; Component added via Component Menu
Casts a ray that can be used to detect 'AreaOfInterests'-Components, mostly used for EyeTracking but can be done with arbitrary Position- and Rotation-InputActions.
Supports bouncing (e.g. with Mirrors). The number of bounces is determined by '_numAOIBounces'. For objects to bounce they must be in the 'AreaOfInterestBouncer'-Layer and have an 'AreaOfInterestRayBouncer'-Component attached to them.
Should be added as a child of the Rig itself as the head's position is relative to the rig's origin.
-
InputActionReference _eyePositionRef
: The InputActionRef that provides the value of the eye's position. -
InputActionReference _eyeRotationRef
: The InputActionRef that provides the value of the eye's rotation. -
int _numAOIBounces
: If set to a value greater than 0 will allow _numAOIBounces until hitting an AOIArea. For a GameObject to bounce the 'AreaOfInterestRayBouncer'-Component must be added and it's layer be set to 'AreaOfInterestBouncer'. -
LayerMask _layerMask
: LayerMask for detecting AOIs and AOIBouncers.
-
string focusedAoiId
: The if of the currently detected AOI. Will beNO_AOI_DETECTED_ID
if none was detected. -
Vector3 currentEyePos
: Position of the eye in world space. -
Vector3 currentEyeDir
: Direction of the eye in world space. -
List<Vector3> bounceTracePath
: List of Points that traces the current raycast. First entry will be thecurrentEyePos
. If it's length is more than one the last entry will be the hit point on the AOI. Intermediate points are bounces. The length of the list is in range [1, _numAOIBounces + 1].
-
int DEFAULT_AOI_LAYER_MASK = 1536
: Layer mask for AreaOfInterest and AreaOfInterestbouncers. -
float GIZMOS_RAY_MAX_LENGTH = 5.0f
: Length of the Gizmos Ray when no AOI is hit. -
float GIZMOS_CUBE_SIZE = 0.05f
: Size of the Gizmo cube that is drawn at AOI bounces and hits. -
string NO_AOI_DETECTED_ID = "None"
: String specifying that no AOI was hit.
Autor: Luca 'eisclimber' Dreiling; License: MIT
- Getting Started
- Development and Contribution
- Misc
- Experimentation
- Data Gatherering
- Eye Tracking
- ExPresS XR Rig
- Interaction
- Base Button
- Button Quiz
- Collision Hand Rumbler
- Collision Sound Emitter
- Exit Game Interactable (Script Deprecated)
- Interactables
- Haptic Impulse Trigger
- Socket Interactors
- Inverse Kinematics
- Localization
- Minigames
- Coin Scale
- Coin Throw
- Sword Cleaning
- Misc
- Movement
- Presentation
- UI