g4tools  5.4.0
Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
tools::sg::base_camera Class Referenceabstract
Inheritance diagram for tools::sg::base_camera:
Inheritance graph
[legend]
Collaboration diagram for tools::sg::base_camera:
Collaboration graph
[legend]

Public Member Functions

virtual const desc_fieldsnode_desc_fields () const
 
virtual float near_height () const =0
 
virtual void zoom (float)=0
 
virtual camera_type type () const =0
 
virtual void get_lrbt (unsigned int, unsigned int, float &, float &, float &, float &)=0
 
virtual void render (render_action &a_action)
 
virtual void pick (pick_action &a_action)
 
virtual void event (event_action &a_action)
 
virtual void get_matrix (get_matrix_action &a_action)
 
virtual void is_visible (visible_action &a_action)
 
virtual ~base_camera ()
 
void direction (vec3f &a_dir) const
 
void rotate_around_direction (float a_delta)
 
void rotate_around_z (float a_delta)
 
void rotate_around_up (float a_delta)
 
void rotate_around_x (float a_delta)
 
void rotate_around_x_at_focal (float a_delta)
 
void rotate_around_y_at_focal (float a_delta)
 
void rotate_around_z_at_focal (float a_delta)
 
void rotate_to_dir (const vec3f &a_dir)
 
void pane_to (float a_x, float a_y, float a_z)
 
void translate_along_side (float a_delta)
 
void translate_along_up (float a_delta)
 
void translate_along_dir (float a_delta)
 
bool look_at (const vec3f &a_dir, const vec3f &a_up)
 
void dump (std::ostream &a_out)
 
bool is_type_ortho () const
 
bool height_at_focal (float &a_h) const
 
void astro_orientation (float a_ra, float a_dec)
 
bool update_motion (int a_move)
 
- 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 bbox (bbox_action &)
 
virtual void search (search_action &a_action)
 
virtual bool write (write_action &a_action)
 
virtual bool read (read_action &a_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
 

Public Attributes

sf< float > znear
 
sf< float > zfar
 
sf_vec3f position
 
sf_rotf orientation
 
sf< float > dx
 
sf< float > da
 
sf< float > ds
 
sf< float > focal
 

Protected Member Functions

 base_camera ()
 
 base_camera (const base_camera &a_from)
 
base_cameraoperator= (const base_camera &a_from)
 
bool operator== (const base_camera &a_from) const
 
void update_sg (std::ostream &a_out)
 
void _mult_matrix (matrix_action &a_action)
 
void set_state (matrix_action &a_action)
 
- 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
 

Static Protected Member Functions

static const vec4< float > & id_orientation ()
 

Protected Attributes

sf_vec4f m_lrbt
 
mat4f m_proj
 
float m_tmp [16]
 

Detailed Description

Definition at line 24 of file base_camera.

Constructor & Destructor Documentation

◆ base_camera() [1/2]

tools::sg::base_camera::base_camera ( )
inlineprotected

Definition at line 100 of file base_camera.

101  :parent()
102  ,znear(1)
103  ,zfar(10)
104  ,position(vec3f(0,0,1))
105  ,orientation(rotf(vec3f(0,0,1),0)) //quat = vec4f(0,0,0,1)
106  ,dx(0.01f)
107  ,da(0.017f) //one degree.
108  ,ds(0.99f)
109  ,focal(1)
110  {
111 #ifdef TOOLS_MEM
112  mem::increment(s_class().c_str());
113 #endif
114  add_fields();
115  }

◆ ~base_camera()

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

Definition at line 117 of file base_camera.

117  {
118 #ifdef TOOLS_MEM
119  mem::decrement(s_class().c_str());
120 #endif
121  }

◆ base_camera() [2/2]

tools::sg::base_camera::base_camera ( const base_camera a_from)
inlineprotected

Definition at line 123 of file base_camera.

124  :parent(a_from)
125  ,znear(a_from.znear)
126  ,zfar(a_from.zfar)
127  ,position(a_from.position)
128  ,orientation(a_from.orientation)
129  ,dx(a_from.dx)
130  ,da(a_from.da)
131  ,ds(a_from.ds)
132  ,focal(a_from.focal)
133  {
134 #ifdef TOOLS_MEM
135  mem::increment(s_class().c_str());
136 #endif
137  add_fields();
138  }

Member Function Documentation

◆ _mult_matrix()

void tools::sg::base_camera::_mult_matrix ( matrix_action a_action)
inlineprotected

Definition at line 507 of file base_camera.

507  {
508  float l,r,b,t;
509  get_lrbt(a_action.ww(),a_action.wh(),l,r,b,t);
510  m_lrbt.set_value(l,r,b,t);
511 
512  if(touched()||m_lrbt.touched()) {
513  update_sg(a_action.out());
514  reset_touched();
516  }
517 
518  a_action.projection_matrix().mul_mtx(m_proj,m_tmp);
519  }

◆ astro_orientation()

void tools::sg::base_camera::astro_orientation ( float  a_ra,
float  a_dec 
)
inline

Definition at line 351 of file base_camera.

351  {
352  // a_ra, a_dec are in decimal degrees.
353 
354  // Camera default point toward -z with up along +y and +x at right.
355 
356  // Arrange so that camera points toward x with up along +z :
357  rotf r(vec3f::s_y(),-fhalf_pi());
358  r *= rotf(vec3f::s_x(),fhalf_pi());
359  // Now -y is at right.
360 
361  // Then rotate it so that it points toward given (ra,dec) by keeping up upward +z direction.
362  r *= rotf(vec3f::s_y(),-a_dec*fdeg2rad());
363  r *= rotf(vec3f::s_z(),a_ra*fdeg2rad());
364  orientation = r;
365 
366 /*
367  position = a_center*0.99f;
368  znear = 0.1f;
369  zfar = 200.0f;
370  focal = (a_center-position).length();
371 */
372 /*
373  position = vec3f(0,0,0);
374  znear = 1.0f;
375  zfar = 2000.0f; //2*sky_radius.
376  focal = a_center.length();
377  da = 0.017f/100; //1/100 of a degree
378 */
379  }

◆ direction()

void tools::sg::base_camera::direction ( vec3f a_dir) const
inline

Definition at line 165 of file base_camera.

165  {
166  orientation.value().mul_vec(vec3f(0,0,-1),a_dir);
167  }

◆ dump()

void tools::sg::base_camera::dump ( std::ostream &  a_out)
inline

Definition at line 331 of file base_camera.

331  {
332  a_out << " znear " << znear.value() << std::endl;
333  a_out << " zfar " << zfar.value() << std::endl;
334  vec3f& pos = position.value();
335  a_out << " pos " << pos[0] << " " << pos[1] << " " << pos[2] << std::endl;
336  //FIXME : dump orientation.
337  }

◆ event()

virtual void tools::sg::base_camera::event ( event_action a_action)
inlinevirtual

Reimplemented from tools::sg::node.

Definition at line 87 of file base_camera.

87  {
88  _mult_matrix(a_action);
89  set_state(a_action);
90  }

◆ get_lrbt()

virtual void tools::sg::base_camera::get_lrbt ( unsigned int  ,
unsigned int  ,
float &  ,
float &  ,
float &  ,
float &   
)
pure virtual

◆ get_matrix()

virtual void tools::sg::base_camera::get_matrix ( get_matrix_action a_action)
inlinevirtual

Reimplemented from tools::sg::node.

Definition at line 91 of file base_camera.

91  {
92  _mult_matrix(a_action);
93  set_state(a_action);
94  }

◆ height_at_focal()

bool tools::sg::base_camera::height_at_focal ( float &  a_h) const
inline

Definition at line 341 of file base_camera.

341  {
342  if(is_type_ortho()) {
343  a_h = near_height();
344  } else {
345  if(!znear.value()) {a_h = near_height();return false;}
346  a_h = focal.value()*near_height()/znear.value();
347  }
348  return true;
349  }

◆ id_orientation()

static const vec4<float>& tools::sg::base_camera::id_orientation ( )
inlinestaticprotected

Definition at line 536 of file base_camera.

536 {static const vec4<float> s_v(0,0,0,1);return s_v;}

◆ is_type_ortho()

bool tools::sg::base_camera::is_type_ortho ( ) const
inline

Definition at line 339 of file base_camera.

339 {return type()==camera_ortho?true:false;}

◆ is_visible()

virtual void tools::sg::base_camera::is_visible ( visible_action a_action)
inlinevirtual

Reimplemented from tools::sg::node.

Definition at line 95 of file base_camera.

95  {
96  _mult_matrix(a_action);
97  set_state(a_action);
98  }

◆ look_at()

bool tools::sg::base_camera::look_at ( const vec3f a_dir,
const vec3f a_up 
)
inline

Definition at line 298 of file base_camera.

298  {
299  vec3f z = -a_dir;
300  vec3f y = a_up;
301  vec3f x;y.cross(z,x);
302 
303  // recompute y to create a valid coordinate system
304  z.cross(x,y);
305 
306  // normalize x and y to create an orthonormal coord system
307  if(!x.normalize()) return false;
308  if(!y.normalize()) return false;
309  if(!z.normalize()) return false;
310 
311  // create a rotation matrix
312  mat4f rot;
313  rot.set_identity();
314  rot.set_value(0,0,x[0]);
315  rot.set_value(1,0,x[1]);
316  rot.set_value(2,0,x[2]);
317 
318  rot.set_value(0,1,y[0]);
319  rot.set_value(1,1,y[1]);
320  rot.set_value(2,1,y[2]);
321 
322  rot.set_value(0,2,z[0]);
323  rot.set_value(1,2,z[1]);
324  rot.set_value(2,2,z[2]);
325 
326  orientation.value().set_value(rot);
327  return true;
328  }

◆ near_height()

virtual float tools::sg::base_camera::near_height ( ) const
pure virtual

◆ node_desc_fields()

virtual const desc_fields& tools::sg::base_camera::node_desc_fields ( ) const
inlinevirtual

Reimplemented from tools::sg::node.

Reimplemented in tools::sg::perspective, and tools::sg::ortho.

Definition at line 41 of file base_camera.

41  {
43  static const desc_fields s_v(parent::node_desc_fields(),8, //WARNING : take care of count.
52  );
53  return s_v;
54  }

◆ operator=()

base_camera& tools::sg::base_camera::operator= ( const base_camera a_from)
inlineprotected

Definition at line 139 of file base_camera.

139  {
140  parent::operator=(a_from);
141  znear = a_from.znear;
142  zfar = a_from.zfar;
143  position = a_from.position;
144  orientation = a_from.orientation;
145  dx = a_from.dx;
146  da = a_from.da;
147  ds = a_from.ds;
148  focal = a_from.focal;
149  m_lrbt.set_value(0,0,0,0);
150  return *this;
151  }

◆ operator==()

bool tools::sg::base_camera::operator== ( const base_camera a_from) const
inlineprotected

Definition at line 153 of file base_camera.

153  {
154  if(znear!=a_from.znear) return false;
155  if(zfar!=a_from.zfar) return false;
156  if(position!=a_from.position) return false;
157  if(orientation!=a_from.orientation) return false;
158  //we do not test dx,da,ds.
159  return true;
160  }

◆ pane_to()

void tools::sg::base_camera::pane_to ( float  a_x,
float  a_y,
float  a_z 
)
inline

Definition at line 258 of file base_camera.

258  {
259  //translate in view plane so that (a_x,a_y,a_z) is on direction.
260 
261  vec3f dir;
262  orientation.value().mul_vec(vec3f(0,0,-1),dir);
263  vec3f up;
264  orientation.value().mul_vec(vec3f(0,1,0),up);
265  vec3f side;dir.cross(up,side);
266 
267  vec3f d(a_x,a_y,a_z);
268  d.subtract(position.value());
269 
270  vec3f pos = position.value() + side * (side.dot(d)) + up * (up.dot(d));
271  position.value(pos);
272  }

◆ pick()

virtual void tools::sg::base_camera::pick ( pick_action a_action)
inlinevirtual

Reimplemented from tools::sg::node.

Definition at line 83 of file base_camera.

83  {
84  _mult_matrix(a_action);
85  set_state(a_action);
86  }

◆ render()

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

Reimplemented from tools::sg::node.

Definition at line 74 of file base_camera.

74  {
75  _mult_matrix(a_action);
76  set_state(a_action);
77  //{mat4f& _mtx = a_action.projection_matrix();
78  // a_action.out() << "debug : tools::sg::base_camera::render : proj :" << std::endl;
79  // a_action.out() << _mtx << std::endl;}
80  a_action.load_proj_matrix(a_action.projection_matrix());
81  a_action.load_model_matrix(a_action.model_matrix());
82  }

◆ rotate_around_direction()

void tools::sg::base_camera::rotate_around_direction ( float  a_delta)
inline

Definition at line 169 of file base_camera.

169  {
170  //vec3f dir;
171  //orientation.value().mul_vec(vec3f(0,0,-1),dir);
172  //orientation.value(rotf(dir,a_delta) * orientation.value());
173  orientation.value(rotf(vec3f(0,0,-1),a_delta) * orientation.value());
174  }

◆ rotate_around_up()

void tools::sg::base_camera::rotate_around_up ( float  a_delta)
inline

Definition at line 183 of file base_camera.

183  {
184  vec3f up;
185  orientation.value().mul_vec(vec3f(0,1,0),up);
186  //orientation.value(rotf(up,a_delta) * orientation.value());
187  // must be the below so that rot-cam works for exlib/cbk/[astro,cfitsio] astro setup.
188  // (astro setup change camera orientation).
189  orientation.value(orientation.value() * rotf(up,a_delta));
190  }

◆ rotate_around_x()

void tools::sg::base_camera::rotate_around_x ( float  a_delta)
inline

Definition at line 192 of file base_camera.

192  {
193  orientation.value(rotf(vec3f(1,0,0),a_delta) * orientation.value());
194  }

◆ rotate_around_x_at_focal()

void tools::sg::base_camera::rotate_around_x_at_focal ( float  a_delta)
inline

Definition at line 196 of file base_camera.

196  {
197  //from coin SoGuiExaminerViewerP::rotXWheelMotion.
198  vec3f dir;
199  orientation.value().mul_vec(vec3f(0,0,-1),dir);
200  vec3f focalpoint = position.value() + focal * dir;
201  orientation.value(rotf(vec3f(1,0,0),a_delta) * orientation.value());
202  orientation.value().mul_vec(vec3f(0,0,-1),dir);
203  position = focalpoint - focal * dir;
204  }

◆ rotate_around_y_at_focal()

void tools::sg::base_camera::rotate_around_y_at_focal ( float  a_delta)
inline

Definition at line 206 of file base_camera.

206  {
207  //from coin SoGuiExaminerViewerP::rotYWheelMotion.
208  vec3f dir;
209  orientation.value().mul_vec(vec3f(0,0,-1),dir);
210  vec3f focalpoint = position.value() + focal * dir;
211  orientation.value(rotf(vec3f(0,1,0),a_delta) * orientation.value());
212  orientation.value().mul_vec(vec3f(0,0,-1),dir);
213  position = focalpoint - focal * dir;
214  }

◆ rotate_around_z()

void tools::sg::base_camera::rotate_around_z ( float  a_delta)
inline

Definition at line 176 of file base_camera.

176  {
177  //vec3f z;
178  //orientation.value().mul_vec(vec3f(0,0,1),z);
179  //orientation.value(rotf(z,a_delta) * orientation.value());
180  orientation.value(rotf(vec3f(0,0,1),a_delta) * orientation.value());
181  }

◆ rotate_around_z_at_focal()

void tools::sg::base_camera::rotate_around_z_at_focal ( float  a_delta)
inline

Definition at line 216 of file base_camera.

216  {
217  //from coin SoGuiExaminerViewerP::rotYWheelMotion.
218  vec3f dir;
219  orientation.value().mul_vec(vec3f(0,0,-1),dir);
220  vec3f focalpoint = position.value() + focal * dir;
221  orientation.value(rotf(vec3f(0,0,1),a_delta) * orientation.value());
222  orientation.value().mul_vec(vec3f(0,0,-1),dir);
223  position = focalpoint - focal * dir;
224  }

◆ rotate_to_dir()

void tools::sg::base_camera::rotate_to_dir ( const vec3f a_dir)
inline

Definition at line 226 of file base_camera.

226  {
227  //rotate around up so that a_dir is in (dir,up) plane
228 
229  //NOTE : it is the invert of orientation which is used
230  // in projection matrix.
231 
232  {vec3f dir;
233  orientation.value().mul_vec(vec3f(0,0,-1),dir);
234  vec3f up;
235  orientation.value().mul_vec(vec3f(0,1,0),up);
236  vec3f side;dir.cross(up,side);
237  vec3f v = side * (side.dot(a_dir)) + dir * (dir.dot(a_dir));
238  if(v.normalize()) orientation.value(orientation.value()*rotf(dir,v));}
239 
240  //rotate around dir^up so that a_dir matches dir.
241  {vec3f dir;
242  orientation.value().mul_vec(vec3f(0,0,-1),dir);
243  orientation.value(orientation.value()*rotf(dir,a_dir));}
244 
245 /*
246  //check that dir is on a_dir :
247  {vec3f dir;
248  orientation.value().mul_vec(vec3f(0,0,-1),dir);
249  float cos_angle; //it should be 1
250  if(!dir.cos_angle(a_dir,cos_angle)) {
251  ::printf("debug : can't get angle\n");
252  return;
253  }
254  ::printf("debug : cos_angle %g\n",cos_angle);}
255 */
256  }

◆ set_state()

void tools::sg::base_camera::set_state ( matrix_action a_action)
inlineprotected

Definition at line 521 of file base_camera.

521  {
522  state& _state = a_action.state();
523  _state.m_camera_ortho = is_type_ortho();
524  _state.m_camera_znear = znear;
525  _state.m_camera_zfar = zfar;
526  _state.m_camera_position = position.value();
527  _state.m_camera_orientation = orientation.value();
528  //_state.m_camera_near_height = near_height();
529  _state.m_camera_lrbt = m_lrbt.value();
530  _state.m_proj = a_action.projection_matrix();
531  }

◆ translate_along_dir()

void tools::sg::base_camera::translate_along_dir ( float  a_delta)
inline

Definition at line 291 of file base_camera.

291  {
292  vec3f dir;
293  orientation.value().mul_vec(vec3f(0,0,-1),dir);
294  vec3f pos = position.value() + dir * a_delta;
295  position.value(pos);
296  }

◆ translate_along_side()

void tools::sg::base_camera::translate_along_side ( float  a_delta)
inline

Definition at line 274 of file base_camera.

274  {
275  vec3f dir;
276  orientation.value().mul_vec(vec3f(0,0,-1),dir);
277  vec3f up;
278  orientation.value().mul_vec(vec3f(0,1,0),up);
279  vec3f side;dir.cross(up,side);
280  vec3f pos = position.value() + side * a_delta;
281  position.value(pos);
282  }

◆ translate_along_up()

void tools::sg::base_camera::translate_along_up ( float  a_delta)
inline

Definition at line 283 of file base_camera.

283  {
284  vec3f dir;
285  orientation.value().mul_vec(vec3f(0,0,-1),dir);
286  vec3f up;
287  orientation.value().mul_vec(vec3f(0,1,0),up);
288  vec3f pos = position.value() + up * a_delta;
289  position.value(pos);
290  }

◆ type()

virtual camera_type tools::sg::base_camera::type ( ) const
pure virtual

◆ update_motion()

bool tools::sg::base_camera::update_motion ( int  a_move)
inline

Definition at line 381 of file base_camera.

381  {
382  float _dx = dx;
383  float _da = da;
384  float _ds = ds;
385 
386  if(a_move==move_rotate_right) { //should match camera_yaw().
387  rotate_around_up(_da);
388  return true;
389  }
390  if(a_move==move_rotate_left) {
391  rotate_around_up(-_da);
392  return true;
393  }
394 
395  if(a_move==move_rotate_up) { //should match camera_pitch().
396  rotate_around_x(_da);
397  return true;
398  }
399  if(a_move==move_rotate_down) {
400  rotate_around_x(-_da);
401  return true;
402  }
403 
404  if(a_move==move_roll_plus) { //should match camera_roll().
405  rotate_around_direction(-_da); //direction = -z, then the minus.
406  return true;
407  }
408  if(a_move==move_roll_minus) {
410  return true;
411  }
412 
413  if(a_move==move_translate_right) {
415  return true;
416  }
417  if(a_move==move_translate_left) {
418  translate_along_side(-_dx);
419  return true;
420  }
421 
422  if(a_move==move_up) {
423  translate_along_up(_dx);
424  return true;
425  }
426  if(a_move==move_down) {
427  translate_along_up(-_dx);
428  return true;
429  }
430  if(a_move==move_forward) {
431  translate_along_dir(_dx);
432  return true;
433  }
434  if(a_move==move_backward) {
435  translate_along_dir(-_dx);
436  return true;
437  }
438  if(a_move==move_zoom_in) {
439  zoom(_ds);
440  return true;
441  }
442  if(a_move==move_zoom_out) {
443  zoom(1.0f/_ds);
444  return true;
445  }
446 
447  if(a_move==move_rotate_around_focal_right) { //yaw around focal.
449  return true;
450  }
451  if(a_move==move_rotate_around_focal_left) {
453  return true;
454  }
455  if(a_move==move_rotate_around_focal_up) { //pitch around focal.
457  return true;
458  }
459  if(a_move==move_rotate_around_focal_down) {
461  return true;
462  }
463  if(a_move==move_roll_around_focal_plus) {
465  return true;
466  }
467  if(a_move==move_roll_around_focal_minus) {
469  return true;
470  }
471 
472  return false;
473  }

◆ update_sg()

void tools::sg::base_camera::update_sg ( std::ostream &  a_out)
inlineprotected

Definition at line 475 of file base_camera.

475  {
476 
477  {const vec4f& v = m_lrbt.value();
478  float l = v[0];
479  float r = v[1];
480  float b = v[2];
481  float t = v[3];
482  float n = znear.value();
483  float f = zfar.value();
484  if(is_type_ortho()) {
485  m_proj.set_ortho(l,r,b,t,n,f);
486  } else {
487  m_proj.set_frustum(l,r,b,t,n,f);
488  }}
489 
490  if(orientation.value().quat()!=id_orientation()) //OPTIMIZATION
491  {rotf rinv;
492  if(orientation.value().inverse(rinv)) {
493  mat4f mtx;
494  rinv.value(mtx);
495  m_proj.mul_mtx(mtx,m_tmp);
496  } else {
497  a_out << "update_sg :"
498  << " get orientation inverse failed."
499  << std::endl;
500  }}
501 
503  -position.value()[1],
504  -position.value()[2]);
505  }

◆ zoom()

virtual void tools::sg::base_camera::zoom ( float  )
pure virtual

Member Data Documentation

◆ da

sf<float> tools::sg::base_camera::da

Definition at line 37 of file base_camera.

◆ ds

sf<float> tools::sg::base_camera::ds

Definition at line 38 of file base_camera.

◆ dx

sf<float> tools::sg::base_camera::dx

Definition at line 36 of file base_camera.

◆ focal

sf<float> tools::sg::base_camera::focal

Definition at line 39 of file base_camera.

◆ m_lrbt

sf_vec4f tools::sg::base_camera::m_lrbt
protected

Definition at line 541 of file base_camera.

◆ m_proj

mat4f tools::sg::base_camera::m_proj
protected

Definition at line 542 of file base_camera.

◆ m_tmp

float tools::sg::base_camera::m_tmp[16]
protected

Definition at line 543 of file base_camera.

◆ orientation

sf_rotf tools::sg::base_camera::orientation

Definition at line 33 of file base_camera.

◆ position

sf_vec3f tools::sg::base_camera::position

Definition at line 29 of file base_camera.

◆ zfar

sf<float> tools::sg::base_camera::zfar

Definition at line 28 of file base_camera.

◆ znear

sf<float> tools::sg::base_camera::znear

Definition at line 27 of file base_camera.


The documentation for this class was generated from the following file:
tools::sg::base_camera::rotate_around_z_at_focal
void rotate_around_z_at_focal(float a_delta)
Definition: base_camera:216
tools::sg::move_rotate_around_focal_down
@ move_rotate_around_focal_down
Definition: enums:129
tools::fdeg2rad
float fdeg2rad()
Definition: mathf:18
tools::sg::base_camera::rotate_around_up
void rotate_around_up(float a_delta)
Definition: base_camera:183
tools::sg::base_camera::id_orientation
static const vec4< float > & id_orientation()
Definition: base_camera:536
tools::sg::base_camera::orientation
sf_rotf orientation
Definition: base_camera:33
tools::sg::move_roll_minus
@ move_roll_minus
Definition: enums:116
tools::sg::move_roll_around_focal_minus
@ move_roll_around_focal_minus
Definition: enums:131
tools::sg::base_camera::position
sf_vec3f position
Definition: base_camera:29
tools::sg::base_camera::_mult_matrix
void _mult_matrix(matrix_action &a_action)
Definition: base_camera:507
tools::vec3< float >::s_z
static const vec3< float > & s_z()
Definition: vec3:307
tools::qrot::mul_vec
void mul_vec(const VEC3 &a_in, VEC3 &a_out) const
Definition: qrot:297
tools::sg::move_rotate_around_focal_left
@ move_rotate_around_focal_left
Definition: enums:127
tools::sg::field::reset_touched
void reset_touched()
Definition: field:61
tools::sg::base_camera::rotate_around_direction
void rotate_around_direction(float a_delta)
Definition: base_camera:169
tools::mat4::set_frustum
void set_frustum(const T &a_l, const T &a_r, const T &a_b, const T &a_t, const T &a_n, const T &a_f)
Definition: mat4:97
tools::sg::base_camera::type
virtual camera_type type() const =0
tools::mat4::mul_translate
void mul_translate(const T &a_x, const T &a_y, const T &a_z)
Definition: mat4:272
tools::sg::base_camera::m_lrbt
sf_vec4f m_lrbt
Definition: base_camera:541
tools::sg::base_camera::rotate_around_x_at_focal
void rotate_around_x_at_focal(float a_delta)
Definition: base_camera:196
tools::sg::base_camera::near_height
virtual float near_height() const =0
tools::sg::base_camera::translate_along_up
void translate_along_up(float a_delta)
Definition: base_camera:283
tools::qrot::quat
const VEC4 & quat() const
Definition: qrot:366
tools::sg::base_camera::ds
sf< float > ds
Definition: base_camera:38
tools::sg::move_roll_plus
@ move_roll_plus
Definition: enums:115
tools::sg::move_backward
@ move_backward
Definition: enums:123
tools::sg::base_camera::rotate_around_y_at_focal
void rotate_around_y_at_focal(float a_delta)
Definition: base_camera:206
tools::sg::field::touched
bool touched() const
Definition: field:60
tools::sg::base_camera::zfar
sf< float > zfar
Definition: base_camera:28
tools::sg::move_translate_right
@ move_translate_right
Definition: enums:118
tools::vec3< float >::s_y
static const vec3< float > & s_y()
Definition: vec3:306
tools::sg::base_camera::m_tmp
float m_tmp[16]
Definition: base_camera:543
tools::sg::base_camera::get_lrbt
virtual void get_lrbt(unsigned int, unsigned int, float &, float &, float &, float &)=0
tools::sg::move_rotate_down
@ move_rotate_down
Definition: enums:114
tools::sg::base_camera::dx
sf< float > dx
Definition: base_camera:36
tools::sg::move_roll_around_focal_plus
@ move_roll_around_focal_plus
Definition: enums:130
tools::sg::base_camera::m_proj
mat4f m_proj
Definition: base_camera:542
tools::sg::base_camera::zoom
virtual void zoom(float)=0
tools::mat4::set_ortho
void set_ortho(const T &a_l, const T &a_r, const T &a_b, const T &a_t, const T &a_n, const T &a_f)
Definition: mat4:64
tools::sg::base_camera::is_type_ortho
bool is_type_ortho() const
Definition: base_camera:339
tools::sg::base_camera::da
sf< float > da
Definition: base_camera:37
tools::sg::move_translate_left
@ move_translate_left
Definition: enums:119
tools::sg::base_camera::translate_along_side
void translate_along_side(float a_delta)
Definition: base_camera:274
tools::sg::base_camera::rotate_around_x
void rotate_around_x(float a_delta)
Definition: base_camera:192
tools::sg::camera_ortho
@ camera_ortho
Definition: enums:168
tools::sg::base_camera::focal
sf< float > focal
Definition: base_camera:39
tools::rotf::set_value
bool set_value(const vec3f &a_from, const vec3f &a_to)
Definition: rotf:42
tools::sg::move_forward
@ move_forward
Definition: enums:122
tools::sg::move_up
@ move_up
Definition: enums:120
tools::fhalf_pi
float fhalf_pi()
Definition: mathf:13
tools::sg::move_zoom_out
@ move_zoom_out
Definition: enums:125
tools::vec3< float >::s_x
static const vec3< float > & s_x()
Definition: vec3:305
TOOLS_FIELD_DESC_NODE_CLASS
#define TOOLS_FIELD_DESC_NODE_CLASS(a__class)
Definition: field:68
tools::sg::move_rotate_around_focal_right
@ move_rotate_around_focal_right
Definition: enums:126
tools::sg::sf_vec4f::set_value
void set_value(float a_0, float a_1, float a_2, float a_3)
Definition: sf_vec4f:31
tools::sg::move_rotate_left
@ move_rotate_left
Definition: enums:112
tools::sg::move_rotate_right
@ move_rotate_right
Definition: enums:111
tools::sg::bsf::value
T & value()
Definition: bsf:98
tools::sg::base_camera
Definition: base_camera:24
tools::sg::base_camera::set_state
void set_state(matrix_action &a_action)
Definition: base_camera:521
tools::sg::base_camera::update_sg
void update_sg(std::ostream &a_out)
Definition: base_camera:475
tools::sg::move_rotate_around_focal_up
@ move_rotate_around_focal_up
Definition: enums:128
tools::sg::base_camera::translate_along_dir
void translate_along_dir(float a_delta)
Definition: base_camera:291
tools::qrot::inverse
bool inverse(qrot &a_r) const
Definition: qrot:92
tools::sg::base_camera::znear
sf< float > znear
Definition: base_camera:27
tools::sg::move_rotate_up
@ move_rotate_up
Definition: enums:113
tools::sg::node::touched
virtual bool touched()
Definition: node:96
tools::sg::move_down
@ move_down
Definition: enums:121
tools::sg::move_zoom_in
@ move_zoom_in
Definition: enums:124
TOOLS_ARG_FIELD_DESC
#define TOOLS_ARG_FIELD_DESC(a__field)
Definition: field:71
tools::sg::node::reset_touched
virtual void reset_touched()
Definition: node:102