g4tools  5.4.0
Public Member Functions | List of all members
tools::sg::head_light Class Reference
Inheritance diagram for tools::sg::head_light:
Inheritance graph
[legend]
Collaboration diagram for tools::sg::head_light:
Collaboration graph
[legend]

Public Member Functions

virtual void render (render_action &a_action)
 
 head_light ()
 
virtual ~head_light ()
 
 head_light (const head_light &a_from)
 
head_lightoperator= (const head_light &a_from)
 
- Public Member Functions inherited from tools::sg::torche
virtual const desc_fieldsnode_desc_fields () const
 
 torche ()
 
virtual ~torche ()
 
 torche (const torche &a_from)
 
torcheoperator= (const torche &a_from)
 
- Public Member Functions inherited from tools::sg::node
virtual void * cast (const std::string &a_class) const
 
virtual const std::string & s_cls () const =0
 
virtual nodecopy () const =0
 
virtual unsigned int cls_version () const
 
virtual void pick (pick_action &)
 
virtual void bbox (bbox_action &)
 
virtual void search (search_action &a_action)
 
virtual void get_matrix (get_matrix_action &a_action)
 
virtual bool write (write_action &a_action)
 
virtual void event (event_action &)
 
virtual bool read (read_action &a_action)
 
virtual void is_visible (visible_action &)
 
virtual void protocol_one_fields (std::vector< field * > &a_fields) const
 
virtual bool draw_in_frame_buffer () const
 
virtual bool touched ()
 
virtual void reset_touched ()
 
 node ()
 
virtual ~node ()
 
void touch ()
 
fieldfield_from_desc (const field_desc &a_desc) const
 
void dump_field_descs (std::ostream &a_out) const
 
fieldfind_field_by_name (const std::string &a_name) const
 

Additional Inherited Members

- Public Attributes inherited from tools::sg::torche
sf_vec< colorf, float > color
 
sf_vec3f direction
 
sf< bool > on
 
- Protected Member Functions inherited from tools::sg::node
 node (const node &)
 
nodeoperator= (const node &)
 
void add_field (field *a_field)
 
bool write_fields (write_action &a_action)
 
bool read_fields (read_action &a_action)
 
field_desc::offset_t field_offset (const field *a_field) const
 
fieldfind_field (const field_desc &a_rdesc) const
 
void check_fields (std::ostream &a_out) const
 

Detailed Description

Definition at line 15 of file head_light.

Constructor & Destructor Documentation

◆ head_light() [1/2]

tools::sg::head_light::head_light ( )
inline

Definition at line 38 of file head_light.

38 :torche(){}

◆ ~head_light()

virtual tools::sg::head_light::~head_light ( )
inlinevirtual

Definition at line 39 of file head_light.

39 {}

◆ head_light() [2/2]

tools::sg::head_light::head_light ( const head_light a_from)
inline

Definition at line 41 of file head_light.

41 :torche(a_from){}

Member Function Documentation

◆ operator=()

head_light& tools::sg::head_light::operator= ( const head_light a_from)
inline

Definition at line 42 of file head_light.

42  {
43  torche::operator=(a_from);
44  return *this;
45  }

◆ render()

virtual void tools::sg::head_light::render ( render_action a_action)
inlinevirtual

Reimplemented from tools::sg::torche.

Definition at line 18 of file head_light.

18  {
19  if(!on.value()) return;
20  state& state = a_action.state();
21  if((state.m_light+1)>=a_action.max_lights()) {
22  a_action.out()
23  << "GL_MAX_LIGHTS (" << a_action.max_lights() << ") reached."
24  << std::endl;
25  return;
26  }
27  float dx = direction.value()[0];
28  float dy = direction.value()[1];
29  float dz = direction.value()[2];
30  {mat4f mtx;
31  state.m_camera_orientation.value(mtx);
32  mtx.mul_dir_3f(dx,dy,dz);}
33  state.m_GL_LIGHTING = true; //for separator
34  a_action.enable_light(state.m_light,vec3f(dx,dy,dz),color.value());
35  state.m_light++;
36  }

The documentation for this class was generated from the following file:
tools::sg::torche::operator=
torche & operator=(const torche &a_from)
Definition: torche:73
tools::sg::torche::torche
torche()
Definition: torche:55
tools::vec3::value
void value(T &a0, T &a1, T &a2) const
Definition: vec3:102
tools::sg::torche::color
sf_vec< colorf, float > color
Definition: torche:21
tools::sg::torche::direction
sf_vec3f direction
Definition: torche:22
tools::sg::bsf::value
T & value()
Definition: bsf:98
tools::sg::torche::on
sf< bool > on
Definition: torche:23