Colobot
Classes | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
Gfx::CLightning Class Reference

Lightning effect renderer. More...

#include <lightning.h>

Classes

struct  LightningSegment
 

Public Member Functions

 CLightning (CEngine *engine)
 
bool Create (float sleep, float delay, float magnetic)
 Triggers lightning. More...
 
void Flush ()
 Removes lightning. More...
 
bool GetStatus (float &sleep, float &delay, float &magnetic, float &progress)
 Gives the status of lightning. More...
 
bool SetStatus (float sleep, float delay, float magnetic, float progress)
 Specifies the status of lightning. More...
 
bool EventProcess (const Event &event)
 Management of an event. More...
 
void Draw ()
 Draws lightning. More...
 
void StrikeAtPos (Math::Vector pos)
 Shoots lightning strike at given position. More...
 

Protected Types

enum  LightningPhase { Wait, Flash }
 

Protected Member Functions

bool EventFrame (const Event &event)
 Updates lightning. More...
 
CObjectSearchObject (Math::Vector pos)
 Seeks for the object closest to the lightning. More...
 

Protected Attributes

CEnginem_engine = nullptr
 
CTerrainm_terrain = nullptr
 
CCameram_camera = nullptr
 
CSoundInterfacem_sound = nullptr
 
bool m_lightningExists = false
 
float m_sleep = 0.0f
 
float m_delay = 0.0f
 
float m_magnetic = 0.0f
 
float m_speed = 0.0f
 
float m_progress = 0.0f
 
Math::Vector m_pos
 
LightningPhase m_phase = LightningPhase::Wait
 
std::vector< LightningSegmentm_segments
 

Detailed Description

Lightning effect renderer.

TODO: documentation

Member Function Documentation

bool Gfx::CLightning::Create ( float  sleep,
float  delay,
float  magnetic 
)

Triggers lightning.

void Gfx::CLightning::Flush ( )

Removes lightning.

bool Gfx::CLightning::GetStatus ( float &  sleep,
float &  delay,
float &  magnetic,
float &  progress 
)

Gives the status of lightning.

bool Gfx::CLightning::SetStatus ( float  sleep,
float  delay,
float  magnetic,
float  progress 
)

Specifies the status of lightning.

bool Gfx::CLightning::EventProcess ( const Event event)

Management of an event.

void Gfx::CLightning::Draw ( )

Draws lightning.

void Gfx::CLightning::StrikeAtPos ( Math::Vector  pos)

Shoots lightning strike at given position.

bool Gfx::CLightning::EventFrame ( const Event event)
protected

Updates lightning.

CObject * Gfx::CLightning::SearchObject ( Math::Vector  pos)
protected

Seeks for the object closest to the lightning.


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