Light Handle

template<IsSpectral TSpectral>
class LightHandle : public huira::Handle<Light<TSpectral>>

Handle for referencing a Light asset in the scene.

LightHandle provides safe, type-checked access to Light assets, allowing manipulation and querying of lights within the scene. Used by Scene and FrameHandle.

Template Parameters:

TSpectral – Spectral type for the scene

Public Functions

LightHandle() = delete
bool valid() const

Checks if the handle points to a valid, scene-owned object.

Returns:

true if valid, false otherwise

std::shared_ptr<U> get() const

Gets a shared_ptr to the referenced object, optionally downcasting to a derived type.

Template Parameters:

U – Type to cast to (default: T)

Throws:

std::runtime_error

Returns:

std::shared_ptr

Protected Functions

std::shared_ptr<T> get_() const

Gets a shared_ptr to the referenced object, enforcing validity.

Throws:

std::runtime_error – if the handle is invalid

Returns:

std::shared_ptr<T> Shared pointer to the object

Protected Attributes

std::weak_ptr<T> ptr_

Friends

friend class Scene< TSpectral >
friend class FrameHandle< TSpectral >