KFbxTexture Class Reference

#include <kfbxtexture.h>

Inherits KFbxTakeNodeContainer.

Inheritance diagram for KFbxTexture:

Inheritance graph
List of all members.

Detailed Description

A texture is the description of the mapping of an image over a geometry.

Definition at line 79 of file kfbxtexture.h.

Texture Properties

enum  EAlphaSource
 Alpha sources. More...
enum  EMappingType
 Alpha sources. More...
enum  EPlanarMappingNormal
 Planar mapping normal orientations. More...
enum  EMaterialUse
 Material usages. More...
enum  ETextureUse
 Texture usages. More...
enum  EWrapMode
 Wrap modes. More...
enum  EBlendMode
 Blend modes. More...
void Reset ()
 Reset the texture to its default values.
bool SetFileName (char const *pName)
 Set the associated texture file.
bool SetRelativeFileName (char *pName)
 Set the associated texture file.
char const * GetFileName () const
 Get the associated texture file path.
char * GetRelativeFileName ()
 Get the associated texture file path.
void SetSwapUV (bool pSwapUV)
 Set the swap UV flag.
bool GetSwapUV () const
 Get the swap UV flag.
void SetAlphaSource (EAlphaSource pAlphaSource)
 Set alpha source.
EAlphaSource GetAlphaSource () const
 Get alpha source.
void SetCropping (int pLeft, int pTop, int pRight, int pBottom)
 Set cropping.
int GetCroppingLeft () const
 Get left cropping.
int GetCroppingTop () const
 Get top cropping.
int GetCroppingRight () const
 Get right cropping.
int GetCroppingBottom () const
 Get bottom cropping.
void SetMappingType (EMappingType pMappingType)
 Set mapping type.
EMappingType GetMappingType () const
 Get mapping type.
void SetPlanarMappingNormal (EPlanarMappingNormal pPlanarMappingNormal)
 Set planar mapping normal orientations.
EPlanarMappingNormal GetPlanarMappingNormal () const
 Get planar mapping normal orientations.
void SetMaterialUse (EMaterialUse pMaterialUse)
 Set material usage.
EMaterialUse GetMaterialUse () const
 Get material usage.
void SetTextureUse (ETextureUse pTextureUse)
 Set texture usage.
ETextureUse GetTextureUse () const
 Get texture usage.
void SetWrapMode (EWrapMode pWrapU, EWrapMode pWrapV)
 Set wrap mode in U and V.
EWrapMode GetWrapModeU () const
 Get wrap mode in U.
EWrapMode GetWrapModeV () const
 Get wrap mode in V.
void SetBlendMode (EBlendMode pBlendMode)
 Set blend mode.
EBlendMode GetBlendMode () const
 Get blend mode.

Error Management

enum  EError
 Error identifiers. More...
KErrorGetError ()
 Retrieve error object.
EError GetLastErrorID ()
 Get last error code.
char * GetLastErrorString ()
 Get last error string.

Default Animation Values

This set of functions provide direct access to default animation values in the default take node.

void SetDefaultT (const KFbxVector4 &pT)
 Set default translation vector.
KFbxVector4GetDefaultT (KFbxVector4 &pT) const
 Get default translation vector.
void SetDefaultR (const KFbxVector4 &pR)
 Set default rotation vector.
KFbxVector4GetDefaultR (KFbxVector4 &pR) const
 Get default rotation vector.
void SetDefaultS (const KFbxVector4 &pS)
 Set default scale vector.
KFbxVector4GetDefaultS (KFbxVector4 &pS) const
 Get default scale vector.
void SetDefaultAlpha (double pAlpha)
 Set default alpha.
double GetDefaultAlpha () const
 Get default alpha.

Obsolete Functions

This set of functions is obsolete since animated parameters are now supported.

U, V and W coordinates are mapped to X, Y and Z coordinates of the default vectors found in section "Default Animation Values".

void SetTranslation (double pU, double pV)
 Set translation.
double GetTranslationU () const
 Get translation applied to texture width.
double GetTranslationV () const
 Get translation applied to texture height.
void SetRotation (double pU, double pV, double pW=0.0)
 Set rotation.
double GetRotationU () const
 Get texture rotation around the U axis in degrees.
double GetRotationV () const
 Get texture rotation around the V axis in degrees.
double GetRotationW () const
 Get texture rotation around the W axis in degrees.
void SetScale (double pU, double pV)
 Set scale.
double GetScaleU () const
 Get scale applied to texture width.
double GetScaleV () const
 Get scale applied to texture height.


Member Enumeration Documentation

Alpha sources.

  • eNONE
  • eRGB_INTENSITY
  • eBLACK

Definition at line 148 of file kfbxtexture.h.

Alpha sources.

  • eNONE
  • eRGB_INTENSITY
  • eBLACK

Definition at line 206 of file kfbxtexture.h.

Planar mapping normal orientations.

  • ePLANAR_NORMAL_X
  • ePLANAR_NORMAL_Y
  • ePLANAR_NORMAL_Z

Definition at line 233 of file kfbxtexture.h.

Material usages.

  • eMODEL_MATERIAL
  • eDEFAULT_MATERIAL

Definition at line 254 of file kfbxtexture.h.

Texture usages.

  • eSTANDARD
  • eSHADOW_MAP
  • eLIGHT_MAP
  • eSPHERICAL_REFLEXION_MAP
  • eSPHERE_REFLEXION_MAP
  • eBUMP_NORMAL_MAP

Definition at line 278 of file kfbxtexture.h.

enum EWrapMode

Wrap modes.

  • eREPEAT
  • eCLAMP

Definition at line 302 of file kfbxtexture.h.

enum EBlendMode

Blend modes.

  • eTRANSLUCENT
  • eADDITIVE
  • eMODULATE
  • eMODULATE2

Definition at line 330 of file kfbxtexture.h.

enum EError

Error identifiers.

  • eTAKE_NODE_ERROR
  • eERROR_COUNT

Definition at line 517 of file kfbxtexture.h.


Member Function Documentation

void Reset (  ) 

Reset the texture to its default values.

Remarks:
Texture file name is not reset.

bool SetFileName ( char const *  pName  ) 

Set the associated texture file.

Parameters:
pFilename The path of the texture file.
Returns:
Return true on success.
Remarks:
The texture file name must be valid.

bool SetRelativeFileName ( char *  pName  ) 

Set the associated texture file.

Parameters:
pFilename The path of the texture file.
Returns:
Return true on success.
Remarks:
The texture file name must be valid.

char const* GetFileName (  )  const

Get the associated texture file path.

Returns:
The associated texture file path.

An empty string if KFbxTexture::SetFileName() has not been called before.

char* GetRelativeFileName (  ) 

Get the associated texture file path.

Returns:
The associated texture file path.

An empty string if KFbxTexture::SetRelativeFileName() has not been called before.

void SetSwapUV ( bool  pSwapUV  ) 

Set the swap UV flag.

Parameters:
pSwapUV Set to true if swap UV flag is enabled.
Remarks:
If swap UV flag is enabled, the texture's width and height are swapped.

bool GetSwapUV (  )  const

Get the swap UV flag.

Returns:
true if swap UV flag is enabled.
Remarks:
If swap UV flag is enabled, the texture's width and height are swapped.

void SetAlphaSource ( EAlphaSource  pAlphaSource  ) 

Set alpha source.

Parameters:
pAlphaSource Alpha source identifier.

EAlphaSource GetAlphaSource (  )  const

Get alpha source.

Returns:
Alpha source identifier for this texture.

void SetCropping ( int  pLeft,
int  pTop,
int  pRight,
int  pBottom 
)

Set cropping.

Parameters:
pLeft Left cropping value.
pTop Top cropping value.
pRight Right cropping value.
pBottom Bottom cropping value.
Remarks:
The defined rectangle is not checked for invalid values. It is the responsability of the caller to validate that the rectangle is meaningful for this texture.

int GetCroppingLeft (  )  const

Get left cropping.

Returns:
Left side of the cropping rectangle.

int GetCroppingTop (  )  const

Get top cropping.

Returns:
Top side of the cropping rectangle.

int GetCroppingRight (  )  const

Get right cropping.

Returns:
Right side of the cropping rectangle.

int GetCroppingBottom (  )  const

Get bottom cropping.

Returns:
Bottom side of the cropping rectangle.

void SetMappingType ( EMappingType  pMappingType  ) 

Set mapping type.

Parameters:
pMappingType Mapping type identifier.

EMappingType GetMappingType (  )  const

Get mapping type.

Returns:
Mapping type identifier.

void SetPlanarMappingNormal ( EPlanarMappingNormal  pPlanarMappingNormal  ) 

Set planar mapping normal orientations.

Parameters:
pPlanarMappingNormal Planar mapping normal orientation identifier.

EPlanarMappingNormal GetPlanarMappingNormal (  )  const

Get planar mapping normal orientations.

Returns:
Planar mapping normal orientation identifier.

void SetMaterialUse ( EMaterialUse  pMaterialUse  ) 

Set material usage.

Parameters:
pMaterialUse Material usage identifier.

EMaterialUse GetMaterialUse (  )  const

Get material usage.

Returns:
Material usage identifier.

void SetTextureUse ( ETextureUse  pTextureUse  ) 

Set texture usage.

Parameters:
pTextureUse Texure usage identifier.

ETextureUse GetTextureUse (  )  const

Get texture usage.

Returns:
Texture usage identifier.

void SetWrapMode ( EWrapMode  pWrapU,
EWrapMode  pWrapV 
)

Set wrap mode in U and V.

Parameters:
pWrapU Wrap mode identifier.
pWrapV Wrap mode identifier.

EWrapMode GetWrapModeU (  )  const

Get wrap mode in U.

Returns:
U wrap mode identifier.

EWrapMode GetWrapModeV (  )  const

Get wrap mode in V.

Returns:
V wrap mode identifier.

void SetBlendMode ( EBlendMode  pBlendMode  ) 

Set blend mode.

Parameters:
pBlendMode Blend mode identifier.

EBlendMode GetBlendMode (  )  const

Get blend mode.

Returns:
Blend mode identifier.

void SetDefaultT ( const KFbxVector4 pT  ) 

Set default translation vector.

Parameters:
pT First element is the U translation applied to texture. A displacement of one unit is equal to the texture width after the scaling in U is applied. Second element is the V translation applied to texture. A displacement of one unit is equal to the texture height after the scaling in V is applied. Third and fourth elements do not have an effect on texture translation.

KFbxVector4& GetDefaultT ( KFbxVector4 pT  )  const

Get default translation vector.

Parameters:
pT First element is the U translation applied to texture. A displacement of one unit is equal to the texture width after the scaling in U is applied. Second element is the V translation applied to texture. A displacement of one unit is equal to the texture height after the scaling in V is applied. Third and fourth elements do not have an effect on the texture. translation.
Returns:
Input parameter filled with appropriate data.

void SetDefaultR ( const KFbxVector4 pR  ) 

Set default rotation vector.

Parameters:
pR First element is the texture rotation around the U axis in degrees. Second element is the texture rotation around the V axis in degrees. Third element is the texture rotation around the W axis in degrees.
Remarks:
The W axis is oriented towards the result of the vector product of the U axis and V axis i.e. W = U x V.

KFbxVector4& GetDefaultR ( KFbxVector4 pR  )  const

Get default rotation vector.

Parameters:
pR First element is the texture rotation around the U axis in degrees. Second element is the texture rotation around the V axis in degrees. Third element is the texture rotation around the W axis in degrees.
Returns:
Input parameter filled with appropriate data.
Remarks:
The W axis is oriented towards the result of the vector product of the U axis and V axis i.e. W = U x V.

void SetDefaultS ( const KFbxVector4 pS  ) 

Set default scale vector.

Parameters:
pS First element is scale applied to texture width. Second element is scale applied to texture height. Third and fourth elements do not have an effect on the texture.
Remarks:
A scale value inferior to 1 means the texture is stretched. A scale value superior to 1 means the texture is compressed.

KFbxVector4& GetDefaultS ( KFbxVector4 pS  )  const

Get default scale vector.

Parameters:
pS First element is scale applied to texture width. Second element is scale applied to texture height. Third and fourth elements do not have an effect on the texture.
Returns:
Input parameter filled with appropriate data.
Remarks:
A scale value inferior to 1 means the texture is stretched. A scale value superior to 1 means the texture is compressed.

void SetDefaultAlpha ( double  pAlpha  ) 

Set default alpha.

Parameters:
pAlpha A value on a scale from 0 to 1, 0 meaning transparent.

double GetDefaultAlpha (  )  const

Get default alpha.

Returns:
A value on a scale from 0 to 1, 0 meaning transparent.

void SetTranslation ( double  pU,
double  pV 
)

Set translation.

Parameters:
pU Horizontal translation applied to texture. A displacement of one unit is equal to the texture's width after the scaling in U is applied.
pV Vertical translation applied to texture. A displacement of one unit is equal to the texture's height after the scaling in V is applied.

double GetTranslationU (  )  const

Get translation applied to texture width.

Remarks:
A displacement of one unit is equal to the texture's width after the scaling in U is applied.

double GetTranslationV (  )  const

Get translation applied to texture height.

Remarks:
A displacement of one unit is equal to the texture's height after the scaling in V is applied.

void SetRotation ( double  pU,
double  pV,
double  pW = 0.0 
)

Set rotation.

Parameters:
pU Texture rotation around the U axis in degrees.
pV Texture rotation around the V axis in degrees.
pW Texture rotation around the W axis in degrees.
Remarks:
The W axis is oriented towards the result of the vector product of the U axis and V axis i.e. W = U x V.

double GetRotationU (  )  const

Get texture rotation around the U axis in degrees.

double GetRotationV (  )  const

Get texture rotation around the V axis in degrees.

double GetRotationW (  )  const

Get texture rotation around the W axis in degrees.

void SetScale ( double  pU,
double  pV 
)

Set scale.

Parameters:
pU Scale applied to texture width.
pV Scale applied to texture height.
Remarks:
A scale value inferior to 1 means the texture is stretched. A scale value superior to 1 means the texture is compressed.

double GetScaleU (  )  const

Get scale applied to texture width.

Remarks:
A scale value inferior to 1 means the texture is stretched. A scale value superior to 1 means the texture is compressed.

double GetScaleV (  )  const

Get scale applied to texture height.

Remarks:
A scale value inferior to 1 means the texture is stretched. A scale value superior to 1 means the texture is compressed.

KError& GetError (  ) 

Retrieve error object.

Returns:
Reference to error object.

EError GetLastErrorID (  ) 

Get last error code.

Returns:
Last error code.

char* GetLastErrorString (  ) 

Get last error string.

Returns:
Textual description of the last error.