Visual Servoing Platform version 3.7.0
Loading...
Searching...
No Matches

#include <vpPanda3DLight.h>

Inheritance diagram for vpPanda3DPointLight:

Public Member Functions

 vpPanda3DPointLight (const std::string &name, const vpRGBf &color, const vpColVector &position, const vpColVector &attenuation)
virtual ~vpPanda3DPointLight ()=default
void addToScene (NodePath &scene) const VP_OVERRIDE
const std::string & getName () const
const vpRGBfgetColor () const

Protected Attributes

std::string m_name
vpRGBf m_color

Detailed Description

Class representing a Point Light.

Point lights emit light all around them, from a single point. Their light can be subject to a distance-based attenuation.

Tutorials & Examples

Tutorials
If you are interested in using Panda3D in Augmented Reality applications, you may have a look at:

Examples
tutorial-panda3d-renderer.cpp.

Definition at line 156 of file vpPanda3DLight.h.

Constructor & Destructor Documentation

◆ vpPanda3DPointLight()

vpPanda3DPointLight::vpPanda3DPointLight ( const std::string & name,
const vpRGBf & color,
const vpColVector & position,
const vpColVector & attenuation )
inline

Build a new point light.

See also
vpPanda3DLight constructor.
Parameters
namename of the light
colorcolor of the light
positionPosition in the scene of the light. Uses ViSP coordinates.
attenuationAttenuation components of the light as a function of distance. Should be a vector of size 3 where the first component is the constant intensity factor (no falloff), the second is a linear falloff coefficient, and the last one is the quadratic falloff component. To follow the inverse square law, set this value vector to [0, 0, 1] To have no falloff, set it to [1, 0, 0].

Definition at line 173 of file vpPanda3DLight.h.

References vpArray2D< Type >::size(), and vpPanda3DLight::vpPanda3DLight().

◆ ~vpPanda3DPointLight()

virtual vpPanda3DPointLight::~vpPanda3DPointLight ( )
virtualdefault

Member Function Documentation

◆ addToScene()

void vpPanda3DPointLight::addToScene ( NodePath & scene) const
inlinevirtual

Add the light to the scene.

Parameters
sceneScene where the light should be added.

Implements vpPanda3DLight.

Definition at line 189 of file vpPanda3DLight.h.

References vpPanda3DLight::m_color, and vpPanda3DLight::m_name.

◆ getColor()

const vpRGBf & vpPanda3DLight::getColor ( ) const
inlineinherited

Get the light's color.

Returns
const vpRGBf&

Definition at line 93 of file vpPanda3DLight.h.

References m_color.

◆ getName()

const std::string & vpPanda3DLight::getName ( ) const
inlineinherited

Get the name of the light.

This name should be unique and will be required when interacting with Panda3D to fetch the node.

Definition at line 87 of file vpPanda3DLight.h.

References m_name.

Member Data Documentation

◆ m_color

vpRGBf vpPanda3DLight::m_color
protectedinherited

Name of the light. Should be unique in the scene.

Definition at line 104 of file vpPanda3DLight.h.

Referenced by vpPanda3DAmbientLight::addToScene(), vpPanda3DDirectionalLight::addToScene(), vpPanda3DPointLight::addToScene(), getColor(), and vpPanda3DLight().

◆ m_name

std::string vpPanda3DLight::m_name
protectedinherited