class HandleSliderSphere

Inherits: HandleSlider

Handle slider represented by a sphere collider.

The slider doesn't allow dragging (it doesn't report a delta value like other sliders) but can be used for picking (selection) purposes.

Public

Constructors

HandleSliderSphere

HandleSliderSphere(const SPtr<SceneHandles> &owner, float radius, bool fixedScale = true, u64 layer = 1)

Constructs a new sphere slider.

owner
Object that that owns the slider.
radius
Radius of the collider sphere.
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

~HandleSliderSphere

~HandleSliderSphere() noexcept

Intersects

bool Intersects(const Vector2I &screenPos, const Ray &ray, float &t) const override

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

void HandleInput(const HCamera &camera, const Vector2I &inputDelta) override

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.

Protected

Fields

mSphereCollider

Sphere mSphereCollider