
Public Member Functions | |
| TBasicDistantLight () | |
| virtual MCCOMErr MCCOMAPI | QueryInterface (const MCIID &riid, void **ppvObj) |
| virtual uint32 MCCOMAPI | AddRef () |
| virtual MCCOMErr MCCOMAPI | ExtensionDataChanged () |
| virtual MCCOMErr MCCOMAPI | SetTransform (TTransform3D *transform) |
| virtual MCCOMErr MCCOMAPI | GetDirection (const TVector3 &point, TVector3 &resultDirection, real &resultDistance) |
| virtual boolean MCCOMAPI | GetColor (const TVector3 &point, const TVector3 &direction, const real distance, TMCColorRGB &result, real &ShadowIntensity) |
| virtual boolean MCCOMAPI | IsVisibleInPerspective () |
| virtual uint32 MCCOMAPI | GetPrimitiveID () |
| virtual MCCOMErr MCCOMAPI | ForEachShadowBuffer (ForEachShadowBufferCallback proc, void *priv) |
| virtual boolean MCCOMAPI | GetUVfromDirection (TVector2 &uv, const TVector3 &direction) const |
| virtual MCCOMErr MCCOMAPI | GetStandardLight (TStandardLight &light) const |
| virtual void MCCOMAPI | InitSampling (const TBBox3D &sceneBoundingBox, real &solidAngle, int32 ®ionCount) |
| virtual void MCCOMAPI | GetRandomRay (int32 regionIndex, Ray3D &ray) const |
| virtual int32 MCCOMAPI | GetShadowBufferCount () const |
| virtual void MCCOMAPI | GetShadowBuffer (int32 bufferIndex, I3DShCamera **camera, TBBox2D &uvBox) const |
| virtual real32 MCCOMAPI | GetScalingFactor () const |
| virtual void MCCOMAPI | SetScalingFactor (real32 inValue) |
| virtual real MCCOMAPI | UpdateLightRadius (const real radiusFromShadowFeature) const |
Public Attributes | |
| Data | fData |
Static Public Attributes | |
| static const MCGUID | ClassId |
Protected Attributes | |
| TMCColorRGB | fBritColor |
| TTransform3D | fTransform |
| TVector3 | fI |
| TVector3 | fJ |
| TVector3 | fD |
| TVector2 | fMin |
| TVector2 | fMax |
| real | fSamplingDistance |
| TMCArray< int32 > | fSampleIndices |
Static Protected Attributes | |
| static const real32 | sRealMax |
Classes | |
| struct | Data |
| TBasicDistantLight::TBasicDistantLight | ( | ) |
| virtual MCCOMErr MCCOMAPI TBasicDistantLight::QueryInterface | ( | const MCIID & | riid, | |
| void ** | ppvObj | |||
| ) | [virtual] |
Check if the object supports a given interface and returns a pointer to that interface if it does. Note that QueryInterface will increment the reference count of the object by one if the interface is found.
| riid | GUID of the interface | |
| ppvObj | A pointer to the pointer being returned. |
Reimplemented from TBasicLight.
| virtual uint32 MCCOMAPI TBasicDistantLight::AddRef | ( | ) | [inline, virtual] |
Increments the reference count of the object
Reimplemented from TBasicLight.
| virtual MCCOMErr MCCOMAPI TBasicDistantLight::ExtensionDataChanged | ( | ) | [virtual] |
Called each time a parameter of the parameter map (Pmap) is modified. This should only be used to invalidate caches and should be quick since it can be called many times.
Reimplemented from TBasicDataExchanger.
| virtual MCCOMErr MCCOMAPI TBasicDistantLight::SetTransform | ( | TTransform3D * | transform | ) | [virtual] |
Called to tell a light source its position and orientation in space. This function is used to cache transform information to speed up GetDirection() and GetColor().
| transform | A pointer to the Global Transform of the light |
Reimplemented from TBasicLight.
| virtual MCCOMErr MCCOMAPI TBasicDistantLight::GetDirection | ( | const TVector3 & | point, | |
| TVector3 & | resultDirection, | |||
| real & | resultDistance | |||
| ) | [virtual] |
Returns the direction from the point to the light source as well as the distance between the surface point and light source. GetDirection() is called prior to GetColor() to perform preliminary calculations. The surface point is the point on the object where the light is about to be calculated.
A light bulb typically calculates resultDirection by subtracting the postion point to the light source origin, then normalizes the results. A simulated sun light returns its light direction in resultDirection, and the maximum possible value in resultDistance.
| point | The point on the surface for which the lighting is going to be calculated | |
| resultDirection | The direction from which the light arrives on the point | |
| resultDistance | The distance from the point to the light |
Reimplemented from TBasicLight.
| virtual boolean MCCOMAPI TBasicDistantLight::GetColor | ( | const TVector3 & | point, | |
| const TVector3 & | direction, | |||
| const real | distance, | |||
| TMCColorRGB & | result, | |||
| real & | ShadowIntensity | |||
| ) | [virtual] |
Returns the color of light seen through a given point.
When using a spot, use the position parameter and the light source position and orientation to determine whether a point is in the light beam or not. When using a sun, use the direction parameter to calculate the intensity. When lighting is based on distance, (such as distance fall-off), use the distance parameter.
| point | The point on the surface for which the lighting is going to be calculated. | |
| direction | The direction from which the light arrives on the point (as calculated in GetDirection()). | |
| distance | The distance from the point to the light (as calculated in GetDirection()). | |
| result | The color of the light that reaches this point | |
| ShadowIntensity | The intensity of the shadow cast by that light |
Reimplemented from TBasicLight.
| virtual boolean MCCOMAPI TBasicDistantLight::IsVisibleInPerspective | ( | ) | [virtual] |
Returns true if the light should be displayed in the 3D View. In this case, the lights is displayed with the geometry of the primitive given by GetPrimitiveID().
If it returns false, then the light is not displayed, this is used for sun lights for example.
Reimplemented from TBasicLight.
| virtual uint32 MCCOMAPI TBasicDistantLight::GetPrimitiveID | ( | ) | [virtual] |
Returns the ID of the primitive that is displayed in place of the light.
Reimplemented from TBasicLight.
| virtual MCCOMErr MCCOMAPI TBasicDistantLight::ForEachShadowBuffer | ( | ForEachShadowBufferCallback | proc, | |
| void * | priv | |||
| ) | [virtual] |
| virtual boolean MCCOMAPI TBasicDistantLight::GetUVfromDirection | ( | TVector2 & | uv, | |
| const TVector3 & | direction | |||
| ) | const [virtual] |
returns the uv for the gel given a direction
| uv | The uv that are returned. | |
| direction | The direction as calculated in GetDirection() |
Reimplemented from TBasicLight.
| virtual MCCOMErr MCCOMAPI TBasicDistantLight::GetStandardLight | ( | TStandardLight & | light | ) | const [virtual] |
Retrieves a standard description of the light for use in the interactive renderer.
| light | A reference to the simplified description of the light for the interactive rendering |
Reimplemented from TBasicLight.
| virtual void MCCOMAPI TBasicDistantLight::InitSampling | ( | const TBBox3D & | sceneBoundingBox, | |
| real & | solidAngle, | |||
| int32 & | regionCount | |||
| ) | [virtual] |
Initialize sampling of the light and returns the solid angle containing the sampling rays. It must be called before GetRandomRay
| sceneBoundingBox | The bounding box of the scene | |
| solidAngle | Returns the solid Angle of the sampling rays | |
| regionCount | Returns the number of region for ray sampling (each region represent an equal number of rays) |
Reimplemented from TBasicLight.
| virtual void MCCOMAPI TBasicDistantLight::GetRandomRay | ( | int32 | regionIndex, | |
| Ray3D & | ray | |||
| ) | const [virtual] |
Returns a random ray starting from the light The rays should sample uniformly a solid angle that contains at least the intersection of the light cone (or sphere) and the scene.
| ray | A reference to the ray that should be returned | |
| regionIndex | Index of the region in which the ray should be picked |
Reimplemented from TBasicLight.
| virtual int32 MCCOMAPI TBasicDistantLight::GetShadowBufferCount | ( | ) | const [virtual] |
Returns the number of shadow buffer needed for this light
Reimplemented from TBasicLight.
| virtual void MCCOMAPI TBasicDistantLight::GetShadowBuffer | ( | int32 | bufferIndex, | |
| I3DShCamera ** | camera, | |||
| TBBox2D & | uvBox | |||
| ) | const [virtual] |
Returns a camera equivalent to a shadow buffer
| bufferIndex | index of the shadow buffer (0 based) | |
| camera | returns a pointer to the camera corresponding to the shadow buffer | |
| uvBox | returns the box in screen coordinates corresponding to the shadow buffer |
Reimplemented from TBasicLight.
| virtual real32 MCCOMAPI TBasicDistantLight::GetScalingFactor | ( | ) | const [inline, virtual] |
Returns the scaling that should be applied to the object, i.e. the number of inches in the primitive's unit.
Reimplemented from TBasicLight.
| virtual void MCCOMAPI TBasicDistantLight::SetScalingFactor | ( | real32 | inValue | ) | [inline, virtual] |
Sets the scaling factor of the object
| inValue | the number of inches to which the primitive's unit is equivalent |
Reimplemented from TBasicLight.
| virtual real MCCOMAPI TBasicDistantLight::UpdateLightRadius | ( | const real | radiusFromShadowFeature | ) | const [virtual] |
Calculates a corrected radius for soft shadows. This is used in particular for distant lights to rescale the parameter
| radiusFromShadowFeature | radius of the light as specified by the user in the shadow feature |
Reimplemented from TBasicLight.
const MCGUID TBasicDistantLight::ClassId [static] |
TMCColorRGB TBasicDistantLight::fBritColor [protected] |
TTransform3D TBasicDistantLight::fTransform [protected] |
TVector3 TBasicDistantLight::fI [protected] |
TVector3 TBasicDistantLight::fJ [protected] |
TVector3 TBasicDistantLight::fD [protected] |
TVector2 TBasicDistantLight::fMin [protected] |
TVector2 TBasicDistantLight::fMax [protected] |
real TBasicDistantLight::fSamplingDistance [protected] |
TMCArray<int32> TBasicDistantLight::fSampleIndices [mutable, protected] |
const real32 TBasicDistantLight::sRealMax [static, protected] |
1.5.3