Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3436 in orxonox.OLD for orxonox/trunk/src/light.h


Ignore:
Timestamp:
Mar 1, 2005, 6:16:49 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: added new Class light, that handles lights (needed for Bump-mapping).
Because Light is very important in 3D, I have created this Class

File:
1 copied

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/light.h

    r3435 r3436  
    11/*!
    2     \file proto_class.h
    3     \brief Definition of the proto class template, used quickly start work
    4     \todo Example: this shows how to use simply add a Marker that here has to be done something.
     2    \file light.h
     3    \brief Handles Lights.
    54
    6     The Protoclass exists, to help you quikly getting the run for how to develop in orxonox.
    7     It is an example for the CODING-CONVENTION, and a starting-point for every class.
     5    A Light is one of the more important things in a 3D-environment,
     6    without it one sees nothing :)
     7    It is here for diffuse-, specular- and Bump-Mappings.
    88*/
    99
    10 #ifndef _PROTO_CLASS_H
    11 #define _PROTO_CLASS_H
     10#ifndef _LIGHT_H
     11#define _LIGHT_H
    1212
    13 #include "stdincl.h"
     13#include "world_entity.h"
     14#include "glincl.h"
    1415
    15 /*class Test;*/ /* forward definition of class Test (without including it here!)*/
     16// FORWARD DEFINITIONS //
     17class Vector;
    1618
    17 //! A default class that aids you to start creating a new class
     19//! A class that handles Lights
    1820/**
    19    here can be some longer description of this class
     21   A Light is a source that emits light rays (photons)
    2022*/
    21 class ProtoClass : public BaseObject {
     23class Light : public WorldEntity
     24{
     25 
    2226
    2327 public:
    24   ProtoClass ();
    25   ~ProtoClass ();
     28  Light(void);
     29  Light(Vector position);
     30  ~Light(void);
    2631
    27   bool doNonSense (int nothing);
     32  // set Attributes
     33  void setPosition(Vector position);
     34  void setDiffuseColor(GLfloat r, GLfloat g, GLfloat b);
     35  void setSpecularColor(GLfloat r, GLfloat g, GLfloat b);
     36 
     37  // get Attributes
     38  Vector getPosition(void);
     39 private:
     40  GLfloat lightPosition[4];   //!< The Position of this Light
     41  GLfloat lmodelAmbient[4];   //!< The general Ambient Color
     42  GLfloat diffuseColor[4];    //!< The Diffuse Color this Light emmits
     43  GLfloat specularColor[4];   //!< The specular Color of this Light
    2844
    29  private:
    30   int nonSense;  //!< doxygen tag here like this for all the variables - delete this variable if you use this
    31 
     45  void init();
    3246};
    3347
    34 #endif /* _PROTO_CLASS_H */
     48#endif /* _LIGHT_H */
Note: See TracChangeset for help on using the changeset viewer.