SpotlightKey

class HPS::SpotlightKey : public HPS::GeometryKey

The SpotlightKey class is a smart pointer to a database object. It is a handle to a spotlight inserted via SegmentKey::InsertSpotlight.

Public Functions

void Consume(SpotlightKit &in_kit)

Completely replaces all settings on this SpotlightKey with those set on the specified kit and resets the kit.InfiniteLineKey

Parameters

in_kit – The kit from which to get the settings to replace on this SpotlightKey.

inline virtual HPS::Type ObjectType() const

This function returns the type the object, as declared (if the object is derived, this does not give the true type of the derived object).

Returns

The declared type of the object in question, which may differ from the true, underlying type.

SpotlightKey &operator=(SpotlightKey &&in_that)

The move assignment operator transfers the underlying impl of the rvalue reference to this SpotlightKey thereby avoiding a copy.

Parameters

in_that – An rvalue reference to a SpotlightKey to take the impl from.

Returns

A reference to this SpotlightKey.

SpotlightKey &operator=(SpotlightKey const &in_that)

Associate this SpotlightKey with the same underlying impl as the source SpotlightKey.

Parameters

in_that – The source SpotlightKey for the assignment.

Returns

A reference to this SpotlightKey.

void Set(SpotlightKit const &in_kit)

Replace those settings on this SpotlightKey with those set on the specified kit.

Parameters

in_kit – The kit from which to get the settings to replace on this SpotlightKey.

SpotlightKey &SetCameraRelative(bool in_state)

Sets whether the coordinates of the position and target for this SpotlightKey are treated as being in object space or camera-relative space.

See

SetPosition

See

SetTarget

Parameters

in_state – Whether the coordinates of the position and target for this SpotlightKey are treated as being in object space or camera-relative space.

Returns

A reference to this SpotlightKey.

SpotlightKey &SetColor(RGBAColor const &in_rgba_color)

Sets the RGBA color to use for this SpotlightKey.

Parameters

in_rgba_color – The RGBA color to use for this SpotlightKey.

Returns

A reference to this SpotlightKey.

SpotlightKey &SetColorByIndex(float in_index)

Sets the color index to use for this SpotlightKey.

Parameters

in_index – The color index to use for this SpotlightKey.

Returns

A reference to this SpotlightKey.

SpotlightKey &SetConcentration(float in_concentration)

Sets the concentration for this SpotlightKey. The concentration defines the rate at which light intensity decreases with increasing angular distance from the light direction vector. This effect works in addition to the decrease that occurs between the inner and outer cones.

Parameters

in_concentration – The concentration for the SpotlightKey. This value must be non-negative. A value of 0.0f defines no intensity decrease (besides that between the inner and outer cone), and larger values will concentrate intensity closer to the light direction vector.

Returns

A reference to this SpotlightKey.

SpotlightKey &SetInnerCone(float in_size, HPS::Spotlight::InnerConeUnits in_units = HPS::Spotlight::InnerConeUnits::Percent)

Sets the size of the inner cone for this SpotlightKey. The inner cone defines the conic region inside the conic region defined by the outer cone at which the spotlight intensity will decrease linearly to zero at the outer cone’s edge. As such, the size of the inner cone should be no larger than the outer cone.

Parameters
Returns

A reference to this SpotlightKey.

SpotlightKey &SetOuterCone(float in_size, HPS::Spotlight::OuterConeUnits in_units = HPS::Spotlight::OuterConeUnits::Degrees)

Sets the size of the outer cone for this SpotlightKey. The outer cone defines the conic region inside of which surfaces will be illuminated by this spotlight. Any surface outside this conic region will not be illuminated by this spotlight.

Parameters
Returns

A reference to this SpotlightKey.

SpotlightKey &SetPosition(HPS::Point const &in_position)

Sets the position of the light source for this SpotlightKey.

See

SetCameraRelative

Parameters

in_position – The position of the light source for this SpotlightKey. The point will either be treated as being in object space or in camera-relative units depending on the setting passed to SetCameraRelative.

Returns

A reference to this SpotlightKey.

SpotlightKey &SetTarget(HPS::Point const &in_target)

Sets the target coordinate towards which the light source points for this SpotlightKey.

See

SetCameraRelative

Parameters

in_target – The target coordinate towards which the light source points for this SpotlightKey. The point will either be treated as being in object space or in camera-relative units depending on the setting passed to SetCameraRelative.

Returns

A reference to this SpotlightKey.

void Show(SpotlightKit &out_kit) const

Copy the contents of this SpotlightKey into the specified kit.

Parameters

out_kit – The kit to populate with the contents of this SpotlightKey.

bool ShowCameraRelative(bool &out_state) const

Shows whether the coordinates of the position and target for this SpotlightKey are treated as being in object space or camera-relative space.

Parameters

out_state – Whether the coordinates of the position and target for this SpotlightKey are treated as being in object space or camera-relative space.

Returns

true if a camera-relative setting was set, false otherwise.

bool ShowColor(Material::Type &out_type, RGBAColor &out_rgba_color, float &out_index) const

Shows the color for this SpotlightKey.

Parameters
  • out_type – The type of color for the spotlight.

  • out_rgba_color – The RGBA color for the spotlight. This is only valid if out_type is Material::Type::RGBAColor.

  • out_index – The material index for the spotlight. This is only valid if out_type is Material::Type::MaterialIndex.

Returns

true if a color was set, false otherwise.

bool ShowConcentration(float &out_concentration) const

Shows the concentration for this SpotlightKey.

Parameters

out_concentration – The concentration for this SpotlightKey.

Returns

true if a concentration was set, false otherwise.

bool ShowInnerCone(float &out_size, HPS::Spotlight::InnerConeUnits &out_units) const

Shows the inner cone for this SpotlightKey.

Parameters
  • out_size – The size of the inner cone for this SpotlightKey.

  • out_units – The units for the size of the inner cone for this SpotlightKey.

Returns

true if an inner cone was set, false otherwise.

bool ShowOuterCone(float &out_size, HPS::Spotlight::OuterConeUnits &out_units) const

Shows the outer cone for this SpotlightKey.

Parameters
  • out_size – The size of the outer cone for this SpotlightKey.

  • out_units – The units for the size of the outer cone for this SpotlightKey.

Returns

true if an outer cone was set, false otherwise.

bool ShowPosition(HPS::Point &out_position) const

Shows the position of the light source for this SpotlightKey.

Parameters

out_position – The position of the light source for this SpotlightKey.

Returns

true if a light source position was set, false otherwise.

bool ShowTarget(HPS::Point &out_target) const

Shows the target coordinate towards which the light source points for this SpotlightKey.

Parameters

out_target – The target coordinate towards which the light source points for this SpotlightKey.

Returns

true if a target was set, false otherwise.

SpotlightKey()

The default constructor creates an uninitialized SpotlightKey object. The Type() function will return Type::None.

explicit SpotlightKey(Key const &in_that)

This constructor creates a SpotlightKey object that shares the underlying smart-pointer of the source Key. The copy will only be successful if the source key is really an upcast of a Spotlight key. Otherwise the copy will fail and the resulting SpotlightKey will be invalid.

Parameters

in_key – The source Key to copy.

SpotlightKey(SpotlightKey &&in_that)

The move constructor creates a SpotlightKey by transferring the underlying impl of the rvalue reference to this SpotlightKey thereby avoiding a copy and allocation.

Parameters

in_that – An rvalue reference to a SpotlightKey to take the impl from.

SpotlightKey(SpotlightKey const &in_that)

The copy constructor creates a SpotlightKey object that shares the underlying smart-pointer of the source SpotlightKey.

Parameters

in_that – The source SpotlightKey to copy.

SpotlightKey &UnsetColor()

Removes the color (RGBA or material index) set on this SpotlightKey.

Returns

A reference to this SpotlightKey.

~SpotlightKey()

Public Static Attributes

static const HPS::Type staticType = HPS::Type::SpotlightKey