QSDK 1.1 Documentation
Main Page | Modules | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members | Related Pages

Q::Light Struct Reference
[Shading & Lighting]

A light emitting geom. More...

#include <Q/q.h>

Inheritance diagram for Q::Light:

Q::Geom Q::Object Q::ObjectBase List of all members.

Public Member Functions

 Light ()
 Light (const char *name)
Maths::Vec3f color () const
float radius () const
float intensityR () const
float intensityO () const
float minAngle () const
float maxAngle () const
Utils::Result setColor (const Maths::Vec3f &)
Utils::Result setRadius (float)
Utils::Result setIntensityR (float)
Utils::Result setIntensityO (float)
Utils::Result setMinAngle (float)
Utils::Result setMaxAngle (float)

Static Public Member Functions

Light create (const char *name, const Database &db=Database())
Light find (const char *name)
ClassType classType ()
Light cast (const ObjectBase &)

Detailed Description

A light emitting geom.

The Light object represents a point or spot light source in the scene (directional lights are handled by the Environment object). The light's intensity is modified by a quadratic falloff equation which is calculated by specifying intensity values at the light's origin and at the radius.


Constructor & Destructor Documentation

Q::Light::Light  )  [inline]
 

Create a null light reference.

Q::Light::Light const char *  name  ) 
 

Search the currently attached databases for a light with the given name.


Member Function Documentation

Light Q::Light::cast const ObjectBase  )  [static]
 

If the object referenced by obj is a light, then return a suitable Light reference to the object.

Note:
Casting this object will cause it to be loaded from the database if it is not currently resident.

Reimplemented from Q::Geom.

ClassType Q::Light::classType  )  [static]
 

Return the type for this class.

Maths::Vec3f Q::Light::color  )  const
 

Return the color of the light.

Light Q::Light::create const char *  name,
const Database db = Database()
[static]
 

Create a new light named name in the given database, db, (or the most recently attached read-write database if db is null). The values of the new object's visible, intersectable, collidee, collider, boundsEvent and lightable flags are set to false.

Light Q::Light::find const char *  name  )  [static]
 

Search the currently attached databases for a light with the given name and return that object, if it exists.

float Q::Light::intensityO  )  const
 

Return the light's intensity at the origin. The default value for this parameter is 2.5f.

float Q::Light::intensityR  )  const
 

Return the light's intensity at the radius. The default value for this parameter is 0.5f.

float Q::Light::maxAngle  )  const
 

Return the outside angle of a spot light.

float Q::Light::minAngle  )  const
 

Return the inside angle of a spot light. This value defaults to 0.0f which is treated as a point light source.

float Q::Light::radius  )  const
 

Return the radius of the light.

Utils::Result Q::Light::setColor const Maths::Vec3f  ) 
 

Set the color of the light.

Utils::Result Q::Light::setIntensityO float   ) 
 

Set the intensity of the light at its origin.

Utils::Result Q::Light::setIntensityR float   ) 
 

Set the intensity of the light at its radius.

Utils::Result Q::Light::setMaxAngle float   ) 
 

Set the outer angle of a spot light.

Utils::Result Q::Light::setMinAngle float   ) 
 

Set the inner angle of a spot light.

Utils::Result Q::Light::setRadius float   ) 
 

Set the radius of the light. This changes the box representing the light. If the Light is being used by any Instance then Instance::resetBox must be called on every one of those instances, otherwise they will not reflect the change.

Return to QSDK documentation Contents page. Contact details for support, information and fault-reporting.
Qube Software Limited © 2000-2004