Wasabi
Public Member Functions | Static Public Member Functions | List of all members
WLight Class Reference

#include <WLight.hpp>

Inheritance diagram for WLight:
WOrientation WFileAsset WBase WDirectionalLight WPointLight WSpotLight

Public Member Functions

virtual std::string GetTypeName () const override
 
virtual void SetID (uint32_t newID) override
 
virtual void SetName (std::string newName) override
 
 WLight (class Wasabi *const app, W_LIGHT_TYPE type=W_LIGHT_DIRECTIONAL, uint32_t ID=0)
 
void SetColor (WColor col)
 
void SetRange (float fRange)
 
void SetIntensity (float fIntensity)
 
void SetEmittingAngle (float fAngle)
 
W_LIGHT_TYPE GetType () const
 
WColor GetColor () const
 
float GetRange () const
 
float GetIntensity () const
 
float GetMinCosAngle () const
 
void Show ()
 
void Hide ()
 
bool Hidden () const
 
bool InCameraView (class WCamera *cam) const
 
WMatrix GetWorldMatrix ()
 
bool UpdateLocals ()
 
virtual bool Valid () const override
 
virtual void OnStateChange (STATE_CHANGE_TYPE type) override
 
virtual WError SaveToStream (WFile *file, std::ostream &outputStream) override
 
virtual WError LoadFromStream (WFile *file, std::istream &inputStream, std::vector< void * > &args, std::string nameSuffix) override
 
- Public Member Functions inherited from WOrientation
void SetPosition (float x, float y, float z)
 
void SetPosition (const WVector3 pos)
 
void Point (float x, float y, float z)
 
void Point (WVector3 target)
 
void SetAngle (WQuaternion quat)
 
void SetToRotation (const WOrientation *const device)
 
void SetULRVectors (WVector3 up, WVector3 look, WVector3 right)
 
void SetToTransformation (WMatrix mtx)
 
void Yaw (float angle)
 
void Roll (float angle)
 
void Pitch (float angle)
 
void Move (float units)
 
void Strafe (float units)
 
void Fly (float units)
 
float GetPositionX () const
 
float GetPositionY () const
 
float GetPositionZ () const
 
WVector3 GetPosition () const
 
float GetAngleX () const
 
float GetAngleY () const
 
float GetAngleZ () const
 
WQuaternion GetRotation () const
 
WVector3 GetUVector () const
 
WVector3 GetLVector () const
 
WVector3 GetRVector () const
 
virtual void SetBindingMatrix (WMatrix mtx)
 
void RemoveBinding ()
 
WMatrix GetBindingMatrix () const
 
bool IsBound () const
 
WMatrix ComputeTransformation () const
 
WMatrix ComputeInverseTransformation () const
 
- Public Member Functions inherited from WFileAsset
 WFileAsset (class Wasabi *const app, uint32_t ID=0)
 
virtual WError LoadFromStream (class WFile *file, std::istream &inputStream, vector< void * > &args, std::string nameSuffix)=0
 
- Public Member Functions inherited from WBase
 WBase (class Wasabi *const app, uint32_t ID=0)
 
uint32_t GetID () const
 
std::string GetName () const
 
class WasabiGetAppPtr () const
 
void AddReference ()
 
void RemoveReference ()
 

Static Public Member Functions

static std::string _GetTypeName ()
 
static std::vector< void * > LoadArgs ()
 

Additional Inherited Members

- Protected Attributes inherited from WBase
class Wasabim_app
 
uint32_t m_ID
 
std::string m_name
 

Detailed Description

This represents a light to be rendered by the used renderer. Lights have 3 types:

Member Function Documentation

◆ _GetTypeName()

static std::string WLight::_GetTypeName ( )
static

Returns "Light" string.

Returns
Returns "Light" string

◆ GetColor()

WColor WLight::GetColor ( ) const

Retrieves the color of the light

Returns
Color of the light

◆ GetIntensity()

float WLight::GetIntensity ( ) const

Retrieves the intensity of the light.

Returns
Intensity of the light

◆ GetMinCosAngle()

float WLight::GetMinCosAngle ( ) const

Retrieves the cosine of half the emission angle set.

Returns
Cosine of half the emission angle set.

◆ GetRange()

float WLight::GetRange ( ) const

Retrieves the range of the light.

Returns
Range of the light

◆ GetType()

W_LIGHT_TYPE WLight::GetType ( ) const

Retrieves the type of the light.

Returns
Type of the light

◆ GetTypeName()

virtual std::string WLight::GetTypeName ( ) const
overridevirtual

This function must be implemented by a child class. This is used for debugging, in which a class should return its name.

Returns
The name of the class

Implements WBase.

◆ GetWorldMatrix()

WMatrix WLight::GetWorldMatrix ( )

Retrieves the world matrix for the light.

Returns
World matrix for the light

◆ Hidden()

bool WLight::Hidden ( ) const

Checks if the light is hidden.

Returns
true if the light is hidden, false otherwise

◆ Hide()

void WLight::Hide ( )

Hides the light.

◆ InCameraView()

bool WLight::InCameraView ( class WCamera cam) const

Checks if the light appears anywhere in the view of the camera

Parameters
camCamera to check against
Returns
true if the light is in the viewing frustum of cam, false otherwise

◆ OnStateChange()

virtual void WLight::OnStateChange ( STATE_CHANGE_TYPE  type)
overridevirtual

A callback called by this class when the entity changes its position or orientation.

Parameters
typeOrientation change type

Reimplemented from WOrientation.

◆ SetColor()

void WLight::SetColor ( WColor  col)

Sets the color of this light

Parameters
colNew color, alpha component will be used as light specular power

◆ SetEmittingAngle()

void WLight::SetEmittingAngle ( float  fAngle)

Sets the angle at which the spot light emits (angle for the cone). This is ignored in other light types.

Parameters
fAngleAngle of emission, in degrees

◆ SetID()

virtual void WLight::SetID ( uint32_t  newID)
overridevirtual

Sets the ID of this object and notifies its manager.

Parameters
newIDNew ID

Implements WBase.

◆ SetIntensity()

void WLight::SetIntensity ( float  fIntensity)

Sets the intensity of the light.

Parameters
fIntensityNew intensity

◆ SetName()

virtual void WLight::SetName ( std::string  newName)
overridevirtual

Sets the name of this object.

Parameters
nameNew name for the object

Implements WBase.

◆ SetRange()

void WLight::SetRange ( float  fRange)

Sets the range of the light. In case of a directional light, this is ignored. In case of a point light, this is the radius of the sphere. In case of a spot light, this is the length of the cone.

Parameters
fRangeNew range

◆ Show()

void WLight::Show ( )

Shows the light so that it can be rendered.

◆ UpdateLocals()

bool WLight::UpdateLocals ( )

Updates the world matrix of the light.

Returns
true if the matrix has changed, false otherwise

◆ Valid()

virtual bool WLight::Valid ( ) const
overridevirtual

Always true.

Returns
true

Implements WBase.


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