Kanzi 4.1.0
kanzi::GatherNearestLightsRenderPass::LightDistanceInfo Class Reference

Light distance information. More...

#include <kanzi/core.ui/graphics3d/gather_nearest_lights_render_pass.hpp>

Public Member Functions

float getDistanceSquared () const
 Gets the distance squared.
 
LightInfogetLightInfo () const
 Gets the referred light.
 
 LightDistanceInfo ()=default
 Default constructor.
 
 LightDistanceInfo (LightInfo &lightInfo)
 Constructor.
 
bool operator!= (const LightDistanceInfo &other) const
 Not equals operator.
 
bool operator< (const LightDistanceInfo &other) const
 Less than operator for sorting.
 
bool operator== (const LightDistanceInfo &other) const
 Equals operator.
 
void updateDistance (const Node3D &referenceNode)
 Updates the distance based on a reference node.
 

Protected Attributes

float m_distanceSquared
 Distance to light (from reference node).
 
LightInfom_lightInfo
 Light information referred.
 

Detailed Description

Light distance information.

References a LightInfo structure from GatherLightsRenderPass. Adds distance so sorting is possible.

Declared in detail namespace to ensure equals operator lookup works.

Constructor & Destructor Documentation

◆ LightDistanceInfo() [1/2]

kanzi::GatherNearestLightsRenderPass::LightDistanceInfo::LightDistanceInfo ( )
explicitdefault

Default constructor.

◆ LightDistanceInfo() [2/2]

kanzi::GatherNearestLightsRenderPass::LightDistanceInfo::LightDistanceInfo ( LightInfo & lightInfo)
explicit

Constructor.

Calculates distance internally.

Parameters
lightInfoGathered light info.

Member Function Documentation

◆ getLightInfo()

LightInfo * kanzi::GatherNearestLightsRenderPass::LightDistanceInfo::getLightInfo ( ) const
inline

Gets the referred light.

Returns
Pointer to a light info struct.

◆ getDistanceSquared()

float kanzi::GatherNearestLightsRenderPass::LightDistanceInfo::getDistanceSquared ( ) const
inline

Gets the distance squared.

Returns
Distance squared.

◆ updateDistance()

void kanzi::GatherNearestLightsRenderPass::LightDistanceInfo::updateDistance ( const Node3D & referenceNode)

Updates the distance based on a reference node.

Parameters
referenceNodeNode with which to update the distance.

◆ operator<()

bool kanzi::GatherNearestLightsRenderPass::LightDistanceInfo::operator< ( const LightDistanceInfo & other) const
inline

Less than operator for sorting.

Parameters
otherOther distance info compared against.
Returns
True if this is smaller than the counterpart.

◆ operator==()

bool kanzi::GatherNearestLightsRenderPass::LightDistanceInfo::operator== ( const LightDistanceInfo & other) const
inline

Equals operator.

Parameters
otherOther object.
Returns
If the distance informations are equal true, false otherwise.

◆ operator!=()

bool kanzi::GatherNearestLightsRenderPass::LightDistanceInfo::operator!= ( const LightDistanceInfo & other) const
inline

Not equals operator.

Parameters
otherOther object.
Returns
If the distance informations are not equal true, false otherwise.

Member Data Documentation

◆ m_lightInfo

LightInfo* kanzi::GatherNearestLightsRenderPass::LightDistanceInfo::m_lightInfo
protected

Light information referred.

◆ m_distanceSquared

float kanzi::GatherNearestLightsRenderPass::LightDistanceInfo::m_distanceSquared
protected

Distance to light (from reference node).

Saved as squared, there is no need to take the root simply for comparison.


The documentation for this class was generated from the following file: