VR Development Framework
v 1.0.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
Public Member Functions | Public Attributes | Protected Member Functions | Properties | Private Attributes | List of all members
AVR.Motion.AVR_MovementRay Class Reference

AVR_SolidRay but, when an object is hit, the hit is either valid or invalid. The validity of the hit is determined by AVR_MovementRay.filter. A different color-gradient and/or reticule is displayed depending on the validity of the ray. If no object is hit, the ray always defaults to invalid. More...

Inheritance diagram for AVR.Motion.AVR_MovementRay:
AVR.Core.AVR_SolidRay AVR.Core.AVR_Ray AVR.Core.AVR_Component AVR.Core.AVR_Behaviour

Public Member Functions

override void hide ()
 Hides the ray. A ray is not updated while hidden. More...
 
- Public Member Functions inherited from AVR.Core.AVR_Ray
virtual void show ()
 Shows the ray. A ray is not updated while hidden. More...
 
virtual void setHidden (bool hidden)
 Set the hidden status of the ray More...
 
- Public Member Functions inherited from AVR.Core.AVR_Behaviour
virtual void OnDestroy ()
 

Public Attributes

System.Func< RaycastHit, bool > filter = (RaycastHit h) => true
 
GameObject reticule
 Reticule object displayed when a valid surface is hit More...
 
GameObject invalid_reticule
 Reticule object displayed when an invalid surface is hit More...
 
- Public Attributes inherited from AVR.Core.AVR_SolidRay
LayerMask hit_layerMask
 Layermask used to selectively ignore colliders when casting a ray. More...
 
- Public Attributes inherited from AVR.Core.AVR_Ray
RayMode mode = RayMode.STRAIGHT
 What type of ray should be used More...
 
int proj_resolution = 3
 How many vertices per unit distance to use for projectile motion ray More...
 
float proj_max_verts = 150
 Max. amount of vertices to use for projectile motion ray More...
 
float proj_velocity = 3
 Starting velocity of the projectile motion More...
 
bool start_hidden = true
 Hide or show the ray immediately on Awake() More...
 
float max_length = 25
 Maximum length of the ray More...
 
float max_horizontal_distance = 10
 Will restrict the length of the ray along the xz-Plane to a given value. More...
 
float min_y_angle = 0
 Will restrict the minium angle of the Ray with the y-Axis. More...
 
- Public Attributes inherited from AVR.Core.AVR_Component
UnityEngine.Events.UnityEvent onAwake
 Events called when this component awakes. More...
 
UnityEngine.Events.UnityEvent onStart
 Events called when this component starts. More...
 
UnityEngine.Events.UnityEvent onEnable
 Events called when this component is enabled. More...
 
UnityEngine.Events.UnityEvent onDisable
 Events called when this component is disabled. More...
 

Protected Member Functions

override void UpdateRay ()
 Updates the ray. Called from Monobehaviour.Update() More...
 
- Protected Member Functions inherited from AVR.Core.AVR_SolidRay
override void UpdateStraightRay ()
 Updates a ray with mode==STRAIGHT More...
 
override void UpdateProjectileRay ()
 Updates a ray with mode==PROJECTILE More...
 
- Protected Member Functions inherited from AVR.Core.AVR_Ray
override void Awake ()
 
virtual void Update ()
 
- Protected Member Functions inherited from AVR.Core.AVR_Component
virtual void Start ()
 
virtual void OnEnable ()
 
virtual void OnDisable ()
 

Properties

Gradient validColorGradient [get, set]
 Gets or sets the color of the line as a gradient from start to end to indicate a valid state. More...
 
Gradient invalidColorGradient [get, set]
 Gets or sets the color of the line as a gradient from start to end to indicate an invalid state. More...
 
bool isValid [get]
 Is this ray valid. The validity of a Raycasthit is determined on whether if AVR_MovementRay.filter satisfies the current hit. More...
 
- Properties inherited from AVR.Core.AVR_SolidRay
RaycastHit hitPosition [get]
 Raycasthit where the ray hit something. Contains the last hit the ray did if AVR_SolidRay.objectHit is false. null if the ray hasn't hit a single object in its lifetime. /summary> More...
 
bool objectHit [get]
 True if the ray hit some object this frame. Use AVR_SolidRay.hitPosition to get the respective RaycastHit. More...
 
- Properties inherited from AVR.Core.AVR_Ray
bool isVisible [get]
 Is this ray visible More...
 
bool isHidden [get]
 Is this ray hidden More...
 

Private Attributes

Gradient m_ValidColorGradient
 
Gradient m_InvalidColorGradient
 
bool _valid
 

Additional Inherited Members

- Public Types inherited from AVR.Core.AVR_Ray
enum  RayMode { RayMode.STRAIGHT, RayMode.PROJECTILE_MOTION }
 
- Protected Attributes inherited from AVR.Core.AVR_Ray
LineRenderer lr
 
bool _hidden
 
Vector3[] positions = new Vector3[0]
 
Vector3 RayForward = Vector3.forward
 
- Protected Attributes inherited from AVR.Core.AVR_Behaviour
AVR_PlayerRig playerRig => AVR_PlayerRig.Instance
 The current AVR_PlayerRig instance in the scene More...
 
AVR_Root root => AVR_Root.Instance
 The current AVR_Root instance in the scene More...
 
bool vrEnabled => UnityEngine.XR.XRSettings.enabled
 True if the application is running as a VR/XR application More...
 

Detailed Description

AVR_SolidRay but, when an object is hit, the hit is either valid or invalid. The validity of the hit is determined by AVR_MovementRay.filter. A different color-gradient and/or reticule is displayed depending on the validity of the ray. If no object is hit, the ray always defaults to invalid.

Definition at line 19 of file AVR_MovementRay.cs.