C3D Toolkit  Kernel - 117982, Vision - 2.9.2.2

Light source. More...

#include <vsn_light.h>

+ Inheritance diagram for VSN::Light:
+ Collaboration diagram for VSN::Light:

Public Types

enum  LightTypes { }
 

Public Member Functions

 Light (const OpenGLContextInterface *pContext=nullptr, const Color &color=Color(255, 255, 255))
 Default constructor. Default color of ambience is black, diffuse color is white and specular color is white.
 
 Light (LightTypes lightType, const OpenGLContextInterface *pContext=nullptr, const Color &color=Color(255, 255, 255))
 Constructor with light type selection. Default color of ambience is black, diffuse color is white and specular color is white.
 
 Light (const Light &other)
 Copy-constructor.
 
virtual ~Light ()
 Destructor.
 
bool IsLightEnabled () const
 If light source is enabled.
 
void SetLightEnabled (bool bEnable)
 Turns the light on/off.
 
Point3DF GetPosition () const
 Returns the position of the light source.
 
void SetPosition (const Point3DF &pos)
 Sets the position of the light source.
 
void SetPosition (float x, float y, float z)
 Sets the position of the light source.
 
Color GetAmbientColor () const
 Returns the ambient color of the light. Default value is [0.0, 0.0, 0.0, 1.0].
 
void SetAmbientColor (const Color &color)
 Sets the ambient color of the light. Default value is [0.0, 0.0, 0.0, 1.0].
 
Color GetDiffuseColor () const
 Returns the diffuse color of the light. Default value is [0.0, 0.0, 0.0, 1.0] or [1.0, 1.0, 1.0, 1.0].
 
void SetDiffuseColor (const Color &color)
 Sets the diffuse color of the light. Default value is [0.0, 0.0, 0.0, 1.0] or [1.0, 1.0, 1.0, 1.0].
 
Color GetSpecularColor () const
 Returns the specular color of the light. Default value is [0.0, 0.0, 0.0, 1.0] or [1.0, 1.0, 1.0, 1.0].
 
void SetSpecularColor (const Color &color)
 Sets the specular color of the light. Default value is [0.0, 0.0, 0.0, 1.0] or [1.0, 1.0, 1.0, 1.0].
 
bool IsDoubleSided () const
 Checks if two-sided lighting mode is enabled.
 
void SetDoubleSided (bool bDoubleSided)
 Sets the two-sided lighting mode.
 
Light::LightTypes GetType () const
 Returns the light type.
 
void SetType (Light::LightTypes type)
 Sets the light type.
 
uint GetLightID () const
 Returns the identifier of the light source.
 
float GetConstantAttenuation () const
 Returns the constant attenuation of the light source.
 
void SetConstantAttenuation (float attenuationConstant)
 Sets the constant attenuation of the light source.
 
float GetLinearAttenuation () const
 Returns the linear attenuation of the light source.
 
void SetLinearAttenuation (float linearAttenuation)
 Sets the constant attenuation of the light source.
 
float GetQuadraticAttenuation () const
 Returns the quadratic attenuation of the light source.
 
void SetQuadraticAttenuation (float attenuationQuadric)
 Sets the quadratic attenuation of the light source.
 
Vector3DF GetSpotDirection () const
 Returns the light direction from the point source. The spotlight direction is (x, y, z). It might be represented as an axis of bounding cone.
 
void SetSpotDirection (const Vector3DF &direction)
 Sets the light direction from the point source. The spotlight direction is (x, y, z). It might be represented as an axis of bounding cone.
 
float GetSpotCutoffAngle () const
 Returns angle between axis and cone side of the point light source(semivertex angle).
 
void SetSpotCutoffAngle (float cutoffAngle)
 Sets angle between axis and cone side of the point light source(semivertex angle).
 
float GetSpotExponent () const
 Returns the intensity decreasing exponent of the point light source.
 
void SetSpotExponent (float exponent)
 Sets the intensity decreasing exponent of the point light source.
 
- Public Member Functions inherited from VSN::Object
 Object (Object *pParent=nullptr)
 Default constructor. More...
 
virtual ~Object ()
 Destructor.
 
void SetParent (Object *pParent)
 NO TRANSLATION.
 
MutexGetMutex ()
 Object mutex.
 
String GetObjectName () const
 Returns name.
 
void SetObjectName (const String &name)
 Sets name.
 
bool IsControlType () const
 TRANSLATION.
 
ObjectGetParent () const
 NO TRANSLATION.
 
Variant GetProperty (const String &name) const
 NO TRANSLATION.
 
bool IsSignalsBlocked () const
 NO TRANSLATION.
 
bool SetBlockSignals (bool bBlock)
 NO TRANSLATION.
 
void AddEventListener (Object *pObject)
 NO TRANSLATION.
 
void RemoveEventListener (Object *pObject)
 NO TRANSLATION.
 
ObjectGetSender () const
 NO TRANSLATION.
 
Thread * GetThread () const
 NO TRANSLATION.
 
void BindWithThread (Thread *thread)
 NO TRANSLATION.
 
int StartTimer (int interval, TimerType timerType=tt_CoarseTimer)
 NO TRANSLATION.
 
void KillTimer (int id)
 NO TRANSLATION.
 
const ObjectList< Object * > & GetChildren () const
 NO TRANSLATION.
 
template<typename T >
FindChild (const String &objName=String()) const
 NO TRANSLATION.
 
template<typename T >
ObjectList< T > FindChildren (const String &objName=String(), VSN::ChildFindingPolicies policies=VSN::FindAllNestedChildren) const
 NO TRANSLATION.
 
- Public Member Functions inherited from VSN::BasicObject
 BasicObject ()
 Default constructor.
 
virtual ~BasicObject ()
 Destructor.
 

Static Public Member Functions

static int GetLightMaxCount ()
 Returns maximum amount of light sources.
 
static size_t GetOperatingLightCount (OpenGLContextInterface *pContext)
 Returns amount of operating light sources.
 

Detailed Description

Light source.

Light is a point light source. The light source has its 3D position, and its complex color.

Member Enumeration Documentation

◆ LightTypes

Enumerator
DirectionLight 

точечные источники света испускают свет одинаково во всех направлениях, поэтому требуют только позицию без направления.

SpotLight 

направленный свет моделирует параллельные лучи света от удаленного источника, следовательно, имеет направление, но не позицию.


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