class
HandleSliderDisc
Handle slider that returns a delta value as you drag the pointer along a disc.
For intersection purposes the disc is internally represented by a torus.
Public
Constructors
HandleSliderDisc
Constructs a new disc slider.
- owner
- Object that that owns the slider.
- normal
- Normal that determines the orientation of the disc.
- radius
- Radius of the disc.
- 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
~HandleSliderDisc
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.
SetCutoffPlane
Enables or disables a cut-off plane that can allow the disc to be intersected with only in an 180 degree arc.
- angle
- Angle at which to start the cut-off. Points on the dist at the specified angle and the next 180 degrees won't be interactable.
- enabled
- True to enable the cutoff plane, false otherwise.
GetDelta
Returns a delta value that is the result of dragging/sliding the pointer along the disc.
This changes every frame and will be zero unless the slider is active.
GetStartAngle
Gets the initial angle at which the drag/slide operation started.
This is only valid when 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.
CalculateClosestPointOnArc
Calculates the closest point on an arc from a ray.
- inputRay
- Ray to use for determining the point.
- center
- Center of the arc.
- up
- Normal vector of the arc. Must be normalized.
- radius
- Radius of the arc.
- startAngle
- Starting angle of the arc.
- angleAmount
- Length of the arc.
Returns: A point on the arc closest to the provided ray.
PointOnCircleToAngle
Determines an angle of a point on a circle.
- up
- Normal vector of the circle. Must be normalized.
- point
- Point to try to find the angle for. Caller must ensure the point is actually somewhere on the circle otherwise the result is undefined.
Returns: Angle at which the provided point lies on the circle.