Workspace 6.21.5
Public Member Functions | List of all members
PointLight Class Reference

Defines a point light source at specific position with attentuation. More...

#include <Rendering/SceneComponents/Lights/pointlight.h>

Inheritance diagram for PointLight:
[legend]

Public Member Functions

 PointLight ()
 
 PointLight (const PointLight &light)
 
 ~PointLight () override
 
void clearAttenuationFactors ()
 
PointLightclone () const override
 
double getAttenuationFactor (unsigned power) const
 
unsigned numAttenuationFactors () const
 
PointLightoperator= (const PointLight &light)
 
void setAttenuationFactor (unsigned power, double factor)
 
bool visit (LightsProcessor &processor) override
 
- Public Member Functions inherited from Light
 Light (const QString &id="")
 
 ~Light () override
 
Lightclone () const override=0
 
const QColor & getColor () const
 
double getIntensity () const
 
Mesh::Vector3d getOrientation () const
 
Mesh::Vector3d getPosition () const
 
void setColor (const QColor &color)
 
void setIntensity (double d)
 
virtual bool visit (LightsProcessor &processor)=0
 
bool visit (SceneProcessor &processor) override
 
- Public Member Functions inherited from SceneItem
 ~SceneItem () override
 
SceneItemclone () const override=0
 
bool getEnabled () const
 
const QString & getId () const
 
const Mesh::BoundingBoxMinimalgetLocalBoundingBox () const
 
virtual Mesh::TransformMatrix getMatrixGlobal () const
 
virtual Mesh::TransformMatrix getMatrixLocal () const
 
const QString & getName () const
 
Mesh::TransformMatrix getParentMatrixGlobal () const
 
TransformgetParentTransform ()
 
void setEnabled (bool b)
 
void setId (const QString &itemId)
 
virtual void setLocalBoundingBox (const Mesh::BoundingBoxMinimal &bb)
 
void setName (const QString &name)
 
virtual TransformtoTransform ()
 
virtual const TransformtoTransform () const
 
virtual void updateGlobalMatrix ()
 
virtual bool visit (SceneProcessor &processor)=0
 
- Public Member Functions inherited from Observable
virtual ~Observable ()
 
void attachObserver (Observer &observer)
 
void destroy ()
 
void detachObserver (Observer &observer)
 
void notifyEvent (const ObservableEvent &event)
 
- Public Member Functions inherited from Clonable
virtual ~Clonable ()=default
 
virtual Clonableclone () const =0
 

Additional Inherited Members

- Protected Member Functions inherited from Light
 Light (const Light &light)
 
Lightoperator= (const Light &light)
 
- Protected Member Functions inherited from SceneItem
 SceneItem (const QString &id)
 
 SceneItem (const SceneItem &item)
 
virtual void addToScene (Scene &scene, const QString &opIdPath="")
 
bool isTransformModified () const
 
SceneItemoperator= (const SceneItem &item)
 
void setTransformModified (bool b)
 
- Protected Member Functions inherited from Observable
 Observable ()
 
 Observable (const Observable &)
 

Detailed Description

Point lights do support attenuation but not edge fall-off. You can think of a point light as being essentially the same as a spot light with no cutoff angle.

See also
SpotLight

Constructor & Destructor Documentation

◆ PointLight() [1/2]

◆ PointLight() [2/2]

PointLight ( const PointLight light)

◆ ~PointLight()

~PointLight ( )
override

Member Function Documentation

◆ clearAttenuationFactors()

void clearAttenuationFactors ( )

Clears all the attenuation factors. This will result in a light with no attenuation with distance from the light source.

See also
setAttenuationFactors(), numAttenuationFactors()

◆ clone()

PointLight * clone ( ) const
overridevirtual
Returns
A clone of this item.

Subclasses must reimplement this function to return a clone of themselves.

Implements Light.

◆ getAttenuationFactor()

double getAttenuationFactor ( unsigned  power) const
Parameters
powerThe power of the factor to retrieve.
Returns
The factor being applied to the specified power. If no factor has been set for this power, a value of zero will be returned.

◆ numAttenuationFactors()

unsigned numAttenuationFactors ( ) const
Returns
The number of attenuation factors set for this light.
See also
setAttenuationFactors()

◆ operator=()

PointLight & operator= ( const PointLight light)

◆ setAttenuationFactor()

void setAttenuationFactor ( unsigned  power,
double  factor 
)
Parameters
powerThe integer power whose factor will be set. If this is beyond the end of the current set of factors (ie if power is greater or equal to the result from numAttenuationFactors()), the factors will be zero-filled to extend them up to the specified power.
factorThe factor to apply to the power attenuation factor.

The attentuation factors correspond to integer powers starting with a power of zero. The factors may be interpretted differently by different renderers, so ensure you understand how they will be used when setting them. Most renderers will have a fairly small limit on the number of supported powers, but it would normally be safe to assume that up to at least a power of 2 would be supported (this is the limit OpenGL specifies, for example).

◆ visit()

bool visit ( LightsProcessor processor)
overridevirtual
Parameters
processorThe light processor visiting this light.

Light subclasses should reimplement this function to call processor.visit() and return the result of that call. This is the usual visitor pattern as used for other scene items and model processors.

Implements Light.