File: light.h

package info (click to toggle)
python-visual 3.2.9-4.1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 2,796 kB
  • ctags: 2,664
  • sloc: cpp: 11,958; sh: 8,185; python: 3,709; ansic: 480; makefile: 311
file content (44 lines) | stat: -rw-r--r-- 1,120 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef LIGHT_H
#define LIGHT_H

// Copyright (c) 2000, 2001, 2002, 2003 by David Scherer and others.
// See the file license.txt for complete license terms.
// See the file authors.txt for a complete list of contributors.

#include "vector.h"
#include "tmatrix.h"
#include <vector>
namespace boost { namespace python {
	class list;
}}

namespace visual {

struct lighting 
{
	double ambient;
	int n_lights;
	static const int max_lights = 8;        // treat as a member
	vector L[max_lights];

  /* All lights are monochrome, directional light sources for now.  The L
     vector points in the direction of the light, and has magnitude equal
     to the intensity of the light. 
     
     Ambient, n_lights, and L are exposed to clients for performance.  In
     an ideal universe, all clients would use the methods below.
   */

	lighting();
	lighting( const lighting& copy, const tmatrix& frame);
	lighting( const lighting& old, boost::python::list);
	boost::python::list as_list();

	double illuminate( const vector& normal);

	double illuminate( double nx, double ny, double nz);
};

} // !namespace visual

#endif