Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
TLight
Inherited By:
None.
Purpose:
TPointLight is a concrete derived class of TLight. TPointLight represents a nearby light source at a specific location, whose rays are not parallel. The light source is a single point (approximating a small light bulb, for example), as opposed to a larger light whose geometry might have to be taken into account. To the TLight protocol, the TPointLight class adds a position and a color (which includes intensity). The intensity is attenuated as a function of the distance between a surface point and the light. The default position is TGPoint3D(1000.,1000.,1000.), and the default color is white.
Instantiation:
Allocate on the heap or the stack.
Deriving Classes:
None.
Concurrency:
Not multithread safe.
Resource Use:
No special requirements.
- TPointLight ()
- TPointLight (const TGPoint3D & position, const TColor & color)
- TPointLight (const TPointLight & pointLight)
Interface Category:
API.
Purpose:
- Default constructor. Sets the default position to (1000., 1000., 1000.) and the default color to white.
- Constructor that sets the position and color of the point light.
- Copy constructor.
Calling Context:
- Called by the stream-in operators. You can also call this function directly.
- Call this function directly.
- Called to copy an object.
Parameters:
- Takes no parameters.
- const TGPoint3D & position -The position of the point light.
- const TColor & color -The color of the point light.
- const TPointLight & pointLight -The object to be copied.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual ~ TPointLight ()
Interface Category:
API.
Purpose:
Destructor.
Calling Context:
Called to destroy an object.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TPointLight::ComputeDiffuse
virtual void ComputeDiffuse (const TShadingSample & shadingInfo, const TSceneState & sceneState, TColor & resultantColor)
Interface Category:
API.
Purpose:
Calculates the diffuse contribution of the light at a particular surface location. The function returns kBlack if there is no diffuse light reaching the location.
Calling Context:
Call this function directly.
Parameters:
- const TShadingSample & shadingSample -The shading information for the point in question.
- const TSceneState & sceneState -The state of the scene.
- TColor & resultantColor -The resulting contribution of diffuse lighting for the sample location.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TPointLight::ComputeSpecular
virtual void ComputeSpecular (const TShadingSample & shadingInfo, const TSceneState & sceneState, double specularExp, TColor & resultantColor)
Interface Category:
API.
Purpose:
Calculates the specular intensity of the light at a particular surface location. The function returns kBlack if there is no specular light component at the location.
Calling Context:
Call this function directly.
Parameters:
- const TShadingSample & shadingSample -The shading information for the point in question.
- const TSceneState & sceneState -The state of the scene.
- double specularExp -The exponential value used to amplify the effect of the reflected light intensity.
- TColor & resultantColor -The resulting specular intensity at the surface location.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TPointLight::ComputeIntensity
virtual void ComputeIntensity (const TGPoint3D & position, TColor & resultantColor, double scale =1.)
Interface Category:
API.
Calculates the intensity of the light at a particular surface point.
Calling Context:
Call this function directly.
Parameters:
- const TGPoint3D & position -The 3-D location in question.
- TColor & resultantColor -The resulting intensity.
- double scale =-The scale value used to multiply the intensity value by. The default scale value is 1.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
API.
Other Considerations:
None.
Member Function: TPointLight::SetPosition
virtual void SetPosition (const TGPoint3D & position)
Interface Category:
API.
Purpose:
Sets the position of the point light.
Calling Context:
Call this function directly.
Parameters:
- const TGPoint3D & position -The position to set the light to.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TPointLight::SetColor
virtual void SetColor (const TColor & color)
Interface Category:
API.
Purpose:
Sets the color of the point light.
Calling Context:
Call this function directly.
Parameters:
- const TColor & color -The color to set the light to.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TPointLight::GetPosition
virtual TGPoint3D GetPosition () const
Interface Category:
API.
Purpose:
Returns the position of the point light.
Calling Context:
Call this function directly.
Parameters:
Return Value:
The position of the light.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TPointLight::GetColor
virtual void GetColor (TColor & color)
Interface Category:
API.
Purpose:
Returns the color of the light.
Calling Context:
Call this function directly.
Parameters:
- TColor & color -The color of the light.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TPointLight::operator=
TPointLight & operator =(const TPointLight & Src)
Interface Category:
API.
Purpose:
Assignment operator.
Calling Context:
Call this function by using the operator in an assignment statement.
Parameters:
Return Value:
A non-const reference to the left-hand side object.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TPointLight::operator>>=
virtual TStream & operator >>=(TStream &) const
Interface Category:
API.
Purpose:
Stream-out operator.
Calling Context:
Called to stream out data.
Parameters:
- TStream & -The stream that the object streams itself out to.
Return Value:
Returns a reference to the stream the object streams itself out to.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TPointLight::operator<<=
virtual TStream & operator <<= (TStream &)
Interface Category:
API.
Purpose:
Stream-in operator.
Calling Context:
Called to stream in data.
Parameters:
- TStream & -The stream that the object streams itself in from.
Return Value:
Returns a reference to the stream the object streams itself in from.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.