5 #ifndef BALL_VIEW_KERNEL_STAGE_H
6 #define BALL_VIEW_KERNEL_STAGE_H
8 #ifndef BALL_MATHS_VECTOR3_H
12 #ifndef BALL_MATHS_QUATERNION_H
16 #ifndef BALL_MATHS_MATRIX44_H
20 #ifndef BALL_MATHS_ANGLE_H
24 #ifndef BALL_VIEW_DATATYPE_COLORRGBA_H
28 #ifndef BALL_VIEW_KERNEL_REPRESENTATION_H
96 { position_ = position; }
100 {
return direction_;}
104 { direction_ = direction;}
108 {
return attenuation_;}
111 void setAttenuation(
const Vector3& attenuation)
112 { attenuation_ = attenuation;}
126 float getIntensity()
const
127 {
return intensity_;}
132 void setIntensity(
float intensity)
133 { intensity_ = intensity;}
160 void setRelativeToCamera(
bool state)
161 { relative_ = state;}
164 bool isRelativeToCamera()
const
179 bool operator == (
const LightSource& light_source)
const;
189 virtual void dump(std::ostream& s = std::cout,
Size depth = 0)
const;
249 Camera(
const Vector3& view_point,
const Vector3& look_at,
const Vector3& look_up_vector,
const ProjectionMode& mode = PERSPECTIVE);
263 void moveRight(
float translation)
264 { view_point_ += right_vector_*translation; look_at_ += right_vector_*translation; }
267 void moveUp(
float translation)
268 { view_point_ += look_up_vector_*translation; look_at_ += look_up_vector_*translation; }
271 void moveForward(
float translation)
273 Vector3 normal_view_vector(view_vector_);
275 view_point_ += normal_view_vector*translation;
276 look_at_ += normal_view_vector*translation;
281 {
return view_point_;}
285 { view_point_ = view_point; calculateVectors_();}
292 void setLookAtPosition(
const Vector3& look_at)
293 { look_at_ = look_at; calculateVectors_();}
297 {
return look_up_vector_;}
300 void setLookUpVector(
const Vector3& look_up_vector)
301 { look_up_vector_ = look_up_vector; calculateVectors_();}
304 float getDistance()
const
305 {
return view_point_.getDistance(look_at_);}
309 {
return view_vector_;}
313 {
return right_vector_;}
317 { view_point_ += v; look_at_ += v; calculateVectors_();}
331 { projection_mode_ = mode; }
335 {
return projection_mode_; }
341 bool readFromString(
const String& data);
349 bool operator == (
const Camera& camera)
const;
352 bool operator < (
const Camera& camera)
const;
362 virtual void dump(std::ostream& s = std::cout,
Size depth = 0)
const;
367 void calculateVectors_();
435 virtual void clear();
443 virtual const std::list<LightSource>& getLightSources()
const
444 {
return light_sources_;}
447 virtual void addLightSource(
const LightSource& light_source);
450 virtual void removeLightSource(
const LightSource& light_source) ;
453 void clearLightSources();
465 virtual void setCamera(
const Camera& camera)
470 {
return background_color_;}
474 { background_color_ = color;}
478 {
return info_color_;}
482 { info_color_ = color;}
485 void showCoordinateSystem(
bool state)
486 { show_coordinate_system_ = state;}
489 bool coordinateSystemEnabled()
const
490 {
return show_coordinate_system_;}
493 void setEyeDistance(
float value)
494 { eye_distance_ = value;}
497 float getEyeDistance()
const
498 {
return eye_distance_;}
501 void setFocalDistance(
float value)
502 { focal_distance_ = value;}
505 float getFocalDistance()
const
506 {
return focal_distance_;}
509 void setSwapSideBySideStereo(
bool state)
510 { swap_side_by_side_stereo_ = state;}
513 bool swapSideBySideStereo()
const
514 {
return swap_side_by_side_stereo_;}
517 float getFogIntensity()
const
518 {
return fog_intensity_;}
521 void setFogIntensity(
float value)
522 { fog_intensity_ = value;}
525 float getSpecularIntensity()
const
529 void setSpecularIntensity(
float value)
530 { specular_ = value;}
533 float getDiffuseIntensity()
const
537 void setDiffuseIntensity(
float value)
541 float getAmbientIntensity()
const
545 void setAmbientIntensity(
float value)
549 float getShininess()
const
550 {
return shininess_;}
553 void setShininess(
float value)
554 { shininess_ = value;}
562 bool operator == (
const Stage& stage)
const;
586 virtual void dump(std::ostream& s = std::cout,
Size depth = 0)
const;
635 #endif // BALL_VIEW_KERNEL_STAGE_H