class
HandleSliderPlane
Handle slider that returns a delta value as you drag the pointer along a plane.
For intersection purposes the line is internally by a quadrilateral.
Public
Constructors
HandleSliderPlane
Constructs a new plane slider.
The plane is constructed from two direction vectors.
- owner
- Object that that owns the slider.
- dir1
- First direction of the plane. The x component of returned delta value will be in this direction. Should be perpendicular to .
- dir2
- Second direction of the plane. The y component of returned delta value will be in this direction. Should be perpendicular to .
- length
- Determines size of the plane.
- fixedScale
- If true the handle slider will always try to maintain the same visible area in the viewport regardless of distance from camera.
- layer
- Layer that allows filtering of which sliders are interacted with from a specific camera.
Methods
~HandleSliderPlane
Intersects
Attempts to find an intersection between the provided ray and the slider geometry.
- screenPos
- Position in screen space at which to look for intersection. Some sliders might ignore this and use the instead.
- ray
- Ray in world space to try to interect with geometry.
- t
- Position of the intersection along the ray. Only if intersection happened.
Returns: Whether an intersection was detected.
HandleInput
Updates a slider that is currently active (being dragged).
- camera
- Camera through which we're interacting with the slider.
- inputDelta
- Pointer movement since the last time this method was called.
GetDelta
Returns a delta value that is the result of dragging/sliding the pointer along the plane.
Returned movement is in terms of the two directions originally provided when constructing the slider. This changes every frame and will be zero unless the slider is active.
Protected
Methods
Activate
Triggered when the slider state is changed to active.
Reset
Triggered when the slider state is changed from active to some other state.
GetPositionOnPlane
Returns the position on plane based on pointer position.
- camera
- Camera we're interacting through.
- pointerPos
- Position of the pointer in pixels relative to the provided camera's viewport.