Package spyre :: Module spyre :: Class Light
[frames | no frames]

Type Light

object --+
         |
        Light

Known Subclasses:
Bulb, Sun

Implements each light. This class is concrete, so can be used to create light instances, but the subclasses may be more intuitive.

You can create any number of lights, but only 8 can be on at a time.
Method Summary
  on(self)
Turn light on
  off(self)
Turn light off
  display(self)
Push light params through to OpenGL
  setPosition(self, position)
Change position value.
  __init__(self, ambient, diffuse, specular, position)
Initialize new instance.
  __del__(self)
Turn light off on destruction.
  update(self)
updates light
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __repr__(x)
x.__repr__() <==> repr(x)
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)

Class Variable Summary
list available_lights: keeps track of which light ids are available for use.

Method Details

on(self)

Turn light on

off(self)

Turn light off

display(self)

Push light params through to OpenGL

setPosition(self, position)

Change position value.
Parameters:
position - 4 tuple with x,y,z,?

__init__(self, ambient=None, diffuse=None, specular=None, position=None)
(Constructor)

Initialize new instance.
Parameters:
ambient - 4 tuple rgba for 'ambient' light
diffuse - 4 tuple rgba for 'diffuse' light
specular - 4 tuple rgba for 'specular' (imaged) light
position - 4 tuple, x,y,z and opengl-peculiar 4th value
Overrides:
__builtin__.object.__init__

__del__(self)
(Destructor)

Turn light off on destruction.

update(self)

updates light

Class Variable Details

available_lights

keeps track of which light ids are available for use.
Type:
list
Value:
[16391, 16390, 16389, 16388, 16387, 16386, 16385, 16384]               

Generated by Epydoc 2.1 on Sat Jan 07 17:58:16 2006 http://epydoc.sf.net