ASW Lib
A.D.S. Games SDL Wrapper Library. A library targeted at Allegro4 users who want to switch to SDL3 and use modern c++.
Loading...
Searching...
No Matches
asw::lighting::Light Struct Reference

A light. Positions are in world space when the light map has a camera, otherwise in screen space. More...

#include <lighting.h>

Collaboration diagram for asw::lighting::Light:
[legend]

Public Attributes

asw::Vec2< float > position
 Centre of the light.
 
float radius { 128.0F }
 Distance the light reaches, in pixels.
 
asw::Color color { 255, 255, 255 }
 Colour of the light.
 
float intensity { 1.0F }
 Brightness from 0 to 1. Scales the colour.
 
asw::Falloff falloff { asw::Falloff::Smooth }
 How the light fades to its edge.
 
float direction { 0.0F }
 Direction a spot light points, in radians. 0 is right, and angles turn clockwise on screen.
 
float cone { 0.0F }
 Width of a spot light's beam, in radians. 0 lights all round.
 
bool shadows { true }
 Whether occluders block this light.
 
float flicker { 0.0F }
 Random flicker from 0 to 1. 0.2 suits a torch.
 
float pulse { 0.0F }
 Size of a steady pulse from 0 to 1.
 
float pulse_speed { 1.0F }
 Pulses per second.
 
int seed { 0 }
 Gives lights their own flicker and pulse timing. Use a different seed for each light.
 

Detailed Description

A light. Positions are in world space when the light map has a camera, otherwise in screen space.

Definition at line 42 of file lighting.h.

Member Data Documentation

◆ color

asw::Color asw::lighting::Light::color { 255, 255, 255 }

Colour of the light.

Definition at line 50 of file lighting.h.

◆ cone

float asw::lighting::Light::cone { 0.0F }

Width of a spot light's beam, in radians. 0 lights all round.

Definition at line 63 of file lighting.h.

◆ direction

float asw::lighting::Light::direction { 0.0F }

Direction a spot light points, in radians. 0 is right, and angles turn clockwise on screen.

Definition at line 60 of file lighting.h.

◆ falloff

asw::Falloff asw::lighting::Light::falloff { asw::Falloff::Smooth }

How the light fades to its edge.

Definition at line 56 of file lighting.h.

◆ flicker

float asw::lighting::Light::flicker { 0.0F }

Random flicker from 0 to 1. 0.2 suits a torch.

Definition at line 69 of file lighting.h.

◆ intensity

float asw::lighting::Light::intensity { 1.0F }

Brightness from 0 to 1. Scales the colour.

Definition at line 53 of file lighting.h.

◆ position

asw::Vec2<float> asw::lighting::Light::position

Centre of the light.

Definition at line 44 of file lighting.h.

◆ pulse

float asw::lighting::Light::pulse { 0.0F }

Size of a steady pulse from 0 to 1.

Definition at line 72 of file lighting.h.

◆ pulse_speed

float asw::lighting::Light::pulse_speed { 1.0F }

Pulses per second.

Definition at line 75 of file lighting.h.

◆ radius

float asw::lighting::Light::radius { 128.0F }

Distance the light reaches, in pixels.

Definition at line 47 of file lighting.h.

◆ seed

int asw::lighting::Light::seed { 0 }

Gives lights their own flicker and pulse timing. Use a different seed for each light.

Definition at line 79 of file lighting.h.

◆ shadows

bool asw::lighting::Light::shadows { true }

Whether occluders block this light.

Definition at line 66 of file lighting.h.


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