KFbxTexture Class Reference

#include <kfbxtexture.h>
Inheritance diagram for KFbxTexture:
Inheritance graph
[legend]

List of all members.


Detailed Description

This class describes image mapping on top of geometry.
Note:
To apply a texture to geometry, first connect the geometry to a KFbxSurfaceMaterial object (e.g. KFbxSurfaceLambert) and then connect one of its properties (e.g. Diffuse) to the KFbxTexture object.
See also:
KFbxSurfaceLambert

KFbxSurfacePhong

KFbxSurfaceMaterial

Note:
For some example code, see also the CreateTexture() function in the ExportScene03 of FBX SDK examples.

Definition at line 67 of file kfbxtexture.h.


Texture Properties

enum   EUnifiedMappingType {
   eUMT_UV,
   eUMT_XY,
   eUMT_YZ,
   eUMT_XZ,
   eUMT_SPHERICAL,
   eUMT_CYLINDRICAL,
   eUMT_ENVIRONMENT,
   eUMT_PROJECTION,
   eUMT_BOX,
   eUMT_FACE,
   eUMT_NO_MAPPING
}
  Texture mapping types. More...
enum   ETextureUse6 {
   eTEXTURE_USE_6_STANDARD,
   eTEXTURE_USE_6_SPHERICAL_REFLEXION_MAP,
   eTEXTURE_USE_6_SPHERE_REFLEXION_MAP,
   eTEXTURE_USE_6_SHADOW_MAP,
   eTEXTURE_USE_6_LIGHT_MAP,
   eTEXTURE_USE_6_BUMP_NORMAL_MAP
}
  Texture uses. More...
enum   EWrapMode {
   eREPEAT,
   eCLAMP
}
  Wrap modes. More...
enum   EBlendMode {
   eTRANSLUCENT,
   eADDITIVE,
   eMODULATE,
   eMODULATE2,
   eOVER
}
  Blend modes. More...
enum   EAlignMode {
   eLEFT = 0,
   eRIGHT,
   eTOP,
   eBOTTOM
}
  Alignment modes. More...
enum   ECoordinates {
   eU = 0,
   eV,
   eW
}
  Texture coordinates. More...
enum   EAlphaSource {
   eNONE,
   eRGB_INTENSITY,
   eBLACK
}
  Alpha sources. More...
enum   EMappingType {
   eNULL,
   ePLANAR,
   eSPHERICAL,
   eCYLINDRICAL,
   eBOX,
   eFACE,
   eUV,
   eENVIRONMENT
}
  Texture mapping types. More...
enum   EPlanarMappingNormal {
   ePLANAR_NORMAL_X,
   ePLANAR_NORMAL_Y,
   ePLANAR_NORMAL_Z
}
  Planar mapping normal orientations. More...
enum   EMaterialUse {
   eMODEL_MATERIAL,
   eDEFAULT_MATERIAL
}
  Material uses. More...
enum   ETextureUse {
   eSTANDARD,
   eSHADOW_MAP,
   eLIGHT_MAP,
   eSPHERICAL_REFLEXION_MAP,
   eSPHERE_REFLEXION_MAP,
   eBUMP_NORMAL_MAP
}
  Texture uses. More...
KFbxTypedProperty< ETextureUse6 TextureTypeUse
  This property handles the use of textures.
KFbxTypedProperty< fbxDouble1 Alpha
  This property handles the default alpha value for textures.
KFbxTypedProperty
< EUnifiedMappingType
CurrentMappingType
  This property handles the texture mapping types.
KFbxTypedProperty< EWrapMode WrapModeU
  This property handles the texture wrap modes in U.
KFbxTypedProperty< EWrapMode WrapModeV
  This property handles the texture wrap modes in V.
KFbxTypedProperty< fbxBool1 UVSwap
  This property handles the swap UV flag.
KFbxTypedProperty< fbxDouble3 Translation
  This property handles the default translation vector.
KFbxTypedProperty< fbxDouble3 Rotation
  This property handles the default rotation vector.
KFbxTypedProperty< fbxDouble3 Scaling
  This property handles the default scale vector.
KFbxTypedProperty< fbxDouble3 RotationPivot
  This property handles the rotation pivot vector.
KFbxTypedProperty< fbxDouble3 ScalingPivot
  This property handles the scaling pivot vector.
KFbxTypedProperty< fbxBool1 UseMaterial
  This property handles the material use.
KFbxTypedProperty< fbxBool1 UseMipMap
  This property handles the Mipmap use.
KFbxTypedProperty< EBlendMode CurrentTextureBlendMode
  This property handles the texture blend mode.
KFbxTypedProperty< fbxString UVSet
  This property handles the use of UV sets.
void  Reset ()
  Resets the default texture values.
bool  SetFileName (char const *pName)
  Sets the associated texture file.
bool  SetRelativeFileName (char const *pName)
  Sets the associated texture file.
char const *  GetFileName () const
  Returns the absolute texture file path.
char const *  GetRelativeFileName () const
  Returns the relative texture file path.
void  SetSwapUV (bool pSwapUV)
  Sets the swap UV flag.
bool  GetSwapUV () const
  Returns the swap UV flag.
void  SetAlphaSource (EAlphaSource pAlphaSource)
  Sets the alpha source.
EAlphaSource  GetAlphaSource () const
  Returns the alpha source.
void  SetCropping (int pLeft, int pTop, int pRight, int pBottom)
  Sets cropping.
int  GetCroppingLeft () const
  Returns left cropping.
int  GetCroppingTop () const
  Returns top cropping.
int  GetCroppingRight () const
  Returns right cropping.
int  GetCroppingBottom () const
  Returns bottom cropping.
void  SetMappingType (EMappingType pMappingType)
  Sets the mapping type.
EMappingType  GetMappingType () const
  Returns the mapping type.
void  SetPlanarMappingNormal (EPlanarMappingNormal pPlanarMappingNormal)
  Sets the normal orientations for planar mapping.
EPlanarMappingNormal  GetPlanarMappingNormal () const
  Returns the normal orientations for planar mapping.
void  SetMaterialUse (EMaterialUse pMaterialUse)
  Sets the material use.
EMaterialUse  GetMaterialUse () const
  Returns the material use.
void  SetTextureUse (ETextureUse pTextureUse)
  Sets the texture use.
ETextureUse  GetTextureUse () const
  Returns the texture use.
void  SetWrapMode (EWrapMode pWrapU, EWrapMode pWrapV)
  Sets the U and V wrap mode.
EWrapMode  GetWrapModeU () const
  Returns the U wrap mode.
EWrapMode  GetWrapModeV () const
  Returns the V wrap mode.
void  SetBlendMode (EBlendMode pBlendMode)
  Sets the blend mode.
EBlendMode  GetBlendMode () const
  Returns the blend mode.

Default Values Management By Vectors

This set of functions provides direct access to the default values in vector base.

void  SetDefaultT (const KFbxVector4 &pT)
  Sets the default translation vector.
KFbxVector4 GetDefaultT (KFbxVector4 &pT) const
  Returns the default translation vector.
void  SetDefaultR (const KFbxVector4 &pR)
  Sets the default rotation vector.
KFbxVector4 GetDefaultR (KFbxVector4 &pR) const
  Returns the default rotation vector.
void  SetDefaultS (const KFbxVector4 &pS)
  Sets the default scale vector.
KFbxVector4 GetDefaultS (KFbxVector4 &pS) const
  Returns the default scale vector.
void  SetDefaultAlpha (double pAlpha)
  Sets the default alpha.
double  GetDefaultAlpha () const
  Returns the default alpha.

Default Values Management By Numbers

This set of functions provides direct access to the default values in number base.

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

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

Member Enumeration Documentation

Texture mapping types.

  • eUMT_UV
  • eUMT_XY
  • eUMT_YZ
  • eUMT_XZ
  • eUMT_SPHERICAL
  • eUMT_CYLINDRICAL
  • eUMT_ENVIRONMENT
  • eUMT_PROJECTION
  • eUMT_BOX
  • eUMT_FACE
  • eUMT_NO_MAPPING
Enumerator:
eUMT_UV 
eUMT_XY 
eUMT_YZ 
eUMT_XZ 
eUMT_SPHERICAL 
eUMT_CYLINDRICAL 
eUMT_ENVIRONMENT 
eUMT_PROJECTION 
eUMT_BOX 
eUMT_FACE 
eUMT_NO_MAPPING 

Definition at line 90 of file kfbxtexture.h.

Texture uses.

  • eTEXTURE_USE_6_STANDARD
  • eTEXTURE_USE_6_SPHERICAL_REFLEXION_MAP
  • eTEXTURE_USE_6_SPHERE_REFLEXION_MAP
  • eTEXTURE_USE_6_SHADOW_MAP
  • eTEXTURE_USE_6_LIGHT_MAP
  • eTEXTURE_USE_6_BUMP_NORMAL_MAP
Enumerator:
eTEXTURE_USE_6_STANDARD 
eTEXTURE_USE_6_SPHERICAL_REFLEXION_MAP 
eTEXTURE_USE_6_SPHERE_REFLEXION_MAP 
eTEXTURE_USE_6_SHADOW_MAP 
eTEXTURE_USE_6_LIGHT_MAP 
eTEXTURE_USE_6_BUMP_NORMAL_MAP 

Definition at line 114 of file kfbxtexture.h.

enum EWrapMode

Wrap modes.

  • eREPEAT
  • eCLAMP
Enumerator:
eREPEAT 
eCLAMP 

Definition at line 128 of file kfbxtexture.h.

enum EBlendMode

Blend modes.

  • eTRANSLUCENT
  • eADDITIVE
  • eMODULATE
  • eMODULATE2
  • eOVER
Enumerator:
eTRANSLUCENT 
eADDITIVE 
eMODULATE 
eMODULATE2 
eOVER 

Reimplemented in KFbxLayeredTexture.

Definition at line 141 of file kfbxtexture.h.

enum EAlignMode

Alignment modes.

  • KFBXTEXTURE_LEFT
  • KFBXTEXTURE_RIGHT
  • KFBXTEXTURE_TOP
  • KFBXTEXTURE_BOTTOM
Enumerator:
eLEFT 
eRIGHT 
eTOP 
eBOTTOM 

Definition at line 156 of file kfbxtexture.h.

Texture coordinates.

  • KFBXTEXTURE_U
  • KFBXTEXTURE_V
  • KFBXTEXTURE_W
Enumerator:
eU 
eV 
eW 

Definition at line 169 of file kfbxtexture.h.

Alpha sources.

  • eNONE
  • eRGB_INTENSITY
  • eBLACK
Enumerator:
eNONE 
eRGB_INTENSITY 
eBLACK 

Definition at line 312 of file kfbxtexture.h.

Texture mapping types.

  • eNULL
  • ePLANAR
  • eSPHERICAL
  • eCYLINDRICAL
  • eBOX
  • eFACE
  • eUV
  • eENVIRONMENT
Enumerator:
eNULL 
ePLANAR 
eSPHERICAL 
eCYLINDRICAL 
eBOX 
eFACE 
eUV 
eENVIRONMENT 

Definition at line 370 of file kfbxtexture.h.

Planar mapping normal orientations.

  • ePLANAR_NORMAL_X
  • ePLANAR_NORMAL_Y
  • ePLANAR_NORMAL_Z
Enumerator:
ePLANAR_NORMAL_X 
ePLANAR_NORMAL_Y 
ePLANAR_NORMAL_Z 

Definition at line 397 of file kfbxtexture.h.

Material uses.

  • eMODEL_MATERIAL
  • eDEFAULT_MATERIAL
Enumerator:
eMODEL_MATERIAL 
eDEFAULT_MATERIAL 

Definition at line 418 of file kfbxtexture.h.

Texture uses.

  • eSTANDARD
  • eSHADOW_MAP
  • eLIGHT_MAP
  • eSPHERICAL_REFLEXION_MAP
  • eSPHERE_REFLEXION_MAP
  • eBUMP_NORMAL_MAP
Enumerator:
eSTANDARD 
eSHADOW_MAP 
eLIGHT_MAP 
eSPHERICAL_REFLEXION_MAP 
eSPHERE_REFLEXION_MAP 
eBUMP_NORMAL_MAP 

Definition at line 442 of file kfbxtexture.h.


Member Function Documentation

void Reset (  ) 

Resets the default texture values.

Remarks:
The texture file name is not reset.

bool SetFileName ( char const *  pName  ) 

Sets the associated texture file.

Parameters:
pName  The absolute path of the texture file.
Returns:
True if successful, returns false otherwise.
Remarks:
The texture file name must be valid, you cannot leave the name empty.

bool SetRelativeFileName ( char const *  pName  ) 

Sets the associated texture file.

Parameters:
pName  The relative path of the texture file.
Returns:
True if successful, returns false otherwise.
Remarks:
The texture file name must be valid.

char const* GetFileName (  )  const

Returns the absolute texture file path.

Returns:
The absolute texture file path.
Remarks:
An empty string is returned if KFbxTexture::SetFileName() has not been called before.

char const* GetRelativeFileName (  )  const

Returns the relative texture file path.

Returns:
The relative texture file path.
Remarks:
An empty string is returned if KFbxTexture::SetRelativeFileName() has not been called before.

void SetSwapUV ( bool  pSwapUV  ) 

Sets the swap UV flag.

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

bool GetSwapUV (  )  const

Returns the swap UV flag.

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

void SetAlphaSource ( EAlphaSource  pAlphaSource  ) 

Sets the alpha source.

Parameters:
pAlphaSource  The alpha source identifier.

EAlphaSource GetAlphaSource (  )  const

Returns the alpha source.

Returns:
The alpha source identifier for this texture.

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

Sets 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. The caller must verify that the rectangle is meaningful for this texture.

int GetCroppingLeft (  )  const

Returns left cropping.

Returns:
The left side of the cropping rectangle.

int GetCroppingTop (  )  const

Returns top cropping.

Returns:
The top side of the cropping rectangle.

int GetCroppingRight (  )  const

Returns right cropping.

Returns:
The right side of the cropping rectangle.

int GetCroppingBottom (  )  const

Returns bottom cropping.

Returns:
The bottom side of the cropping rectangle.

void SetMappingType ( EMappingType  pMappingType  ) 

Sets the mapping type.

Parameters:
pMappingType  The mapping type identifier.

EMappingType GetMappingType (  )  const

Returns the mapping type.

Returns:
The mapping type identifier.

void SetPlanarMappingNormal ( EPlanarMappingNormal  pPlanarMappingNormal  ) 

Sets the normal orientations for planar mapping.

Parameters:
pPlanarMappingNormal  The identifier for planar mapping normal orientation.

EPlanarMappingNormal GetPlanarMappingNormal (  )  const

Returns the normal orientations for planar mapping.

Returns:
The identifier for planar mapping normal orientation.

void SetMaterialUse ( EMaterialUse  pMaterialUse  ) 

Sets the material use.

Parameters:
pMaterialUse  THe material use identifier.

EMaterialUse GetMaterialUse (  )  const

Returns the material use.

Returns:
The material use identifier.

void SetTextureUse ( ETextureUse  pTextureUse  ) 

Sets the texture use.

Parameters:
pTextureUse  The texture use identifier.

ETextureUse GetTextureUse (  )  const

Returns the texture use.

Returns:
The texture use identifier.

void SetWrapMode ( EWrapMode  pWrapU,
EWrapMode  pWrapV  
)

Sets the U and V wrap mode.

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

EWrapMode GetWrapModeU (  )  const

Returns the U wrap mode.

Returns:
U wrap mode identifier.

EWrapMode GetWrapModeV (  )  const

Returns the V wrap mode.

Returns:
V wrap mode identifier.

void SetBlendMode ( EBlendMode  pBlendMode  ) 

Sets the blend mode.

Parameters:
pBlendMode  Blend mode identifier.

EBlendMode GetBlendMode (  )  const

Returns the blend mode.

Returns:
Blend mode identifier.

void SetDefaultT ( const KFbxVector4 pT  )  [inline]

Sets the default translation vector.

Parameters:
pT  The first element is the U translation applied to the texture. A displacement of one unit is equal to the texture width after the U scaling is applied. The second element is the V translation applied to the texture. A displacement of one unit is equal to the texture height after the V scaling is applied. The third and fourth elements have no effect on texture translation.

Definition at line 507 of file kfbxtexture.h.

KFbxVector4& GetDefaultT ( KFbxVector4 pT  )  const

Returns the default translation vector.

Parameters:
pT  The first element is the U translation applied to the texture. A displacement of one unit is equal to the texture width after the U scaling is applied. The second element is the V translation applied to the texture. A displacement of one unit is equal to the texture height after the V scaling is applied. The third and fourth elements have no effect on texture translation.
Returns:
The input parameter completed with appropriate data.

void SetDefaultR ( const KFbxVector4 pR  )  [inline]

Sets the default rotation vector.

Parameters:
pR  The first element is the texture rotation around the U axis in degrees. The second element is the texture rotation around the V axis in degrees. The third element is the texture rotation around the W axis in degrees.
Remarks:
The W axis is oriented toward the result of the vector product of the U and V axes that is W = U x V.

Definition at line 529 of file kfbxtexture.h.

KFbxVector4& GetDefaultR ( KFbxVector4 pR  )  const

Returns the 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  )  [inline]

Sets the default scale vector.

Parameters:
pS  The first element is scale applied to the texture width. The second element is scale applied to the texture height. The third and fourth elements have no effect on the texture.
Remarks:
A scale value less than 1 stretches the texture. A scale value greater than 1 compresses the texture.

Definition at line 549 of file kfbxtexture.h.

KFbxVector4& GetDefaultS ( KFbxVector4 pS  )  const

Returns the default scale vector.

Parameters:
pS  The first element is scale applied to the texture width. The second element is scale applied to the texture height. The third and fourth elements have no effect on the texture.
Remarks:
A scale value less than 1 stretches the texture. A scale value greater than 1 compresses the texture.

void SetDefaultAlpha ( double  pAlpha  ) 

Sets the default alpha.

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

double GetDefaultAlpha (  )  const

Returns the default alpha.

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

void SetTranslation ( double  pU,
double  pV  
)

Sets translation.

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

double GetTranslationU (  )  const

Returns translation applied to the texture width.

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

double GetTranslationV (  )  const

Returns translation applied to the texture height.

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

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

Sets 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 toward the result of the vector product of the U and V axes that is W = U x V.

double GetRotationU (  )  const

Returns the texture rotation around the U axis in degrees.

double GetRotationV (  )  const

Returns the texture rotation around the V axis in degrees.

double GetRotationW (  )  const

Returns the texture rotation around the W axis in degrees.

void SetScale ( double  pU,
double  pV  
)

Sets scale.

Parameters:
pU  Scale applied to the texture width.
pV  Scale applied to the texture height.
Remarks:
A scale value less than 1 stretches the texture. A scale value greater than 1 compresses the texture.

double GetScaleU (  )  const

Returns scale applied to the texture width.

Remarks:
A scale value less than 1 stretches the texture. A scale value greater than 1 compresses the texture.

double GetScaleV (  )  const

Returns scale applied to the texture height.

Remarks:
A scale value less than 1 stretches the texture. A scale value greater than 1 compresses the texture.

Member Data Documentation

This property handles the use of textures.

Default value is eTEXTURE_USE_6_STANDARD.

Definition at line 181 of file kfbxtexture.h.

This property handles the default alpha value for textures.

Default value is 1.0

Definition at line 186 of file kfbxtexture.h.

This property handles the texture mapping types.

Default value is eUMT_UV.

Definition at line 194 of file kfbxtexture.h.

This property handles the texture wrap modes in U.

Default value is eREPEAT.

Definition at line 199 of file kfbxtexture.h.

This property handles the texture wrap modes in V.

Default value is eREPEAT.

Definition at line 204 of file kfbxtexture.h.

This property handles the swap UV flag.

If swap UV flag is enabled, the texture's width and height are swapped. Default value is false.

Definition at line 210 of file kfbxtexture.h.

This property handles the default translation vector.

Default value is fbxDouble3(0.0,0.0,0.0).

Definition at line 217 of file kfbxtexture.h.

This property handles the default rotation vector.

Default value is fbxDouble3(0.0,0.0,0.0).

Definition at line 222 of file kfbxtexture.h.

This property handles the default scale vector.

Default value is fbxDouble3(1.0,1.0,1.0).

Definition at line 227 of file kfbxtexture.h.

This property handles the rotation pivot vector.

Default value is fbxDouble3(0.0,0.0,0.0).

Definition at line 232 of file kfbxtexture.h.

This property handles the scaling pivot vector.

Default value is fbxDouble3(0.0,0.0,0.0).

Definition at line 237 of file kfbxtexture.h.

This property handles the material use.

Default value is false.

Definition at line 244 of file kfbxtexture.h.

This property handles the Mipmap use.

Default value is false.

Definition at line 249 of file kfbxtexture.h.

This property handles the texture blend mode.

Default value is eADDITIVE.

Definition at line 255 of file kfbxtexture.h.

This property handles the use of UV sets.

Default value is default.

Definition at line 261 of file kfbxtexture.h.

KFbxTexture KFbxTexture KFbxTexture KFbxTexture KFbxTexture KFbxTexture KFbxTexture KFbxTexture KFbxTexture KFbxTexture
KFbxTexture KFbxTexture KFbxTexture KFbxTexture KFbxTexture KFbxTexture KFbxTexture KFbxTexture KFbxTexture KFbxTexture