FS2_Open
Open source remastering of the Freespace 2 engine
lighting.h File Reference

Go to the source code of this file.

Classes

struct  light
 
struct  light_indexing_info
 
class  scene_lights
 

Macros

#define LT_DIRECTIONAL   0
 
#define LT_POINT   1
 
#define LT_TUBE   2
 
#define LT_CONE   3
 
#define MAX_LIGHT_LEVELS   16
 

Typedefs

typedef struct light light
 

Functions

void light_reset ()
 
void light_set_ambient (float ambient_light)
 
void light_add_directional (const vec3d *dir, float intensity, float r, float g, float b, float spec_r=0.0f, float spec_g=0.0f, float spec_b=0.0f, bool specular=false)
 
void light_add_point (const vec3d *pos, float r1, float r2, float intensity, float r, float g, float b, int light_ignore_objnum, float spec_r=0.0f, float spec_g=0.0f, float spec_b=0.0f, bool specular=false)
 
void light_add_point_unique (const vec3d *pos, float r1, float r2, float intensity, float r, float g, float b, int affected_objnum, float spec_r=0.0f, float spec_g=0.0f, float spec_b=0.0f, bool specular=false)
 
void light_add_tube (const vec3d *p0, const vec3d *p1, float r1, float r2, float intensity, float r, float g, float b, int affected_objnum, float spec_r=0.0f, float spec_g=0.0f, float spec_b=0.0f, bool specular=false)
 
void light_add_cone (const vec3d *pos, const vec3d *dir, float angle, float inner_angle, bool dual_cone, float r1, float r2, float intensity, float r, float g, float b, int light_ignore_objnum, float spec_r=0.0f, float spec_g=0.0f, float spec_b=0.0f, bool specular=false)
 
void light_rotate_all ()
 
int light_filter_push (int objnum, const vec3d *pos, float rad)
 
int light_filter_push_box (const vec3d *min, const vec3d *max)
 
void light_filter_pop ()
 
ubyte light_apply (const vec3d *pos, const vec3d *norm, float static_light_val)
 
void light_apply_specular (ubyte *param_r, ubyte *param_g, ubyte *param_b, const vec3d *pos, const vec3d *norm, const vec3d *cam)
 
void light_apply_rgb (ubyte *param_r, ubyte *param_g, ubyte *param_b, const vec3d *pos, const vec3d *norm, float static_light_val)
 
int light_get_global_count ()
 
int light_get_global_dir (vec3d *pos, int n)
 
void light_set_shadow (int state)
 
bool light_compare_by_type (const light &a, const light &b)
 

Variables

SCP_vector< light * > Static_light
 

Macro Definition Documentation

#define LT_CONE   3

Definition at line 28 of file lighting.h.

#define LT_DIRECTIONAL   0

Definition at line 25 of file lighting.h.

#define LT_POINT   1

Definition at line 26 of file lighting.h.

#define LT_TUBE   2

Definition at line 27 of file lighting.h.

#define MAX_LIGHT_LEVELS   16

Definition at line 30 of file lighting.h.

Typedef Documentation

typedef struct light light

Function Documentation

void light_add_cone ( const vec3d pos,
const vec3d dir,
float  angle,
float  inner_angle,
bool  dual_cone,
float  r1,
float  r2,
float  intensity,
float  r,
float  g,
float  b,
int  light_ignore_objnum,
float  spec_r = 0.0f,
float  spec_g = 0.0f,
float  spec_b = 0.0f,
bool  specular = false 
)

Definition at line 1050 of file lighting.cpp.

void light_add_directional ( const vec3d dir,
float  intensity,
float  r,
float  g,
float  b,
float  spec_r = 0.0f,
float  spec_g = 0.0f,
float  spec_b = 0.0f,
bool  specular = false 
)

Definition at line 209 of file lighting.cpp.

void light_add_point ( const vec3d pos,
float  r1,
float  r2,
float  intensity,
float  r,
float  g,
float  b,
int  light_ignore_objnum,
float  spec_r = 0.0f,
float  spec_g = 0.0f,
float  spec_b = 0.0f,
bool  specular = false 
)

Definition at line 253 of file lighting.cpp.

void light_add_point_unique ( const vec3d pos,
float  r1,
float  r2,
float  intensity,
float  r,
float  g,
float  b,
int  affected_objnum,
float  spec_r = 0.0f,
float  spec_g = 0.0f,
float  spec_b = 0.0f,
bool  specular = false 
)

Definition at line 300 of file lighting.cpp.

void light_add_tube ( const vec3d p0,
const vec3d p1,
float  r1,
float  r2,
float  intensity,
float  r,
float  g,
float  b,
int  affected_objnum,
float  spec_r = 0.0f,
float  spec_g = 0.0f,
float  spec_b = 0.0f,
bool  specular = false 
)

Definition at line 343 of file lighting.cpp.

ubyte light_apply ( const vec3d pos,
const vec3d norm,
float  static_light_val 
)

Definition at line 666 of file lighting.cpp.

void light_apply_rgb ( ubyte param_r,
ubyte param_g,
ubyte param_b,
const vec3d pos,
const vec3d norm,
float  static_light_val 
)

Definition at line 899 of file lighting.cpp.

void light_apply_specular ( ubyte param_r,
ubyte param_g,
ubyte param_b,
const vec3d pos,
const vec3d norm,
const vec3d cam 
)

Definition at line 749 of file lighting.cpp.

bool light_compare_by_type ( const light a,
const light b 
)

Definition at line 1101 of file lighting.cpp.

void light_filter_pop ( )

Definition at line 574 of file lighting.cpp.

int light_filter_push ( int  objnum,
const vec3d pos,
float  rad 
)

Makes a list of only the lights that will affect the sphere specified by 'pos' and 'rad' and 'objnum'

Parameters
objnumObject number
posWorld position
radRadius

Definition at line 416 of file lighting.cpp.

int light_filter_push_box ( const vec3d min,
const vec3d max 
)

Definition at line 526 of file lighting.cpp.

int light_get_global_count ( )

Return the # of global light sources

Definition at line 608 of file lighting.cpp.

int light_get_global_dir ( vec3d pos,
int  n 
)

Fills direction of global light source N in pos.

Parameters
posPosition
nLight source

Returns 0 if there is no global light.

Definition at line 621 of file lighting.cpp.

void light_reset ( )

Definition at line 150 of file lighting.cpp.

void light_rotate_all ( )

Definition at line 585 of file lighting.cpp.

void light_set_ambient ( float  ambient_light)

Definition at line 205 of file lighting.cpp.

void light_set_shadow ( int  state)

Definition at line 638 of file lighting.cpp.

Variable Documentation

SCP_vector<light*> Static_light

Definition at line 36 of file lighting.cpp.