GvrReticlePointer
Draws a circular reticle in front of any object that the user points at.
Summary
The circle dilates if the object is clickable.
Inheritance
Inherits from: GvrBasePointer
Public attributes |
|
---|---|
RETICLE_DISTANCE_MIN = 0.45f
|
const float
Minimum distance of the reticle (in meters).
|
RETICLE_GROWTH_ANGLE = 1.5f
|
const float
Angle at which to expand the reticle when intersecting with an object (in degrees).
|
RETICLE_MIN_INNER_ANGLE = 0.0f
|
const float
The constants below are expsed for testing.
|
RETICLE_MIN_OUTER_ANGLE = 0.5f
|
const float
Minimum outer angle of the reticle (in degrees).
|
maxReticleDistance = 20.0f
|
float
Maximum distance of the reticle (in meters).
|
reticleGrowthSpeed = 8.0f
|
float
Growth speed multiplier for the reticle.
|
reticleSegments = 20
|
int
Number of segments making the reticle circle.
|
reticleSortingOrder = 32767
|
int
Sorting order to use for the reticle's renderer.
|
Properties |
|
---|---|
MaterialComp
|
Material
Gets or sets the material used to render the reticle.
|
MaxPointerDistance
|
override float
|
ReticleDistanceInMeters
|
float
Gets the current distance of the reticle (in meters).
|
ReticleInnerAngle
|
float
Gets the current inner angle of the reticle (in degrees).
|
ReticleInnerDiameter
|
float
Gets the current inner and outer diameters of the reticle, before distance multiplication.
|
ReticleOuterAngle
|
float
Gets the current outer angle of the reticle (in degrees).
|
ReticleOuterDiameter
|
float
Gets the current outer diameter of the reticle (in meters).
|
Public functions |
|
---|---|
GetPointerRadius(out float enterRadius, out float exitRadius)
|
virtual override void
Return the radius of the pointer.
|
OnPointerClickDown()
|
virtual override void
Called when a click is initiated.
|
OnPointerClickUp()
|
virtual override void
Called when click is finished.
|
OnPointerEnter(RaycastResult raycastResultResult, bool isInteractive)
|
virtual override void
Called when the pointer is facing a valid GameObject.
|
OnPointerExit(GameObject previousObject)
|
virtual override void
Called when the pointer no longer faces an object previously intersected with a ray projected from the camera.
|
OnPointerHover(RaycastResult raycastResultResult, bool isInteractive)
|
virtual override void
Called every frame the user is still pointing at a valid GameObject.
|
UpdateDiameters()
|
void
Updates the material based on the reticle properties.
|
Public attributes
RETICLE_DISTANCE_MIN
const float RETICLE_DISTANCE_MIN = 0.45f
Minimum distance of the reticle (in meters).
RETICLE_GROWTH_ANGLE
const float RETICLE_GROWTH_ANGLE = 1.5f
Angle at which to expand the reticle when intersecting with an object (in degrees).
RETICLE_MIN_INNER_ANGLE
const float RETICLE_MIN_INNER_ANGLE = 0.0f
The constants below are expsed for testing.
Minimum inner angle of the reticle (in degrees).
RETICLE_MIN_OUTER_ANGLE
const float RETICLE_MIN_OUTER_ANGLE = 0.5f
Minimum outer angle of the reticle (in degrees).
maxReticleDistance
float maxReticleDistance = 20.0f
Maximum distance of the reticle (in meters).
reticleGrowthSpeed
float reticleGrowthSpeed = 8.0f
Growth speed multiplier for the reticle.
reticleSegments
int reticleSegments = 20
Number of segments making the reticle circle.
reticleSortingOrder
int reticleSortingOrder = 32767
Sorting order to use for the reticle's renderer.
Range values come from https://docs.unity3d.com/ScriptReference/Renderer-sortingOrder.html.
Default value 32767 ensures gaze reticle is always rendered on top.
Properties
MaterialComp
Material MaterialComp
Gets or sets the material used to render the reticle.
The material used to render the reticle.
MaxPointerDistance
override float MaxPointerDistance
ReticleDistanceInMeters
float ReticleDistanceInMeters
Gets the current distance of the reticle (in meters).
Getter exposed for testing.
The current distance of the reticle (in meters).
ReticleInnerAngle
float ReticleInnerAngle
Gets the current inner angle of the reticle (in degrees).
Exposed for testing.
The current inner angle of the reticle (in degrees).
ReticleInnerDiameter
float ReticleInnerDiameter
Gets the current inner and outer diameters of the reticle, before distance multiplication.
Getters exposed for testing.
The current inner and outer diameters of the reticle, before distance multiplication.
ReticleOuterAngle
float ReticleOuterAngle
Gets the current outer angle of the reticle (in degrees).
Exposed for testing.
The current outer angle of the reticle (in degrees).
ReticleOuterDiameter
float ReticleOuterDiameter
Gets the current outer diameter of the reticle (in meters).
The current outer diameter of the reticle (in meters).
Public functions
GetPointerRadius
virtual override void GetPointerRadius( out float enterRadius, out float exitRadius )
Return the radius of the pointer.
OnPointerClickDown
virtual override void OnPointerClickDown()
Called when a click is initiated.
OnPointerClickUp
virtual override void OnPointerClickUp()
Called when click is finished.
OnPointerEnter
virtual override void OnPointerEnter( RaycastResult raycastResultResult, bool isInteractive )
Called when the pointer is facing a valid GameObject.
OnPointerExit
virtual override void OnPointerExit( GameObject previousObject )
Called when the pointer no longer faces an object previously intersected with a ray projected from the camera.
OnPointerHover
virtual override void OnPointerHover( RaycastResult raycastResultResult, bool isInteractive )
Called every frame the user is still pointing at a valid GameObject.
UpdateDiameters
void UpdateDiameters()
Updates the material based on the reticle properties.