KiCad PCB EDA Suite
Loading...
Searching...
No Matches
DIRECTIONAL_LIGHT Class Reference

A light source based only on a directional vector. More...

#include <light.h>

Inheritance diagram for DIRECTIONAL_LIGHT:
LIGHT

Public Member Functions

 DIRECTIONAL_LIGHT (const SFVEC3F &aDir, const SFVEC3F &aColor)
 
void SetDirection (const SFVEC3F &aDir)
 Set directional light orientation.
 
void GetLightParameters (const SFVEC3F &, SFVEC3F &aOutVectorToLight, SFVEC3F &aOutLightColor, float &aOutDistance) const override
 Get parameters from this light.
 
void SetCastShadows (bool aCastShadow)
 
bool GetCastShadows () const
 

Protected Attributes

bool m_castShadow
 

Private Attributes

SFVEC3F m_inv_direction
 opposite direction of the light
 
SFVEC3F m_color
 light color
 

Detailed Description

A light source based only on a directional vector.

Definition at line 115 of file light.h.

Constructor & Destructor Documentation

◆ DIRECTIONAL_LIGHT()

DIRECTIONAL_LIGHT::DIRECTIONAL_LIGHT ( const SFVEC3F aDir,
const SFVEC3F aColor 
)
inline

Definition at line 118 of file light.h.

References LIGHT::m_castShadow, m_color, and m_inv_direction.

Member Function Documentation

◆ GetCastShadows()

bool LIGHT::GetCastShadows ( ) const
inlineinherited

Definition at line 60 of file light.h.

References LIGHT::m_castShadow.

◆ GetLightParameters()

void DIRECTIONAL_LIGHT::GetLightParameters ( const SFVEC3F aHitPoint,
SFVEC3F aOutVectorToLight,
SFVEC3F aOutLightColor,
float &  aOutDistance 
) const
inlineoverridevirtual

Get parameters from this light.

Parameters
aHitPointinput hit position
aOutVectorToLighta vector that points from the hit position in direction to the light
aOutLightColorthe color of this light
aOutDistancethe distance from the point to the light

Implements LIGHT.

Definition at line 134 of file light.h.

References m_color, and m_inv_direction.

◆ SetCastShadows()

void LIGHT::SetCastShadows ( bool  aCastShadow)
inlineinherited

Definition at line 59 of file light.h.

References LIGHT::m_castShadow.

Referenced by RENDER_3D_RAYTRACE_BASE::Reload().

◆ SetDirection()

void DIRECTIONAL_LIGHT::SetDirection ( const SFVEC3F aDir)
inline

Set directional light orientation.

Parameters
aDiris the vector defining the direction of the light source.

Definition at line 131 of file light.h.

References m_inv_direction.

Referenced by RENDER_3D_RAYTRACE_GL::Redraw(), RENDER_3D_RAYTRACE_RAM::Redraw(), and RENDER_3D_RAYTRACE_BASE::render().

Member Data Documentation

◆ m_castShadow

bool LIGHT::m_castShadow
protectedinherited

◆ m_color

SFVEC3F DIRECTIONAL_LIGHT::m_color
private

light color

Definition at line 144 of file light.h.

Referenced by DIRECTIONAL_LIGHT(), and GetLightParameters().

◆ m_inv_direction

SFVEC3F DIRECTIONAL_LIGHT::m_inv_direction
private

opposite direction of the light

Definition at line 143 of file light.h.

Referenced by DIRECTIONAL_LIGHT(), GetLightParameters(), and SetDirection().


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