7 #ifndef _MGPOINTLIGHT_HH_
8 #define _MGPOINTLIGHT_HH_
10 #include "mgGL/Light.h"
33 float ambientIntensity,
37 const float attenuation[3]
59 for(
int i=0; i<3; i++) m_location[i]=location[i];
68 for(
int i=0; i<3; i++) location[i]=m_location[i];
80 for(
int i=0; i<3; i++) m_attenuation[i]=attenuation[i];
83 m_attenuation[0]=const_att;
84 m_attenuation[1]=linear_att;
85 m_attenuation[2]=quadratic_att;
88 for(
int i=0; i<3; i++) attenuation[i]=m_attenuation[i];
90 void getAttenuation(
float& const_att,
float& linear_att,
float& quadratic_att)
const{
91 const_att=m_attenuation[0];
92 linear_att=m_attenuation[1];
93 quadratic_att=m_attenuation[2];
98 virtual int exec()
const;
103 std::string
whoami()
const{
return "PointLight";};
111 virtual std::ostream&
out(std::ostream&)
const;
131 float m_attenuation[3];
138 #endif // _MGPOINTLIGHT_HH_
MGTransf represents a transformation of a space dimension.
Definition: Transf.h:35
MGPointLight is a point light source that radiates equally in all directions.
Definition: PointLight.h:24
void getLocation(float location[3]) const
Definition: PointLight.h:67
virtual std::ostream & out(std::ostream &) const
Output virtual function.
MGIfstream is a class to read the serialized data generated by MGOfstream.
Definition: Ifstream.h:30
void setRadius(float radius)
Definition: PointLight.h:76
void getAttenuation(float &const_att, float &linear_att, float &quadratic_att) const
Definition: PointLight.h:90
virtual void WriteMembers(MGOfstream &buf) const
Write all member data.
void setAttenuation(float const_att, float linear_att, float quadratic_att)
Definition: PointLight.h:82
Vector of a general n space dimension.
Definition: Vector.h:26
MGLight is an abstract base class for light sources.
Definition: Light.h:27
MGGel is an abstract class which represents a group element.
Definition: Gel.h:53
void setLocation(float x, float y, float z)
Definition: PointLight.h:61
virtual void transform(const MGVector &v)
Transform the gel by the argument.
Definition: Gel.h:176
virtual void ReadMembers(MGIfstream &buf)
Read all member data.
Represent a positional data.
Definition: Position.h:28
virtual bool operator<(const MGLight &gel2) const
comparison
void getAttenuation(float attenuation[3]) const
Definition: PointLight.h:87
MGOfstream is a class to serialize all of the subclasses of MGGel.
Definition: Ofstream.h:31
virtual MGLight * clone() const
Generate a newed clone object.
void getLocation(float &x, float &y, float &z) const
Definition: PointLight.h:70
void setLocation(const float location[3])
Definition: PointLight.h:58
virtual MGLight & operator=(const MGGel &gel2)
virtual ~MGLight();
long identify_type() const
Return This object's typeID.
Definition: PointLight.h:101
void setAttenuation(const float attenuation[3])
Definition: PointLight.h:79
std::string whoami() const
Definition: PointLight.h:103
float getRadius() const
Definition: PointLight.h:77
MGMatrix is a matix of m by m, where m is the space dimension.
Definition: Matrix.h:30