AlVolumeLight
Encapsulates the functionality common to all volume lights.
Synopsis
#include <AlVolumeLight.h>
class AlVolumeLight: public AlLight
virtual ~AlVolumeLight();
virtual AlObject* copyWrapper() const;
virtual AlObjectType type() const;
AlVolumeLight* asVolumeLightPtr();
boolean shadows() const;
boolean specular() const;
boolean turbulenceAnimated() const;
boolean turbulenceDirectional() const;
int turbulenceSpaceRes() const;
int turbulenceTimeRes() const;
double intensity() const;
double decay() const;
double decayStart() const;
double directionality() const;
double concentric() const;
double directional() const;
double radial() const;
double dropoff() const;
double dropoffStart() const;
double turbulenceIntensity() const;
double turbulenceSpread() const;
double turbulencePersistance() const;
double turbulenceGranularity() const;
double turbulenceRoughness() const;
double turbulenceVariability() const;
statusCode setShadows(boolean);
statusCode setSpecular(boolean);
statusCode setTurbulenceAnimated(boolean);
statusCode setTurbulenceDirectional(boolean);
statusCode setTurbulenceSpaceRes(int);
statusCode setTurbulenceTimeRes(int);
statusCode setIntensity( double );
statusCode setDecay(double);
statusCode setDecayStart(double);
statusCode setDirectionality(double);
statusCode setConcentric(double);
statusCode setDirectional(double);
statusCode setRadial(double);
statusCode setDropoff(double);
statusCode setDropoffStart(double);
statusCode setTurbulenceIntensity(double);
statusCode setTurbulenceSpread(double);
statusCode setTurbulencePersistance(double);
statusCode setTurbulenceGranularity(double);
statusCode setTurbulenceRoughness(double);
statusCode setTurbulenceVariability(double);
Description
There are two ways that this class is used. If the user instantiates and calls the create method on an AlVolumeLight, the resulting object is a box volume light. This light has all the special effects parameters in a cubic volume.
Alternatively, the user could instantiate and create an AlSphereLight, AlCylinderLight, AlTorusLight, AlConeLight or AlBoxLight (which are all considered "volume" and which are all derived from this light class).
Note that volume lights differ in thir shape, the way that their direction components are interpreted with respect to that shape, and the way that dropoff and decay are applied.
Summary
AlVolumeLight::~AlVolumeLight()
Description
Deletes an AlVolumeLight wrapper object.
AlObjectType AlVolumeLight::type() const
Description
Returns the class identifier, kVolumeLightType.
AlVolumeLight* AlVolumeLight::asVolumeLightPtr()
Description
This virtual function returns a non-null pointer to itself, indicating that it is safe to cast to an object of this class.
boolean AlVolumeLight::shadows() const
Description
This method returns the volume light's shadow flag (i.e. does the light cast shadows). This method returns FALSE if the light is not valid.
boolean AlVolumeLight::specular() const
Description
This method returns the volume light's specular flag (i.e. will this light contribute to specular component). This method returns FALSE if the light is not valid.
boolean AlVolumeLight::turbulenceAnimated() const
Description
This method returns the turbulence Animated flag. If the flag is TRUE, then a 4D turbulence table is built. Otherwise a 3D table is built. This method returns FALSE if the light is not valid.
boolean AlVolumeLight::turbulenceDirectional() const
Description
This method returns the turbulence Directional flag. If the flag is TRUE, then turbulence will be relative to the local light direction. This method returns FALSE if the light is not valid.
int AlVolumeLight::turbulenceSpaceRes() const
Description
This method returns the turbulence space Resolution (the size of the turbulence table in each dimension). -1 is returned if the light is not valid.
int AlVolumeLight::turbulenceTimeRes() const
Description
This method returns the turbulence time Resolution (the size of the turbulence table in time dimension). -1 is returned if the light is not valid.
double AlVolumeLight::intensity() const
Description
This method returns the volume light's intensity. -1 is returned if the light is not valid.
double AlVolumeLight::decay() const
Description
This method returns the volume light's decay. -1 is returned if the light is not valid.
double AlVolumeLight::decayStart() const
Description
This method returns the proportion of the distance from the center where the decay starts. -1 is returned if the light is not valid.
double AlVolumeLight::directionality() const
Description
This method returns the volume light's directionality. -1 is returned if the light is not valid.
double AlVolumeLight::concentric() const
Description
This method returns the relative strength of the concentric component of the light. -1 is returned if the light is not valid.
double AlVolumeLight::directional() const
Description
This method returns the relative strength of the directional component of the light. -1 is returned if the light is not valid.
double AlVolumeLight::radial() const
Description
This method returns the relative strength of the radial component of the light. -1 is returned if the light is not valid.
double AlVolumeLight::dropoff() const
Description
This method returns the volume light's dropoff. -1 is returned if the light is not valid.
double AlVolumeLight::dropoffStart() const
Description
This method returns the portion of the distance from the center to where the dropoff starts. -1 is returned if the light is not valid.
double AlVolumeLight::turbulenceIntensity() const
Description
This method returns the light's turbulence intensity. -1 is returned if the light is not valid.
double AlVolumeLight::turbulenceSpread() const
Description
This method returns the light's turbulence spread (space scale). -1 is returned if the light is not valid.
double AlVolumeLight::turbulencePersistance() const
Description
This method returns the light's turbulence Persistance (time scale). -1 is returned if the light is not valid.
double AlVolumeLight::turbulenceGranularity() const
Description
This method returns the light's turbulence granularity (high-pass cutoff). -1 is returned if the light is not valid.
double AlVolumeLight::turbulenceRoughness() const
Description
This method returns the light's turbulence Roughness (low-pass space cutoff). -1 is returned if the light is not valid.
double AlVolumeLight::turbulenceVariability() const
Description
This method returns the light's turbulence Variability (low-pass time cutoff). -1 is returned if the light is not valid.
statusCode AlVolumeLight::setShadows(boolean shadows)
Description
This method sets the shadows flag.
Arguments
< shadows - TRUE if shadows are to be cast.
Return codes
sSuccess - setting shadows succeeded
sInvalidObject - not a valid volume light
statusCode AlVolumeLight::setSpecular(boolean specular)
Description
This method sets the volume light's specular flag (i.e. will this light contribute to specular component).
Arguments
< specular - TRUE if the light contributes to the specular component
Return codes
sSuccess - setting specular succeeded
sInvalidObject - not a valid volume light
statusCode AlVolumeLight::setTurbulenceAnimated(boolean animated)
Description
This method sets the turbulence Animated flag.
Arguments
< animated - TRUE if a 4D turbulence table is to be built.
- FALSE if a 3D table is to be built.
Return codes
sSuccess - setting the animated succeeded
sInvalidObject - not a valid volume light
statusCode AlVolumeLight::setTurbulenceDirectional(boolean directional)
Description
This method sets the turbulence Directional flag.
Arguments
< directional - TRUE if turbulence is relative to the local light direction.
Return codes
sSuccess - setting the turbulence flag succeeded
sInvalidObject - not a valid volume light
statusCode AlVolumeLight::setTurbulenceSpaceRes(int space_res)
Description
This method sets the turbulence space Resolution.
Note that the product time_res*space_res should be <= 256 or you risk running out of swap space and patience.
Arguments
< space_res - the size of the turbulence table in each direction
Return codes
sSuccess - setting space resolution succeeded
sInvalidObject - not a valid volume light
sInvalidArgument - space_res out of range 1..32
statusCode AlVolumeLight::setTurbulenceTimeRes(int time_res)
Description
This method sets the turbulence time Resolution.
Note that the product time_res*space_res should be <= 256 or you risk running out of swap space and patience.
Arguments
< time_res - the size of the turbulence table in the time dimension
Return codes
sSuccess - setting time resolution succeeded
sInvalidObject - not a valid volume light
sInvalidArgument - time_res out of range 1..32
statusCode AlVolumeLight::setIntensity(double intensity)
Description
This method sets the volume light's intensity.
Arguments
< intensity - the intensity of the light
Return codes
sSuccess - setting the intensity succeeded
sInvalidObject - the light is not valid
statusCode AlVolumeLight::setDecay(double decay)
Description
This method sets the volume light's decay (please see the volume light documentation in the Menu Book; this decay is significantly different from the standard light decay).
Arguments
< decay - the decay of the light (from 0 to 1)
Return codes
sSuccess - setting decay succeeded
sInvalidObject - not a valid volume light
sInvalidArgument - decay out of range 0..1
statusCode AlVolumeLight::setDecayStart(double decay_start)
Description
This method sets the proportion of the distance from the center to where the decay starts.
Arguments
< decay_start - proportion of the distance from the center to the start
Return codes
sSuccess - setting decay succeeded
sInvalidObject - not a valid volume light
sInvalidArgument - decay out of range 0..1
statusCode AlVolumeLight::setDirectionality(double directionality)
Description
This method sets the volume light's directionality.
Arguments
< directionality - this is from 0 to 1
Return codes
sSuccess - setting directionality succeeded
sInvalidObject - not a valid volume light
sInvalidArgument - the directionality was out of the range 0..1
statusCode AlVolumeLight::setConcentric(double concentric)
Description
This method sets the relative strength of the concentric component of the light.
Arguments
< concentric - relative strength from 0 to 1
Return codes
sSuccess - setting specular succeeded
sInvalidObject - not a valid volume light
sInvalidArgument - concentric out of range 0..1
statusCode AlVolumeLight::setDirectional(double directional)
Description
This method sets the relative strength of the directional component of the light.
Arguments
< directional - the strength from 0 to 1
Return codes
sSuccess - setting directional succeeded
sInvalidObject - not a valid volume light
sInvalidArgument - directional out of range 0..1
statusCode AlVolumeLight::setRadial(double radial)
Description
This method sets the relative strength of the radial component of the light.
Arguments
< radial - the strength from 0 to 1
Return codes
sSuccess - setting radial succeeded
sInvalidObject - not a valid volume light
sInvalidArgument - radial out of range 0..1
statusCode AlVolumeLight::setDropoff(double dropoff)
Description
This method sets the volume light's dropoff.
Arguments
< dropoff - the dropoff from 0 to 50
Return codes
sSuccess - setting volume succeeded
sInvalidObject - not a valid volume light
sInvalidArgument - volume out of range 0..50
statusCode AlVolumeLight::setDropoffStart(double dropoff_start)
Description
This method sets the portion of the distance from the center to where the dropoff starts.
Arguments
< dropoff_start - the distance from 0 to 1
Return codes
sSuccess - setting dropoff succeeded
sInvalidObject - not a valid volume light
sInvalidArgument - dropoff out of range 0..1
statusCode AlVolumeLight::setTurbulenceIntensity(double intensity)
Description
This method sets the turbulence intensity.
Arguments
< intensity - the intensity to set
Return codes
sSuccess - setting intensity succeeded
sInvalidObject - not a valid volume light
statusCode AlVolumeLight::setTurbulenceSpread(double spread)
Description
This method sets the turbulence spread (on the space scale).
Arguments
< spread - the spread to set
Return codes
sSuccess - setting spread succeeded
sInvalidObject - not a valid volume light
statusCode AlVolumeLight::setTurbulencePersistance(double persistance)
Description
This method sets the turbulence Persistance (on the time scale).
Arguments
< persistance - persistance to set
Return codes
sSuccess - setting the Persistance succeeded
sInvalidObject - not a valid volume light
statusCode AlVolumeLight::setTurbulenceGranularity(double granularity)
Description
This method sets the turbulence granularity (high-pass cutoff).
Arguments
< granularity - granularity to set
Return codes
sSuccess - setting granularity succeeded
sInvalidObject - not a valid volume light
statusCode AlVolumeLight::setTurbulenceRoughness(double roughness)
Description
This method sets the turbulence Roughness (low-pass space cutoff).
Arguments
< roughness - the roughness to set
Return codes
sSuccess - setting roughness succeeded
sInvalidObject - not a valid volume light
statusCode AlVolumeLight::setTurbulenceVariability(double variability)
Description
This method sets the turbulence Variability (low-pass time cutoff).
Arguments
< variability - the variability to set
Return codes
sSuccess - setting Variability succeeded
sInvalidObject - not a valid volume light
aliasdocs@aw.sgi.com
Copyright © 1996, Alias|Wavefront, a Silicon Graphics Company. All rights
reserved.