Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3453 in orxonox.OLD for orxonox/trunk/src/light.cc


Ignore:
Timestamp:
Mar 3, 2005, 5:56:20 PM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: light: added ability to generate a spot light

File:
1 edited

Legend:

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

    r3446 r3453  
    303303  glLightfv (GL_LIGHT0, GL_AMBIENT, this->ambientColor);
    304304}
     305
     306/**
     307   \brief stets the direction of the Spot Light.
     308   \param direction The direction of the Spot Light.
     309*/
     310void Light::setSpotDirection(Vector direction)
     311{
     312  this->currentLight->spotDirection[0] = direction.x;
     313  this->currentLight->spotDirection[1] = direction.y;
     314  this->currentLight->spotDirection[2] = direction.z;
     315
     316  glLightfv(lightsV[this->currentLight->lightNumber], GL_SPOT_DIRECTION, this->currentLight->spotDirection);
     317}
     318
     319
     320/**
     321   \brief sets the cutoff angle of the Light.
     322   \param cutoff The cutoff angle.
     323*/
     324void Light::setSpotCutoff(GLfloat cutoff)
     325{
     326  this->currentLight->spotCutoff = cutoff;
     327  glLightf(lightsV[this->currentLight->lightNumber], GL_SPOT_CUTOFF, cutoff);
     328}
     329
    305330
    306331// get Attributes
Note: See TracChangeset for help on using the changeset viewer.