ScEng::SourceLight Class Reference

#include <light.h>

Inheritance diagram for ScEng::SourceLight:

ScEng::LightObject ScEng::Object ScEng::Block List of all members.

Public Types

enum  DATAID { ,
  id_color, id_intensity, id_use_near_att, id_near_att_start,
  id_near_att_end, id_use_far_att, id_far_att_start, id_far_att_end,
  id_hotspot, id_falloff
}
enum  CHUNKS
enum  TYPES { TYPE_POINT = 1, TYPE_SPOT = 2, TYPE_PARALLEL = 3 }
enum  DEPENDENCIES { LIGHT_TARGET_DEPENDENCY = 0, DATA_TABLE_DEPENDENCY = 1 }

Public Member Functions

 SourceLight (bool create_dependencies)
 Constructor.
 ~SourceLight ()
 Destructor.
NodeGetTarget ()
 Returns the light target.
int GetType (int t)
GMT::Color GetColor (int t)
 Returns the color of the light.
float GetIntensity (int t)
 Returns the intensity of the light.
int GetUseNearAtt (int t)
 Returns if the light uses the near attenuation.
float GetNearAttStart (int t)
 Returns the near attenuation start value.
float GetNearAttEnd (int t)
 Returns the near attenuation end value.
int GetUseFarAtt (int t)
 Returns if the light uses the far attenuation.
float GetFarAttStart (int t)
 Returns the far attenuation start value.
float GetFarAttEnd (int t)
 Returns the far attenuation end value.
float GetHotspot (int t)
 Returns the Hotspot value.
float GetFalloff (int t)
 Returns the Falloff value.
void SetTarget (Node *target_node)
void SetType (int type_val, int t)
void SetColor (GMT::Color color_val, int t)
 Sets the color for the light.
void SetIntensity (float intensity_val, int t)
 Sets the intensity.
void SetUseNearAtt (int use_near_att_val, int t)
 Sets if the light uses the near attenuation.
void SetNearAttStart (float near_att_start_val, int t)
 Sets the near attenuation start value.
void SetNearAttEnd (float near_att_end_val, int t)
 Sets the near attenuation end value.
void SetUseFarAtt (int use_far_att_val, int t)
 Sets if the light uses the far attenuation.
void SetFarAttStart (float far_att_start_val, int t)
 Sets the far attenuation start value.
void SetFarAttEnd (float far_att_end_val, int t)
 Sets the far attenuation end value.
void SetHotspot (float hotspot_val, int t)
 Sets the Hotspot value.
void SetFalloff (float falloff_val, int t)
 Sets the Falloff value.
std::string GetClassName ()
BlockType GetBlockType ()
int NumDependencies ()
void SetDependency (int id, Block *se_block)
BlockGetDependency (int id)
std::string GetDependencyName (int id)
 Gets the name for the specified dependency.
int GetNumDataTables ()
DataTableGetDataTable (int id=0)
 Returns the DataTable for this class.
void SetDataTable (DataTable *d, int i=0)
 Sets the i_th data table.
void UpdateDataTable (int id=0)
 Updates the indexes for the DataTable.
int Save (SceneSave *scene_save)
 Saves the info for this class.
int Load (SceneLoad *scene_load)
 Loads the infor for this class.
void DeleteThis ()
 Delete this class.
void ActionBegin (int time, int action)
void ActionEnd (int time, int action)
void Update (int time)
BlockClone ()

Static Public Attributes

static BlockType block_type

Detailed Description

A source light A source light is a simple light model where rays are created mathematically. There are 3 types of source lights, point, spot and parallel. And it can have target or not. If the target exists, the target defines the direction. A point light kindly ignores the target.


Member Enumeration Documentation

enum ScEng::SourceLight::DATAID

Enum DATAID Enums the Ids for the differents Data for the Light

Enumerator:
id_color  <The id for the type in the DataTable
id_intensity  <The id for the color attribute
id_use_near_att  <The id for the intensity in the DataTable
id_near_att_start  <The id for the use near attenuation in the DataTable
id_near_att_end  <The id for the near attenuation start in the DataTable
id_use_far_att  <The id for the near attenuation end in the DataTable
id_far_att_start  <The id for the use far attenuation in the DataTable
id_far_att_end  <The id for the far attenuation start in the DataTable
id_hotspot  <The id for the far attenuation end in the DataTable
id_falloff  <The id for the falloff in the DataTable

enum ScEng::SourceLight::CHUNKS

Enum Chunks Enums the chunks used for this class

enum ScEng::SourceLight::TYPES

Enum Types Enums the possible types of the light.

Enumerator:
TYPE_POINT  Point light
TYPE_SPOT  Spot light
TYPE_PARALLEL  Parallel light

enum ScEng::SourceLight::DEPENDENCIES

Enum DEPENDENCIES Enums the dependencies for this class

Enumerator:
LIGHT_TARGET_DEPENDENCY  A dependency to the light´s target
DATA_TABLE_DEPENDENCY  The DataTable dependency


Member Function Documentation

int ScEng::SourceLight::GetType ( int  t  ) 

Returns the type of the light

See also:
enum TYPES

void ScEng::SourceLight::SetTarget ( Node target_node  )  [virtual]

Sets the camera target Sets the target using MakeDependencyByID

Parameters:
target_node the Node to be used as target
See also:
Block::MakeDependencyByID

Implements ScEng::LightObject.

void ScEng::SourceLight::SetType ( int  type_val,
int  t 
)

Sets the type

Parameters:
type_val the type to be assigned
See also:
enum TYPES

std::string ScEng::SourceLight::GetClassName (  )  [virtual]

Returns the name for this class

Returns:
Returns "SourceLight"

Implements ScEng::Block.

BlockType ScEng::SourceLight::GetBlockType (  )  [virtual]

Returns the BlockType for this class

Returns:
Returns SE_SOURCE_LIGHT_BLOCK_TYPE

Implements ScEng::Block.

int ScEng::SourceLight::NumDependencies (  )  [virtual]

Returns the number of Dependencies for this class

Returns:
Returns 2

Implements ScEng::Block.

void ScEng::SourceLight::SetDependency ( int  id,
Block se_block 
) [virtual]

Sets a Dependency If the id is LIGHT_TARGET_DEPENDENCY the target will be set. If is DATA_TABLE_DEPENDENCY the DataTable will be set

Parameters:
id the if for the dependency
se_block the block to be dependency

Implements ScEng::Block.

Block * ScEng::SourceLight::GetDependency ( int  id  )  [virtual]

Returns the dependency

Parameters:
id the id for the dependency
Returns:
If the id is LIGHT_TARGET_DEPENDENCY returns the light target if the id is DATA_TABLE_DEPENDENCY returns the DataTable

Implements ScEng::Block.

int ScEng::SourceLight::GetNumDataTables (  )  [virtual]

Returns the number of DataTables used for this class

Returns:
Returns 1

Reimplemented from ScEng::Block.

void ScEng::SourceLight::ActionBegin ( int  time,
int  action 
) [inline, virtual]

Informs the block that an action will begin

Parameters:
time the time at which the action begins. more details about the action, for example, it can be a RENDER_ACTION, or a SAVE_ACTION.

Reimplemented from ScEng::Block.

void ScEng::SourceLight::ActionEnd ( int  time,
int  action 
) [inline, virtual]

Informs the block that an action will end.

Parameters:
time the time at which the action ends. more details about the action, for example, it can be a RENDER_ACTION, or a SAVE_ACTION.

Reimplemented from ScEng::Block.

void ScEng::SourceLight::Update ( int  time  )  [inline, virtual]

Informs the block that it needs to update its data. For example, texture and material blocks usually move all their animated parameters from the data_table to int or float variables. This is specially useful when rendering, so there is no need to interpolate a data_value every time.

Parameters:
time the time at which the block needs to update its data.

Reimplemented from ScEng::Block.

Block * ScEng::SourceLight::Clone (  )  [virtual]

Creates a copy of this object and return it. The caller of this function is responsible to add this block to the DAG or to delete it.

Implements ScEng::Block.


Member Data Documentation

BlockType ScEng::SourceLight::block_type [static]

The type of this block BlockType SourceLight::block_type( BlockType::LIGHT, 0x00600000, 0x00000000 );


The documentation for this class was generated from the following files:
Generated on Thu Sep 6 10:49:22 2007 for SceneEngine by  doxygen 1.5.1-p1