Tramway SDK
Classes | Functions | Variables
tram::Render::LightTree Namespace Reference

Scene light tree. More...

Classes

struct  Light
 

Functions

Octree< Light * > light_tree ("light tree", 200)
 
void AddLight (light_t light, vec3 pos, float dist)
 Adds a light to the light tree. More...
 
void FindLights (vec3 position, light_t *dest)
 Finds the 4 nearest lights to a given position. More...
 
void RemoveLight (light_t light)
 Removes a light from the light tree. More...
 

Variables

Pool< Lightlight_list ("lighttree pool", 200)
 

Detailed Description

Scene light tree.

Contains all of the dynamic lights in the scene. Useful for finding which lights are illuminating a certain 3D model in the scene.

Internally uses an Octree.

Function Documentation

◆ AddLight()

void tram::Render::LightTree::AddLight ( light_t  light,
vec3  pos,
float  dist 
)

Adds a light to the light tree.

◆ FindLights()

void tram::Render::LightTree::FindLights ( vec3  position,
light_t dest 
)

Finds the 4 nearest lights to a given position.

Parameters
positionPosition from which the lights will be searched.
destPointer to an array of 4 light_t.

◆ light_tree()

Octree< Light * > tram::Render::LightTree::light_tree ( "light tree"  ,
200   
)

◆ RemoveLight()

void tram::Render::LightTree::RemoveLight ( light_t  light)

Removes a light from the light tree.

Variable Documentation

◆ light_list

Pool< Light > tram::Render::LightTree::light_list("lighttree pool", 200) ( "lighttree pool"  ,
200   
)