ProtoTracer  1.0
Real-time 3D rendering and animation engine
Loading...
Searching...
No Matches
Light Class Reference

Represents a light source with position, intensity, and falloff properties. More...

#include <Light.h>

Collaboration diagram for Light:

Public Member Functions

 Light ()
 Default constructor for the Light class.
 
 Light (Vector3D p, Vector3D intensity, float falloff, float a, float b)
 Constructs a Light object with specified properties.
 
void Set (Vector3D p, Vector3D intensity, float falloff, float a, float b)
 Sets the light's properties.
 
void SetIntensity (Vector3D intensity)
 Sets the intensity of the light.
 
void SetFalloff (float falloff, float a, float b)
 Sets the falloff and attenuation parameters for the light.
 
void MoveTo (Vector3D p)
 Moves the light to a specified position.
 
void Translate (Vector3D p)
 Translates the light by a specified vector.
 
void SetFalloff (float falloff)
 Sets the falloff rate of the light.
 
void SetCurve (float a, float b)
 Sets the attenuation curve parameters for the light.
 
Vector3D GetPosition ()
 Retrieves the position of the light source.
 
float GetFalloff ()
 Retrieves the falloff rate of the light.
 
float GetCurveA ()
 Retrieves the first curve parameter for attenuation.
 
float GetCurveB ()
 Retrieves the second curve parameter for attenuation.
 
Vector3D GetIntensity ()
 Retrieves the intensity of the light.
 

Private Attributes

Vector3D p
 Position of the light source.
 
Vector3D intensity
 Intensity vector of the light.
 
float falloff
 Falloff rate of the light.
 
float a
 Attenuation curve parameter A.
 
float b
 Attenuation curve parameter B.
 

Detailed Description

Represents a light source with position, intensity, and falloff properties.

Definition at line 22 of file Light.h.

Constructor & Destructor Documentation

◆ Light() [1/2]

Light ( )

Default constructor for the Light class.

Definition at line 3 of file Light.cpp.

◆ Light() [2/2]

Light ( Vector3D  p,
Vector3D  intensity,
float  falloff,
float  a,
float  b 
)

Constructs a Light object with specified properties.

Parameters
pPosition of the light source.
intensityIntensity of the light.
falloffFalloff rate of the light.
aCurve parameter for attenuation.
bCurve parameter for attenuation.

Definition at line 7 of file Light.cpp.

Member Function Documentation

◆ GetCurveA()

float GetCurveA ( )

Retrieves the first curve parameter for attenuation.

Returns
Curve parameter A.

Definition at line 59 of file Light.cpp.

References a.

◆ GetCurveB()

float GetCurveB ( )

Retrieves the second curve parameter for attenuation.

Returns
Curve parameter B.

Definition at line 63 of file Light.cpp.

References b.

◆ GetFalloff()

float GetFalloff ( )

Retrieves the falloff rate of the light.

Returns
Falloff rate.

Definition at line 55 of file Light.cpp.

References falloff.

◆ GetIntensity()

Vector3D GetIntensity ( )

Retrieves the intensity of the light.

Returns
Intensity vector.

Definition at line 51 of file Light.cpp.

References intensity.

◆ GetPosition()

Vector3D GetPosition ( )

Retrieves the position of the light source.

Returns
Position vector of the light.

Definition at line 47 of file Light.cpp.

References p.

◆ MoveTo()

void MoveTo ( Vector3D  p)

Moves the light to a specified position.

Parameters
pNew position of the light source.

Definition at line 29 of file Light.cpp.

References p.

Referenced by Boot::Update().

◆ Set()

void Set ( Vector3D  p,
Vector3D  intensity,
float  falloff,
float  a,
float  b 
)

Sets the light's properties.

Parameters
pPosition of the light source.
intensityIntensity of the light.
falloffFalloff rate of the light.
aCurve parameter for attenuation.
bCurve parameter for attenuation.

Definition at line 11 of file Light.cpp.

References a, b, falloff, intensity, and p.

Referenced by Boot::Boot(), Crash::Crash(), and PhysicsSimulator::PhysicsSimulator().

◆ SetCurve()

void SetCurve ( float  a,
float  b 
)

Sets the attenuation curve parameters for the light.

Parameters
aCurve parameter A.
bCurve parameter B.

Definition at line 41 of file Light.cpp.

References a, and b.

◆ SetFalloff() [1/2]

void SetFalloff ( float  falloff)

Sets the falloff rate of the light.

Parameters
falloffFalloff rate.

Definition at line 37 of file Light.cpp.

References falloff.

◆ SetFalloff() [2/2]

void SetFalloff ( float  falloff,
float  a,
float  b 
)

Sets the falloff and attenuation parameters for the light.

Parameters
falloffFalloff rate of the light.
aCurve parameter for attenuation.
bCurve parameter for attenuation.

Definition at line 23 of file Light.cpp.

References a, b, and falloff.

◆ SetIntensity()

void SetIntensity ( Vector3D  intensity)

Sets the intensity of the light.

Parameters
intensityIntensity vector of the light.

Definition at line 19 of file Light.cpp.

References intensity.

◆ Translate()

void Translate ( Vector3D  p)

Translates the light by a specified vector.

Parameters
pTranslation vector.

Definition at line 33 of file Light.cpp.

References p.

Member Data Documentation

◆ a

float a
private

Attenuation curve parameter A.

Definition at line 122 of file Light.h.

Referenced by GetCurveA(), Set(), SetCurve(), and SetFalloff().

◆ b

float b
private

Attenuation curve parameter B.

Definition at line 123 of file Light.h.

Referenced by GetCurveB(), Set(), SetCurve(), and SetFalloff().

◆ falloff

float falloff
private

Falloff rate of the light.

Definition at line 121 of file Light.h.

Referenced by GetFalloff(), Set(), SetFalloff(), and SetFalloff().

◆ intensity

Vector3D intensity
private

Intensity vector of the light.

Definition at line 120 of file Light.h.

Referenced by GetIntensity(), Set(), and SetIntensity().

◆ p

Vector3D p
private

Position of the light source.

Definition at line 119 of file Light.h.

Referenced by GetPosition(), MoveTo(), Set(), and Translate().


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