FCDEffectStandard Class Reference
[COLLADA Effect Classes [ColladaFX]]

A COMMON profile effect description. More...

#include <FCDEffectStandard.h>

Inheritance diagram for FCDEffectStandard:

FCDEffectProfile FCDObject FUObject List of all members.

Public Types

enum  LightingType {
  CONSTANT, LAMBERT, PHONG, BLINN,
  UNKNOWN
}
 The list of the lighting models supported by the COMMON profile of COLLADA. More...

Public Member Functions

 FCDEffectStandard (FCDocument *document, FCDEffect *parent)
 Constructor: do not use directly.
virtual ~FCDEffectStandard ()
 Destructor: do not use directly.
LightingType GetLightingType () const
 Retrieves the lighting model to be used for this profile.
void SetLightingType (LightingType _type)
 Sets the lighting model to be used for this profile.
virtual FUDaeProfileType::Type GetType () const
 Retrieves the profile type for this effect.
const FCDTextureListGetTextureBucket (uint32 bucket) const
 Retrieves the list of textures belonging to a specific channel.
size_t GetTextureCount (uint32 bucket) const
 Retrieves the number of textures belonging to a specific channel.
FCDTextureGetTexture (uint32 bucket, size_t index)
 Retrieves a texture.
const FCDTextureGetTexture (uint32 bucket, size_t index) const
 See above.
FCDTextureAddTexture (uint32 bucket)
 Adds a texture to a specific channel.
void ReleaseTexture (FCDTexture *texture)
 Releases a texture contained within this effect profile.
const FMVector3GetTranslucencyColor () const
 Retrieves the base translucency color.
void SetTranslucencyColor (const FMVector3 &color)
 Sets the base translucency color.
const float & GetTranslucencyFactor () const
 Retrieves the translucency factor.
void SetTranslucencyFactor (float factor)
 Sets the translucency factor.
float GetOpacity () const
 Retrieves the flat opacity.
const FMVector3GetEmissionColor () const
 Retrieves the base emission/self-illumination color.
void SetEmissionColor (const FMVector3 &color)
 Sets the base emission/self-illumination color.
const float & GetEmissionFactor () const
 Retrieves the emission/self-illumination factor.
void SetEmissionFactor (float factor)
 Sets the emission/self-illumination factor.
bool IsEmissionFactor () const
 Retrieves whether the emission factor was used, rather than the emission color.
void SetIsEmissionFactor (bool useFactor)
 Sets whether the emission factor is to be used, rather than the emission color.
const FMVector3GetDiffuseColor () const
 Retrieves the diffuse color.
void SetDiffuseColor (const FMVector3 &color)
 Sets the diffuse color.
const FMVector3GetAmbientColor () const
 Retrieves the ambient color.
void SetAmbientColor (const FMVector3 &color)
 Sets the ambient color.
const FMVector3GetSpecularColor () const
 Retrieves the base specular color.
void SetSpecularColor (const FMVector3 &color)
 Sets the specular color.
const float & GetSpecularFactor () const
 Retrieves the specular factor.
void SetSpecularFactor (float factor)
 Sets the specular factor.
const float & GetShininess () const
 Retrieves the specular shininess.
void SetShininess (float _shininess)
 Sets the specular shininess.
const FMVector3GetReflectivityColor () const
 Retrieves the base reflectivity color.
void SetReflectivityColor (const FMVector3 &color)
 Sets the base reflectivity color.
const float & GetReflectivityFactor () const
 Retrieves the reflectivity factor.
void SetReflectivityFactor (float factor)
 Sets the reflectivity factor.
float GetReflectivity () const
 Retrieves the flat reflectivity.
bool GetFacetedFlag () const
 Retrieves the 'faceted' flag.
void SetFacetedFlag (bool flag)
 Sets the 'faceted' flag.
bool GetDoubleSidedFlag () const
 Retrieves the 'double-sided' flag.
bool SetDoubleSidedFlag (bool flag)
 Sets the 'double-sided' flag.
bool GetWireframeFlag () const
 Retrieves the 'wireframe' flag.
bool SetWireframeFlag (bool flag)
 Sets the 'wireframe' flag.
bool GetFaceMapFlag () const
 Retrieves the 'face-map' flag.
void SetFaceMapFlag (bool flag)
 Sets the 'face-map' flag.
virtual FCDEffectParameterFindParameterBySemantic (const string &semantic)
 Retrieves an effect parameter.
virtual void FindParametersBySemantic (const string &semantic, FCDEffectParameterList &parameters)
 Retrieves a subset of the effect parameter list.
virtual void FindParametersByReference (const string &reference, FCDEffectParameterList &parameters)
 Retrieves a subset of the effect parameter list.
virtual FCDEffectProfileClone (FCDEffect *newParent)
 [INTERNAL] Clones the COMMON profile effect.
virtual void Flatten ()
 [INTERNAL] Flattens the profile.
virtual FUStatus LoadFromXML (xmlNode *baseNode)
 [INTERNAL] Reads in the <profile_COMMON> element from a given COLLADA XML tree node.
virtual xmlNode * WriteToXML (xmlNode *parentNode) const
 [INTERNAL] Writes out the <profile_COMMON> element to the given COLLADA XML tree node.

Detailed Description

A COMMON profile effect description.

The COMMON effect profile holds the information necessary to render your polygon sets using the well-defined lighting models.

COLLADA supports four lighting models: constant, Lambert, Phong and Blinn.


Member Enumeration Documentation

enum FCDEffectStandard::LightingType
 

The list of the lighting models supported by the COMMON profile of COLLADA.

Enumerator:
CONSTANT  The constant lighting model.

This lighting model uses the emissive color everywhere, without any complex lighting calculations. It also uses the translucency factor and the translucency color, by multiplying them together and applying them to your standard alpha channel according to the final lighting color.

LAMBERT  The Lambert lighting model.

This lighting model improves on the constant lighting model by using the dot-product between the normalized light vectors and the polygon normals to determine how much light should affect each polygon. This value is multiplied to the diffuse color and (1 + the ambient color).

PHONG  The Phong lighting model.

This lighting model improves on the Lambert lighting model by calculating how much light is reflected by the polygons into the viewer's eye. For this calculation, the shininess, the specular color and the reflectivity is used.

BLINN  The Blinn lighting model.

This lighting model improves on the Lambert lighting model by calculating how much light is reflected by the polygons into the viewer's eye. For this calculation, the shininess, the specular color and the reflectivity is used.

UNKNOWN  Not a valid lighting model.


Constructor & Destructor Documentation

FCDEffectStandard::FCDEffectStandard FCDocument document,
FCDEffect parent
 

Constructor: do not use directly.

Instead, use the FCDEffect::AddProfile function with the FUDaeProfileType::COMMON parameter.

Parameters:
document The COLLADA document that owns this effect profile.
parent The effect that contains this profile.

virtual FCDEffectStandard::~FCDEffectStandard  )  [virtual]
 

Destructor: do not use directly.

Instead, use the FCDEffect::ReleaseProfile function.


Member Function Documentation

FCDTexture* FCDEffectStandard::AddTexture uint32  bucket  ) 
 

Adds a texture to a specific channel.

Parameters:
bucket A texture channel index. This index should match one of the values in the FUDaeTextureChannel enum.
Returns:
The new texture. This pointer will be NULL if the bucket is out-of-bounds.

virtual FCDEffectProfile* FCDEffectStandard::Clone FCDEffect newParent  )  [virtual]
 

[INTERNAL] Clones the COMMON profile effect.

You will need release the cloned effect directly, by deleting the pointer.

Parameters:
newParent The effect that contains the cloned effect profile.
Returns:
The cloned effect profile. You will must delete this pointer.

Implements FCDEffectProfile.

virtual FCDEffectParameter* FCDEffectStandard::FindParameterBySemantic const string &  semantic  )  [virtual]
 

Retrieves an effect parameter.

Looks for the effect parameter with the correct semantic, in order to bind or override its value. This function searches through the effect profile and the level of abstractions below.

Parameters:
semantic The effect parameter semantic to match.
Returns:
The effect parameter that matches the semantic. This pointer may be NULL if no effect parameter matches the given semantic.

Implements FCDEffectProfile.

virtual void FCDEffectStandard::FindParametersByReference const string &  reference,
FCDEffectParameterList parameters
[virtual]
 

Retrieves a subset of the effect parameter list.

Look for effect parameters with the correct reference. This function searches through the effect profile and the level of abstractions below.

Parameters:
reference The effect parameter reference to match. In the case of effect parameter, the reference is replaced by the sub-id.
parameters The list of parameters to fill in. This list is not cleared.

Implements FCDEffectProfile.

virtual void FCDEffectStandard::FindParametersBySemantic const string &  semantic,
FCDEffectParameterList parameters
[virtual]
 

Retrieves a subset of the effect parameter list.

Look for effect parameters with the correct semantic. This function searches through the effect profile and the level of abstractions below.

Parameters:
semantic The effect parameter semantic to match.
parameters The list of parameters to fill in. This list is not cleared.

Implements FCDEffectProfile.

virtual void FCDEffectStandard::Flatten  )  [inline, virtual]
 

[INTERNAL] Flattens the profile.

Does nothing on the common profile.

Implements FCDEffectProfile.

const FMVector3& FCDEffectStandard::GetAmbientColor  )  const [inline]
 

Retrieves the ambient color.

This value is used in the Lambert lighting model.

Returns:
The ambient color.

const FMVector3& FCDEffectStandard::GetDiffuseColor  )  const [inline]
 

Retrieves the diffuse color.

This value is used in the Lambert lighting model.

Returns:
The diffuse color.

bool FCDEffectStandard::GetDoubleSidedFlag  )  const [inline]
 

Retrieves the 'double-sided' flag.

This flag is used in conjunction with 3dsMax. It represents whether all the faces of the polygon sets should be treated as two-sided and have normals in both directions.

Returns:
The status of the 'double-sided' flag.

const FMVector3& FCDEffectStandard::GetEmissionColor  )  const [inline]
 

Retrieves the base emission/self-illumination color.

This value must be multiplied with the emission factor to get the real emission color. This value is used in all lighting models.

Returns:
The base emission color.

const float& FCDEffectStandard::GetEmissionFactor  )  const [inline]
 

Retrieves the emission/self-illumination factor.

This value must be multiplied with the base emission color to get the real emission color.

Returns:
The emission factor.

bool FCDEffectStandard::GetFaceMapFlag  )  const [inline]
 

Retrieves the 'face-map' flag.

This is a pure 3dsMax flag and I have no idea what it does.

Returns:
The status of the 'face-map' flag.

bool FCDEffectStandard::GetFacetedFlag  )  const [inline]
 

Retrieves the 'faceted' flag.

This flag is used in conjunction with 3dsMax. It represents whether all the edges of the polygon sets using this effect profile should be hard. The final result of using this flag is a mesh where all the faces stand out.

Returns:
The status of the 'faceted' flag.

LightingType FCDEffectStandard::GetLightingType  )  const [inline]
 

Retrieves the lighting model to be used for this profile.

Returns:
The lighting model.

float FCDEffectStandard::GetOpacity  )  const
 

Retrieves the flat opacity.

This is a calculated value and will not take into consideration any animations that affect either the base translucency color or the translucency factor. This value can be used in all lighting models.

Returns:
The flat opacity.

float FCDEffectStandard::GetReflectivity  )  const
 

Retrieves the flat reflectivity.

This is a calculated value and will not take into consideration any animations that affect either the base reflectivity color or the reflectivity factor. This value can be used in the Phong and Blinn lighting models.

Returns:
The flat reflectivity.

const FMVector3& FCDEffectStandard::GetReflectivityColor  )  const [inline]
 

Retrieves the base reflectivity color.

This value must be multiplied to the reflectivity factor to get the real reflectivity color. This value is used in the Phong and Blinn lighting models.

Returns:
The base reflectivity color.

const float& FCDEffectStandard::GetReflectivityFactor  )  const [inline]
 

Retrieves the reflectivity factor.

This value must be multiplied to the base reflectivity color to get the real reflectivity color. This value is used in the Phong and Blinn lighting models.

Returns:
The reflectivity factor.

const float& FCDEffectStandard::GetShininess  )  const [inline]
 

Retrieves the specular shininess.

This value represents the exponent to which you must raise the dot-product between the view vector and reflected light vectors: as such, it is usually a number greater than 1. This value is used in the Phong and Blinn lighting models.

Returns:
The specular shininess.

const FMVector3& FCDEffectStandard::GetSpecularColor  )  const [inline]
 

Retrieves the base specular color.

This value must be multiplied with the specular factor to get the real specular color. This value is used in the Phong and Blinn lighting models.

Returns:
The specular color.

const float& FCDEffectStandard::GetSpecularFactor  )  const [inline]
 

Retrieves the specular factor.

This value must be multiplied with the base specular color to get the real specular color. This value is used in the Phong and Blinn lighting models.

Returns:
The specular factor.

FCDTexture* FCDEffectStandard::GetTexture uint32  bucket,
size_t  index
[inline]
 

Retrieves a texture.

Parameters:
bucket A texture channel index. This index should match one of the values in the FUDaeTextureChannel enum.
index The index of a texture within this channel.
Returns:
The texture. This pointer will be NULL if either the bucket or the index is out-of-bounds.

const FCDTextureList& FCDEffectStandard::GetTextureBucket uint32  bucket  )  const
 

Retrieves the list of textures belonging to a specific channel.

Parameters:
bucket A texture channel index. This index should match one of the values in the FUDaeTextureChannel enum.
Returns:
The list of textures for this channel.

size_t FCDEffectStandard::GetTextureCount uint32  bucket  )  const [inline]
 

Retrieves the number of textures belonging to a specific channel.

Parameters:
bucket A texture channel index. This index should match one of the values in the FUDaeTextureChannel enum.
Returns:
The number of textures in that channel.

const FMVector3& FCDEffectStandard::GetTranslucencyColor  )  const [inline]
 

Retrieves the base translucency color.

This value must be multiplied with the translucency factor to get the real translucency color. This value is used in all lighting models.

Returns:
The base translucency color.

const float& FCDEffectStandard::GetTranslucencyFactor  )  const [inline]
 

Retrieves the translucency factor.

This value must be multiplied with the translucency color to get the real translucency color. This value is used in all lighting models.

Returns:
The translucency factor.

virtual FUDaeProfileType::Type FCDEffectStandard::GetType  )  const [inline, virtual]
 

Retrieves the profile type for this effect.

This function is a part of the FCDEffectProfile interface and allows you to up-cast an effect profile pointer safely to this class.

Returns:
The profile type: COMMON.

Implements FCDEffectProfile.

bool FCDEffectStandard::GetWireframeFlag  )  const [inline]
 

Retrieves the 'wireframe' flag.

This flag is used in conjunction with 3dsMax. It represents whether all the edges of the polygon sets should be rendered, rather than the faces.

Returns:
The status of the 'wireframe' flag.

bool FCDEffectStandard::IsEmissionFactor  )  const [inline]
 

Retrieves whether the emission factor was used, rather than the emission color.

This value is used in conjunction with 3dsMax, in which the self-illumination color and the self-illumination factor are mutually exclusive.

Returns:
Whether the emission factor is to be used.

virtual FUStatus FCDEffectStandard::LoadFromXML xmlNode *  baseNode  )  [virtual]
 

[INTERNAL] Reads in the <profile_COMMON> element from a given COLLADA XML tree node.

For COLLADA 1.3 backward-compatibility, this function can also read in <material> elements.

Parameters:
baseNode The COLLADA XML tree node.
Returns:
The status of the import. If the status is not successful, it may be dangerous to extract information from the effect profile.

Implements FCDEffectProfile.

void FCDEffectStandard::ReleaseTexture FCDTexture texture  ) 
 

Releases a texture contained within this effect profile.

Parameters:
texture The texture to release.

void FCDEffectStandard::SetAmbientColor const FMVector3 color  )  [inline]
 

Sets the ambient color.

Parameters:
color The ambient color.

void FCDEffectStandard::SetDiffuseColor const FMVector3 color  )  [inline]
 

Sets the diffuse color.

Parameters:
color The diffuse color.

bool FCDEffectStandard::SetDoubleSidedFlag bool  flag  )  [inline]
 

Sets the 'double-sided' flag.

This flag is used in conjunction with 3dsMax. It represents whether all the faces of the polygon sets should be treated as two-sided and have normals in both directions.

Parameters:
flag The status of the 'double-sided' flag.

void FCDEffectStandard::SetEmissionColor const FMVector3 color  )  [inline]
 

Sets the base emission/self-illumination color.

Parameters:
color The base emission color.

void FCDEffectStandard::SetEmissionFactor float  factor  )  [inline]
 

Sets the emission/self-illumination factor.

Parameters:
factor The emission factor.

void FCDEffectStandard::SetFaceMapFlag bool  flag  )  [inline]
 

Sets the 'face-map' flag.

This is a pure 3dsMax flag and I have no idea what it does.

Parameters:
flag The status of the 'face-map' flag.

void FCDEffectStandard::SetFacetedFlag bool  flag  )  [inline]
 

Sets the 'faceted' flag.

This flag is used in conjunction with 3dsMax. It represents whether all the edges of the polygon sets using this effect profile should be hard. The final result of using this flag is a mesh where all the faces stand out.

Parameters:
flag The status of the 'faceted' flag.

void FCDEffectStandard::SetIsEmissionFactor bool  useFactor  )  [inline]
 

Sets whether the emission factor is to be used, rather than the emission color.

This value is used in conjunction with 3dsMax, in which the self-illumination color and the self-illumination factor are mutually exclusive.

Parameters:
useFactor Whether the emission factor should be used.

void FCDEffectStandard::SetLightingType LightingType  _type  )  [inline]
 

Sets the lighting model to be used for this profile.

Note that which parameters are exported depends on the lighting model.

Parameters:
_type The lighting model.

void FCDEffectStandard::SetReflectivityColor const FMVector3 color  )  [inline]
 

Sets the base reflectivity color.

Parameters:
color The base reflectivity color.

void FCDEffectStandard::SetReflectivityFactor float  factor  )  [inline]
 

Sets the reflectivity factor.

Parameters:
factor The reflectivity factor.

void FCDEffectStandard::SetShininess float  _shininess  )  [inline]
 

Sets the specular shininess.

This value represents the exponent to which you must raise the dot-product between the view vector and reflected light vectors: as such, it is usually a number greater than 1.

Parameters:
_shininess The specular shininess.

void FCDEffectStandard::SetSpecularColor const FMVector3 color  )  [inline]
 

Sets the specular color.

Parameters:
color The specular color.

void FCDEffectStandard::SetSpecularFactor float  factor  )  [inline]
 

Sets the specular factor.

Parameters:
factor The specular factor.

void FCDEffectStandard::SetTranslucencyColor const FMVector3 color  )  [inline]
 

Sets the base translucency color.

Parameters:
color The base translucency color.

void FCDEffectStandard::SetTranslucencyFactor float  factor  )  [inline]
 

Sets the translucency factor.

Parameters:
factor The translucency factor.

bool FCDEffectStandard::SetWireframeFlag bool  flag  )  [inline]
 

Sets the 'wireframe' flag.

This flag is used in conjunction with 3dsMax. It represents whether all the edges of the polygon sets should be rendered, rather than the faces.

Parameters:
flag The status of the 'wireframe' flag.

virtual xmlNode* FCDEffectStandard::WriteToXML xmlNode *  parentNode  )  const [virtual]
 

[INTERNAL] Writes out the <profile_COMMON> element to the given COLLADA XML tree node.

Parameters:
parentNode The COLLADA XML parent node in which to insert the effect profile.
Returns:
The created element XML tree node.

Implements FCDEffectProfile.


The documentation for this class was generated from the following file:
Generated on Fri May 12 16:44:42 2006 for FCollada by  doxygen 1.4.6-NO