From 0ea5fc66924303d1bf73ba283a383e2aadee02f2 Mon Sep 17 00:00:00 2001 From: neodarz Date: Sat, 11 Aug 2018 20:21:34 +0200 Subject: Initial commit --- docs/doxygen/nel/a02198.html | 1895 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 1895 insertions(+) create mode 100644 docs/doxygen/nel/a02198.html (limited to 'docs/doxygen/nel/a02198.html') diff --git a/docs/doxygen/nel/a02198.html b/docs/doxygen/nel/a02198.html new file mode 100644 index 00000000..506fdb9e --- /dev/null +++ b/docs/doxygen/nel/a02198.html @@ -0,0 +1,1895 @@ + + +NeL: NL3D::CAnimatedMaterial class Reference + + + +
+

NL3D::CAnimatedMaterial Class Reference

#include <animated_material.h> +

+

Inheritance diagram for NL3D::CAnimatedMaterial: +

+ +NL3D::IAnimatable + +

Detailed Description

+An animated material Instance of CMaterialBase NB: formated for 3ds Max :). Emissive anim is a float, with a constant RGB factor. Texture animation: see update().
Author:
Cyril 'Hulud' Corvazier

+Nevrax France

+
Date:
2001
+ +

+ +

+Definition at line 159 of file animated_material.h. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Herited from IAnimatable

enum  TAnimValues {
+  OwnerBit = IAnimatable::AnimValueLast, +AmbientValue, +DiffuseValue, +SpecularValue, +
+  ShininessValue, +EmissiveValue, +OpacityValue, +TextureValue, +
+  TextureMatValues, +AnimValueLast = TextureMatValues + NumTexAnimatedValues * IDRV_MAT_MAXTEXTURES +
+ }
 Added values. More...

virtual ITrackgetDefaultTrack (uint valueId)
 From IAnimatable.

virtual IAnimatedValuegetValue (uint valueId)
 From IAnimatable.

virtual const char * getValueName (uint valueId) const
 From IAnimatable.

virtual void registerToChannelMixer (CChannelMixer *chanMixer, const std::string &prefix)
 From IAnimatable.


Public Types

enum  { NumTexAnimatedValues = CMaterialBase::CTexAnimTracks::NumTexAnimatedValues + }
 number of animated values for each animated texture, taken from CMaterialBase More...


Public Member Functions

void update ()
ctor / setup.
 CAnimatedMaterial (CMaterialBase *baseMat)
std::string getMaterialName () const
void setMaterial (CMaterial *pMat)

Static Public Member Functions

Get some track name
const char * getAmbientValueName ()
const char * getDiffuseValueName ()
const char * getEmissiveValueName ()
const char * getOpacityValueName ()
const char * getShininessValueName ()
const char * getSpecularValueName ()
const char * getTexMatUScaleName (uint stage)
const char * getTexMatUTransName (uint stage)
const char * getTexMatVScaleName (uint stage)
const char * getTexMatVTransName (uint stage)
const char * getTexMatWRotName (uint stage)
const char * getTextureValueName ()

Protected Member Functions

sint addValue (CChannelMixer *chanMixer, uint valueId, uint ownerValueId, const std::string &prefix, bool detail)
void clearFlag (uint valueId)
 This method clear a bit in the bitset.

void setFlag (uint valueId)
 This method set a bit in the bitset.


Private Attributes

CAnimatedValueRGBA _Ambient
CAnimatedValueRGBA _Diffuse
CAnimatedValueRGBA _Emissive
CRefPtr< CMaterial_Material
CRefPtr< CMaterialBase_MaterialBase
CAnimatedValueFloat _Opacity
CAnimatedValueFloat _Shininess
CAnimatedValueRGBA _Specular
CTexAnimatedMatValues _TexAnimatedMatValues [IDRV_MAT_MAXTEXTURES]
CAnimatedValueInt _Texture
+


Member Enumeration Documentation

+

+ + + + +
+ + +
anonymous enum +
+
+ + + + + +
+   + + +

+number of animated values for each animated texture, taken from CMaterialBase +

+

Enumeration values:
+ + +
NumTexAnimatedValues  +
+
+ +

+Definition at line 212 of file animated_material.h. +

+

00212 { NumTexAnimatedValues = CMaterialBase::CTexAnimTracks::NumTexAnimatedValues   };
+
+

+ + + + +
+ + +
enum NL3D::CAnimatedMaterial::TAnimValues +
+
+ + + + + +
+   + + +

+Added values. +

+

Enumeration values:
+ + + + + + + + + + + +
OwnerBit  +
AmbientValue  +
DiffuseValue  +
SpecularValue  +
ShininessValue  +
EmissiveValue  +
OpacityValue  +
TextureValue  +
TextureMatValues  +
AnimValueLast  +
+
+ +

+Reimplemented from NL3D::IAnimatable. +

+Definition at line 217 of file animated_material.h. +

+

00218         {
+00219                 OwnerBit= IAnimatable::AnimValueLast,
+00220                 AmbientValue, 
+00221                 DiffuseValue,
+00222                 SpecularValue,
+00223                 ShininessValue,
+00224                 EmissiveValue,
+00225                 OpacityValue,
+00226                 TextureValue,
+00227                 TextureMatValues,
+00228                 AnimValueLast = TextureMatValues + NumTexAnimatedValues * IDRV_MAT_MAXTEXTURES /* texture matrix anim */
+00229         };
+
+


Constructor & Destructor Documentation

+

+ + + + +
+ + + + + + + + + + +
NL3D::CAnimatedMaterial::CAnimatedMaterial CMaterialBase baseMat  ) 
+
+ + + + + +
+   + + +

+Constructor. This ctor:

    +
  • store a RefPtr on the BaseMaterial (for getDefaultTracks() method).
  • copy the material default track value into Animated Values.
+ +

+Definition at line 159 of file animated_material.cpp. +

+References _Ambient, _Diffuse, _Emissive, _MaterialBase, _Opacity, _Shininess, _Specular, _TexAnimatedMatValues, NL3D::CAnimatedMaterial::CTexAnimatedMatValues::affect(), NL3D::CAnimatedValueBlendable< float >::affect(), NL3D::CAnimatedValueBlendable< T >::affect(), NL3D::IDRV_MAT_MAXTEXTURES, nlassert, and uint. +

+

00160 {
+00161         nlassert(baseMat);
+00162         _MaterialBase= baseMat;
+00163 
+00164         // IAnimatable.
+00165         IAnimatable::resize(AnimValueLast);
+00166 
+00167         _Ambient.affect(_MaterialBase->DefaultAmbient.getValue());
+00168         _Diffuse.affect(_MaterialBase->DefaultDiffuse.getValue());
+00169         _Specular.affect(_MaterialBase->DefaultSpecular.getValue());
+00170         _Shininess.affect(_MaterialBase->DefaultShininess.getValue());
+00171         _Emissive.affect(_MaterialBase->DefaultEmissive.getValue());
+00172         _Opacity.affect(_MaterialBase->DefaultOpacity.getValue());
+00173 
+00174         for (uint k = 0; k < IDRV_MAT_MAXTEXTURES; ++k)
+00175         {
+00176                 _TexAnimatedMatValues[k].affect(baseMat->DefaultTexAnimTracks[k]);
+00177         }
+00178 }
+
+


Member Function Documentation

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
sint NL3D::IAnimatable::addValue CChannelMixer chanMixer,
uint  valueId,
uint  ownerValueId,
const std::string &  prefix,
bool  detail
[protected, inherited]
+
+ + + + + +
+   + + +

+This is a tool function which add a given value to a channel.

Returns:
-1 if the track was not found in the animationSet, else it return the channelId as if returned by CAnimationSet::getChannelIdByName(channelName).
+ +

+Definition at line 37 of file animatable.cpp. +

+References NL3D::CChannelMixer::addChannel(), NL3D::IAnimatable::getDefaultTrack(), NL3D::IAnimatable::getValue(), NL3D::IAnimatable::getValueName(), nlassert, sint, and uint. +

+Referenced by NL3D::CTransform::registerToChannelMixer(), NL3D::CParticleSystemModel::registerToChannelMixer(), NL3D::CCamera::registerToChannelMixer(), NL3D::CBone::registerToChannelMixer(), NL3D::CAnimatedMorph::registerToChannelMixer(), registerToChannelMixer(), and NL3D::CAnimatedLightmap::registerToChannelMixer(). +

+

00038 {
+00039         nlassert(chanMixer);
+00040         return chanMixer->addChannel(prefix+getValueName(valueId), this, getValue(valueId), getDefaultTrack(valueId), valueId, ownerValueId, detail);
+00041 }
+
+

+ + + + +
+ + + + + + + + + + +
void NL3D::IAnimatable::clearFlag uint  valueId  )  [inline, protected, inherited]
+
+ + + + + +
+   + + +

+This method clear a bit in the bitset. +

+ +

+Definition at line 233 of file animatable.h. +

+References NL3D::IAnimatable::_BitSet, and uint. +

+Referenced by NL3D::ITransformable::clearTransformFlags(), NL3D::CParticleSystemModel::doAnimate(), and update(). +

+

00234         {
+00235                 _BitSet&= ~(1<<valueId);
+00236         }
+
+

+ + + + +
+ + + + + + + + + +
const char* NL3D::CAnimatedMaterial::getAmbientValueName  )  [inline, static]
+
+ + + + + +
+   + + +

+ +

+Definition at line 195 of file animated_material.h. +

+Referenced by getValueName(). +

+

00195 {return "ambient";}
+
+

+ + + + +
+ + + + + + + + + + +
ITrack * NL3D::CAnimatedMaterial::getDefaultTrack uint  valueId  )  [virtual]
+
+ + + + + +
+   + + +

+From IAnimatable. +

+ +

+Implements NL3D::IAnimatable. +

+Definition at line 340 of file animated_material.cpp. +

+References _MaterialBase, AmbientValue, DiffuseValue, EmissiveValue, nlassert, nlstop, OpacityValue, ShininessValue, SpecularValue, TextureMatValues, TextureValue, and uint. +

+

00341 {
+00342         nlassert(_MaterialBase);
+00343 
+00344         switch(valueId)
+00345         {
+00346         case AmbientValue: return       &_MaterialBase->DefaultAmbient;
+00347         case DiffuseValue: return       &_MaterialBase->DefaultDiffuse;
+00348         case SpecularValue: return      &_MaterialBase->DefaultSpecular;
+00349         case ShininessValue: return     &_MaterialBase->DefaultShininess;
+00350         case EmissiveValue: return      &_MaterialBase->DefaultEmissive;
+00351         case OpacityValue: return       &_MaterialBase->DefaultOpacity;
+00352         case TextureValue: return       &_MaterialBase->DefaultTexture;
+00353         default: // this may be a texture animated value...
+00354                 if (valueId >= TextureMatValues && valueId < AnimValueLast)
+00355                 {
+00356                         const uint baseId = valueId - TextureMatValues;
+00357                         const uint texNum =   baseId / NumTexAnimatedValues;
+00358                         const uint argID  =   baseId % NumTexAnimatedValues;
+00359                         switch(argID)
+00360                         {
+00361                                 case 0: return  &_MaterialBase->DefaultTexAnimTracks[texNum].DefaultUTrans;
+00362                                 case 1: return  &_MaterialBase->DefaultTexAnimTracks[texNum].DefaultVTrans;
+00363                                 case 2: return  &_MaterialBase->DefaultTexAnimTracks[texNum].DefaultUTrans;
+00364                                 case 3: return  &_MaterialBase->DefaultTexAnimTracks[texNum].DefaultVTrans;
+00365                                 case 4: return  &_MaterialBase->DefaultTexAnimTracks[texNum].DefaultWRot;
+00366                         }
+00367                 }               
+00368         break;
+00369         };
+00370 
+00371         // shoudl not be here!!
+00372         nlstop;
+00373         return NULL;
+00374 }
+
+

+ + + + +
+ + + + + + + + + +
const char* NL3D::CAnimatedMaterial::getDiffuseValueName  )  [inline, static]
+
+ + + + + +
+   + + +

+ +

+Definition at line 196 of file animated_material.h. +

+Referenced by getValueName(). +

+

00196 {return "diffuse";}
+
+

+ + + + +
+ + + + + + + + + +
const char* NL3D::CAnimatedMaterial::getEmissiveValueName  )  [inline, static]
+
+ + + + + +
+   + + +

+ +

+Definition at line 199 of file animated_material.h. +

+Referenced by getValueName(). +

+

00199 {return "emissive";}
+
+

+ + + + +
+ + + + + + + + + +
std::string NL3D::CAnimatedMaterial::getMaterialName  )  const
+
+ + + + + +
+   + + +

+Return the name of this material (stored in CMaterialBase). +

+Definition at line 189 of file animated_material.cpp. +

+References _MaterialBase, and nlassert. +

+Referenced by NL3D::CSegRemanence::registerToChannelMixer(). +

+

00190 {
+00191         nlassert(_MaterialBase);
+00192         return _MaterialBase->Name;
+00193 }
+
+

+ + + + +
+ + + + + + + + + +
const char* NL3D::CAnimatedMaterial::getOpacityValueName  )  [inline, static]
+
+ + + + + +
+   + + +

+ +

+Definition at line 200 of file animated_material.h. +

+Referenced by getValueName(). +

+

00200 {return "opacity";}
+
+

+ + + + +
+ + + + + + + + + +
const char* NL3D::CAnimatedMaterial::getShininessValueName  )  [inline, static]
+
+ + + + + +
+   + + +

+ +

+Definition at line 198 of file animated_material.h. +

+Referenced by getValueName(). +

+

00198 {return "shininess";}
+
+

+ + + + +
+ + + + + + + + + +
const char* NL3D::CAnimatedMaterial::getSpecularValueName  )  [inline, static]
+
+ + + + + +
+   + + +

+ +

+Definition at line 197 of file animated_material.h. +

+Referenced by getValueName(). +

+

00197 {return "specular";}
+
+

+ + + + +
+ + + + + + + + + + +
const char * NL3D::CAnimatedMaterial::getTexMatUScaleName uint  stage  )  [static]
+
+ + + + + +
+   + + +

+ +

+Definition at line 432 of file animated_material.cpp. +

+References NL3D::IDRV_MAT_MAXTEXTURES, nlassert, and uint. +

+Referenced by getValueName(). +

+

00433 {
+00434         static char names[IDRV_MAT_MAXTEXTURES][16];
+00435         static bool init = false;
+00436         nlassert(stage < IDRV_MAT_MAXTEXTURES);
+00437         if (!init) // where name initialized ?
+00438         {
+00439                 for (uint k = 0; k < IDRV_MAT_MAXTEXTURES; ++k)
+00440                 {
+00441                         sprintf(&names[k][0], "UScale%d", k);
+00442                 }
+00443                 init = true;
+00444         }
+00445         return names[stage];
+00446 }
+
+

+ + + + +
+ + + + + + + + + + +
const char * NL3D::CAnimatedMaterial::getTexMatUTransName uint  stage  )  [static]
+
+ + + + + +
+   + + +

+ +

+Definition at line 396 of file animated_material.cpp. +

+References NL3D::IDRV_MAT_MAXTEXTURES, nlassert, and uint. +

+Referenced by getValueName(). +

+

00397 {
+00398         static char names[IDRV_MAT_MAXTEXTURES][16];
+00399         static bool init = false;
+00400         nlassert(stage < IDRV_MAT_MAXTEXTURES);
+00401         if (!init) // where name initialized ?
+00402         {
+00403                 for (uint k = 0; k < IDRV_MAT_MAXTEXTURES; ++k)
+00404                 {
+00405                         sprintf(&names[k][0], "UTrans%d", k);
+00406                 }
+00407                 init = true;
+00408         }
+00409         return names[stage];
+00410 }
+
+

+ + + + +
+ + + + + + + + + + +
const char * NL3D::CAnimatedMaterial::getTexMatVScaleName uint  stage  )  [static]
+
+ + + + + +
+   + + +

+ +

+Definition at line 449 of file animated_material.cpp. +

+References NL3D::IDRV_MAT_MAXTEXTURES, nlassert, and uint. +

+Referenced by getValueName(). +

+

00450 {
+00451         nlassert(stage < IDRV_MAT_MAXTEXTURES);
+00452         static char names[IDRV_MAT_MAXTEXTURES][16];
+00453         static bool init = false;
+00454         nlassert(stage < IDRV_MAT_MAXTEXTURES);
+00455         if (!init) // where name initialized ?
+00456         {
+00457                 for (uint k = 0; k < IDRV_MAT_MAXTEXTURES; ++k)
+00458                 {
+00459                         sprintf(&names[k][0], "VScale%d", k);
+00460                 }
+00461                 init = true;
+00462         }
+00463         return names[stage];
+00464 }
+
+

+ + + + +
+ + + + + + + + + + +
const char * NL3D::CAnimatedMaterial::getTexMatVTransName uint  stage  )  [static]
+
+ + + + + +
+   + + +

+ +

+Definition at line 413 of file animated_material.cpp. +

+References NL3D::IDRV_MAT_MAXTEXTURES, nlassert, and uint. +

+Referenced by getValueName(). +

+

00414 {
+00415         nlassert(stage < IDRV_MAT_MAXTEXTURES);
+00416         static char names[IDRV_MAT_MAXTEXTURES][16];
+00417         static bool init = false;
+00418         nlassert(stage < IDRV_MAT_MAXTEXTURES);
+00419         if (!init) // where name initialized ?
+00420         {
+00421                 for (uint k = 0; k < IDRV_MAT_MAXTEXTURES; ++k)
+00422                 {
+00423                         sprintf(&names[k][0], "VTrans%d", k);
+00424                 }
+00425                 init = true;
+00426         }
+00427         return names[stage];
+00428 }
+
+

+ + + + +
+ + + + + + + + + + +
const char * NL3D::CAnimatedMaterial::getTexMatWRotName uint  stage  )  [static]
+
+ + + + + +
+   + + +

+ +

+Definition at line 468 of file animated_material.cpp. +

+References NL3D::IDRV_MAT_MAXTEXTURES, nlassert, and uint. +

+Referenced by getValueName(). +

+

00469 {
+00470         nlassert(stage < IDRV_MAT_MAXTEXTURES);
+00471         static char names[IDRV_MAT_MAXTEXTURES][16];
+00472         static bool init = false;
+00473         nlassert(stage < IDRV_MAT_MAXTEXTURES);
+00474         if (!init) // where name initialized ?
+00475         {
+00476                 for (uint k = 0; k < IDRV_MAT_MAXTEXTURES; ++k)
+00477                 {
+00478                         sprintf(&names[k][0], "WRot%d", k);
+00479                 }
+00480                 init = true;
+00481         }
+00482         return names[stage];
+00483 }
+
+

+ + + + +
+ + + + + + + + + +
const char* NL3D::CAnimatedMaterial::getTextureValueName  )  [inline, static]
+
+ + + + + +
+   + + +

+ +

+Definition at line 201 of file animated_material.h. +

+Referenced by getValueName(). +

+

00201 {return "texture";}
+
+

+ + + + +
+ + + + + + + + + + +
IAnimatedValue * NL3D::CAnimatedMaterial::getValue uint  valueId  )  [virtual]
+
+ + + + + +
+   + + +

+From IAnimatable. +

+ +

+Implements NL3D::IAnimatable. +

+Definition at line 272 of file animated_material.cpp. +

+References _Ambient, _Diffuse, _Emissive, _Opacity, _Shininess, _Specular, _TexAnimatedMatValues, _Texture, NL3D::CAnimatedMaterial::CTexAnimatedMatValues::_UScale, NL3D::CAnimatedMaterial::CTexAnimatedMatValues::_UTrans, NL3D::CAnimatedMaterial::CTexAnimatedMatValues::_VScale, NL3D::CAnimatedMaterial::CTexAnimatedMatValues::_VTrans, NL3D::CAnimatedMaterial::CTexAnimatedMatValues::_WRot, AmbientValue, DiffuseValue, EmissiveValue, nlstop, OpacityValue, ShininessValue, SpecularValue, TextureMatValues, TextureValue, and uint. +

+

00273 {
+00274         switch(valueId)
+00275         {
+00276         case AmbientValue: return &_Ambient;
+00277         case DiffuseValue: return &_Diffuse;
+00278         case SpecularValue: return &_Specular;
+00279         case ShininessValue: return &_Shininess;
+00280         case EmissiveValue: return &_Emissive;
+00281         case OpacityValue: return &_Opacity;
+00282         case TextureValue: return &_Texture;
+00283         default: // this may be a texture animated value...
+00284                 if (valueId >= TextureMatValues && valueId < AnimValueLast)
+00285                 {
+00286                         const uint baseId = valueId - TextureMatValues;
+00287                         const uint texNum =   baseId / NumTexAnimatedValues; // stage index
+00288                         const uint argID  =   baseId % NumTexAnimatedValues; // value for this stage
+00289                         switch(argID)
+00290                         {
+00291                                 case 0: return &_TexAnimatedMatValues[texNum]._UTrans;
+00292                                 case 1: return &_TexAnimatedMatValues[texNum]._VTrans;
+00293                                 case 2: return &_TexAnimatedMatValues[texNum]._UScale;
+00294                                 case 3: return &_TexAnimatedMatValues[texNum]._VScale;                          
+00295                                 case 4: return &_TexAnimatedMatValues[texNum]._WRot;                            
+00296                         }
+00297                 }               
+00298         break;
+00299         };
+00300 
+00301         // shoudl not be here!!
+00302         nlstop;
+00303         return NULL;
+00304 }
+
+

+ + + + +
+ + + + + + + + + + +
const char * NL3D::CAnimatedMaterial::getValueName uint  valueId  )  const [virtual]
+
+ + + + + +
+   + + +

+From IAnimatable. +

+ +

+Implements NL3D::IAnimatable. +

+Definition at line 306 of file animated_material.cpp. +

+References AmbientValue, DiffuseValue, EmissiveValue, getAmbientValueName(), getDiffuseValueName(), getEmissiveValueName(), getOpacityValueName(), getShininessValueName(), getSpecularValueName(), getTexMatUScaleName(), getTexMatUTransName(), getTexMatVScaleName(), getTexMatVTransName(), getTexMatWRotName(), getTextureValueName(), nlstop, OpacityValue, ShininessValue, SpecularValue, TextureMatValues, TextureValue, and uint. +

+

00307 {
+00308         switch(valueId)
+00309         {
+00310         case AmbientValue: return getAmbientValueName();
+00311         case DiffuseValue: return getDiffuseValueName();
+00312         case SpecularValue: return getSpecularValueName();
+00313         case ShininessValue: return getShininessValueName();
+00314         case EmissiveValue: return getEmissiveValueName();
+00315         case OpacityValue: return getOpacityValueName();
+00316         case TextureValue: return getTextureValueName();
+00317         default: // this may be a texture animated value...
+00318                 if (valueId >= TextureMatValues && valueId < AnimValueLast)
+00319                 {
+00320                         const uint baseId = valueId - TextureMatValues;
+00321                         const uint texNum =   baseId / NumTexAnimatedValues;
+00322                         const uint argID  =   baseId % NumTexAnimatedValues;
+00323                         switch(argID)
+00324                         {
+00325                                 case 0: return getTexMatUTransName      (texNum);
+00326                                 case 1: return getTexMatVTransName(texNum);
+00327                                 case 2: return getTexMatUScaleName(texNum);
+00328                                 case 3: return getTexMatVScaleName(texNum);
+00329                                 case 4: return getTexMatWRotName(texNum);
+00330                         }
+00331                 }               
+00332         break;
+00333         };
+00334 
+00335         // shoudl not be here!!
+00336         nlstop;
+00337         return "";
+00338 }
+
+

+ + + + +
+ + + + + + + + + + +
uint32 NL3D::IAnimatable::isTouched uint  valueId  )  const [inline, inherited]
+
+ + + + + +
+   + + +

+Return non 0 int if the value as been touched else 0.

+

Parameters:
+ + +
valueId is the animated value ID in the object we want to test the touch flag. or it may be an OwnerBit.
+
+ +

+Definition at line 184 of file animatable.h. +

+References NL3D::IAnimatable::_BitSet, uint, and uint32. +

+Referenced by NL3D::CParticleSystemModel::doAnimate(), NL3D::ITransformable::needCompute(), NL3D::IAnimatable::propagateTouch(), and update(). +

+

00185         {
+00186                 return _BitSet&(1<<valueId);
+00187         }
+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
void NL3D::CAnimatedMaterial::registerToChannelMixer CChannelMixer chanMixer,
const std::string &  prefix
[virtual]
+
+ + + + + +
+   + + +

+From IAnimatable. +

+ +

+Implements NL3D::IAnimatable. +

+Definition at line 376 of file animated_material.cpp. +

+References NL3D::IAnimatable::addValue(), AmbientValue, DiffuseValue, EmissiveValue, NL3D::IDRV_MAT_MAXTEXTURES, OpacityValue, ShininessValue, SpecularValue, TextureMatValues, TextureValue, and uint. +

+Referenced by NL3D::CSegRemanence::registerToChannelMixer(). +

+

00377 {
+00378         // For CAnimatedMaterial, channels are detailled (material rendered after clip)!
+00379         addValue(chanMixer, AmbientValue, OwnerBit, prefix, true);
+00380         addValue(chanMixer, DiffuseValue, OwnerBit, prefix, true);
+00381         addValue(chanMixer, SpecularValue, OwnerBit, prefix, true);
+00382         addValue(chanMixer, ShininessValue, OwnerBit, prefix, true);
+00383         addValue(chanMixer, EmissiveValue, OwnerBit, prefix, true);
+00384         addValue(chanMixer, OpacityValue, OwnerBit, prefix, true);
+00385         addValue(chanMixer, TextureValue, OwnerBit, prefix, true);
+00386         for (uint k = 0; k < IDRV_MAT_MAXTEXTURES; ++k)
+00387         {
+00388                 for (uint l = 0; l < NumTexAnimatedValues; ++l)
+00389                 {
+00390                         addValue(chanMixer, TextureMatValues + l + k * NumTexAnimatedValues, OwnerBit, prefix, true);
+00391                 }
+00392         }
+00393 }
+
+

+ + + + +
+ + + + + + + + + + +
void NL3D::IAnimatable::resize uint  count  )  [inline, inherited]
+
+ + + + + +
+   + + +

+Change value count, bit are set to 0

+

Parameters:
+ + +
count is the new value count.
+
+ +

+Definition at line 195 of file animatable.h. +

+References count, nlassert, and uint. +

+

00196         {
+00197                 // with the "uint32 _BitSet" implementation, juste check the size is correct
+00198                 nlassert(count<=32);
+00199         }
+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
void NL3D::IAnimatable::setFather IAnimatable father,
uint  fatherOwnerBit
[inline, inherited]
+
+ + + + + +
+   + + +

+Say which (if any) IAnimatable owns this one. This is important for Touch propagation. By this system, Fathers and ancestors know if they must check their sons (isTouched() return true).

+

Parameters:
+ + + +
father the father we must inform of our update.
fatherOwnerBit What bit of father we must set when we are updated
+
+ +

+Definition at line 153 of file animatable.h. +

+References NL3D::IAnimatable::_Father, NL3D::IAnimatable::_FatherOwnerBit, NL3D::IAnimatable::propagateTouch(), and uint. +

+Referenced by NL3D::CMeshBase::instanciateMeshBase(), and NL3D::CSegRemanence::setAnimatedMaterial(). +

+

00154         {
+00155                 _Father= father; _FatherOwnerBit= fatherOwnerBit;
+00156 
+00157                 // propagate the touch to the fathers.
+00158                 propagateTouch();
+00159         }
+
+

+ + + + +
+ + + + + + + + + + +
void NL3D::IAnimatable::setFlag uint  valueId  )  [inline, protected, inherited]
+
+ + + + + +
+   + + +

+This method set a bit in the bitset. +

+ +

+Definition at line 239 of file animatable.h. +

+References NL3D::IAnimatable::_BitSet, and uint. +

+Referenced by NL3D::IAnimatable::propagateTouch(), and NL3D::IAnimatable::touch(). +

+

00240         {
+00241                 _BitSet|= (1<<valueId);
+00242         }
+
+

+ + + + +
+ + + + + + + + + + +
void NL3D::CAnimatedMaterial::setMaterial CMaterial pMat  ) 
+
+ + + + + +
+   + + +

+setup the material context for this animated material. This method:

    +
  • store a RefPtr on the material, for future anim update.
+ +

+Definition at line 182 of file animated_material.cpp. +

+References _Material. +

+Referenced by NL3D::CSegRemanenceShape::createInstance(), and NL3D::CMeshBase::instanciateMeshBase(). +

+

00183 {
+00184         _Material= pMat;
+00185 }
+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
void NL3D::IAnimatable::touch uint  valueId,
uint  ownerValueId
[inline, inherited]
+
+ + + + + +
+   + + +

+Touch a value because it has been modified.

+

Parameters:
+ + + +
valueId is the animated value ID in the object we want to touch.
ownerValueId is the bit of the IAnimatable part which owns this animated value.
+
+ +

+Definition at line 168 of file animatable.h. +

+References NL3D::IAnimatable::propagateTouch(), NL3D::IAnimatable::setFlag(), and uint. +

+Referenced by NL3D::CChannelMixer::eval(), NL3D::CChannelMixer::evalSingleChannel(), NL3D::CParticleSystemModel::reallocRsc(), NL3D::CChannelMixer::refreshList(), NL3D::CCamera::setFov(), NL3D::ITransformable::setPivot(), NL3D::ITransformable::setPos(), NL3D::CCamera::setRoll(), NL3D::ITransformable::setRotEuler(), NL3D::ITransformable::setRotQuat(), NL3D::ITransformable::setScale(), NL3D::CCamera::setTargetPos(), NL3D::ITransformable::setTransformMode(), and NL3D::CParticleSystemInstanceUser::setUserParam(). +

+

00169         {
+00170                 // Set the bit
+00171                 setFlag(valueId);
+00172                 // Set the owner bit
+00173                 setFlag(ownerValueId);
+00174 
+00175                 // propagate the touch to the fathers.
+00176                 propagateTouch();
+00177         }
+
+

+ + + + +
+ + + + + + + + + +
void NL3D::CAnimatedMaterial::update  ) 
+
+ + + + + +
+   + + +

+Check if The animated material is touched, and if necessary update the stored material (if any). Texture animation: for now, texture animation is possible only on stage 0. If TextureValue flag is touched (ie a texture anim track is linked to the animated value), update() look into the CMaterialBase what texture to set. If the track gives a bad Id for the texture, no-op. +

+Definition at line 197 of file animated_material.cpp. +

+References _Ambient, _Diffuse, _Emissive, _Material, _MaterialBase, _Opacity, _Shininess, _Specular, _TexAnimatedMatValues, _Texture, NL3D::CAnimatedMaterial::CTexAnimatedMatValues::_UScale, NL3D::CAnimatedMaterial::CTexAnimatedMatValues::_UTrans, NL3D::CAnimatedMaterial::CTexAnimatedMatValues::_VScale, NL3D::CAnimatedMaterial::CTexAnimatedMatValues::_VTrans, NL3D::CAnimatedMaterial::CTexAnimatedMatValues::_WRot, NLMISC::CRGBA::A, AmbientValue, NLMISC::clamp(), NL3D::IAnimatable::clearFlag(), DiffuseValue, EmissiveValue, NL3D::IDRV_MAT_MAXTEXTURES, NL3D::IAnimatable::isTouched(), NLMISC::CMatrix::mulVector(), nlassert, OpacityValue, NLMISC::CMatrix::setPos(), NLMISC::CMatrix::setRot(), ShininessValue, sint, SpecularValue, TextureMatValues, TextureValue, uint, uint32, NL3D::CAnimatedValueBlendable< sint32 >::Value, NL3D::CAnimatedValueBlendable< float >::Value, and NL3D::CAnimatedValueBlendable< T >::Value. +

+Referenced by NL3D::CSegRemanence::traverseAnimDetail(). +

+

00198 {
+00199         if(isTouched(OwnerBit) && _Material!=NULL /*&& _Material->isLighted()*/)
+00200         {
+00201                 
+00202                 // well, just update all...  :)
+00203 
+00204                 // diffuse part.
+00205                 CRGBA   diff= _Diffuse.Value;
+00206                 sint c= (sint)(_Opacity.Value*255);
+00207                 clamp(c, 0, 255);
+00208                 diff.A= c;
+00209 
+00210                 // setup material.
+00211                 if (_Material->isLighted())
+00212                 {               
+00213                         _Material->setLighting(true, _Emissive.Value, _Ambient.Value, diff, _Specular.Value, _Shininess.Value);
+00214                 }
+00215                 else
+00216                 {
+00217                         _Material->setColor(diff);
+00218                 }
+00219 
+00220                 // clear flags.
+00221                 clearFlag(AmbientValue);
+00222                 clearFlag(DiffuseValue);
+00223                 clearFlag(SpecularValue);
+00224                 clearFlag(ShininessValue);
+00225                 clearFlag(EmissiveValue);
+00226                 clearFlag(OpacityValue);
+00227 
+00228 
+00229                 // Texture Anim.
+00230                 if(isTouched(TextureValue))
+00231                 {
+00232                         nlassert(_MaterialBase);
+00233 
+00234                         uint32  id= _Texture.Value;
+00235                         if(_MaterialBase->validAnimatedTexture(id))
+00236                         {
+00237                                 _Material->setTexture(0, _MaterialBase->getAnimatedTexture(id) );
+00238                         }
+00239                         clearFlag(TextureValue);
+00240                 }
+00241 
+00242                 // Get texture matrix from animated value to setup the material
+00243                 uint flagIndex = TextureMatValues;
+00244                 for (uint k = 0; k < IDRV_MAT_MAXTEXTURES; ++k)
+00245                 {
+00246                         if (_Material->isUserTexMatEnabled(k))
+00247                         {
+00248                                 const CTexAnimatedMatValues &texMatAV = _TexAnimatedMatValues[k];
+00249                 
+00250                                 CMatrix convMat; // exported v are already inverted (todo : optim this if needed, this matrix shouldn't be necessary)
+00251                                 convMat.setRot(CVector::I, -CVector::J, CVector::K);
+00252                                 convMat.setPos(CVector::J);
+00253                                 float fCos = cosf(texMatAV._WRot.Value);
+00254                                 float fSin = sinf(texMatAV._WRot.Value);
+00255                                 CMatrix SR;
+00256                                 SR.setRot(CVector(texMatAV._UScale.Value * fCos, texMatAV._VScale.Value * fSin, 0.f),
+00257                                                   CVector(- texMatAV._UScale.Value * fSin, texMatAV._VScale.Value * fCos, 0.f),
+00258                                                   CVector::K);
+00259                                 CVector half(0.5f, 0.5f, 0.f);
+00260                                 SR.setPos(SR.mulVector(- half - CVector(texMatAV._UTrans.Value, texMatAV._VTrans.Value, 0.f)) + half);
+00261                                 _Material->setUserTexMat(k, convMat * SR * convMat);
+00262                         }
+00263                 }
+00264 
+00265                 // We are OK!
+00266                 IAnimatable::clearFlag(OwnerBit);
+00267         }
+00268 }
+
+


Field Documentation

+

+ + + + +
+ + +
CAnimatedValueRGBA NL3D::CAnimatedMaterial::_Ambient [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 255 of file animated_material.h. +

+Referenced by CAnimatedMaterial(), getValue(), and update().

+

+ + + + +
+ + +
CAnimatedValueRGBA NL3D::CAnimatedMaterial::_Diffuse [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 256 of file animated_material.h. +

+Referenced by CAnimatedMaterial(), getValue(), and update().

+

+ + + + +
+ + +
CAnimatedValueRGBA NL3D::CAnimatedMaterial::_Emissive [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 259 of file animated_material.h. +

+Referenced by CAnimatedMaterial(), getValue(), and update().

+

+ + + + +
+ + +
CRefPtr<CMaterial> NL3D::CAnimatedMaterial::_Material [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 252 of file animated_material.h. +

+Referenced by setMaterial(), and update().

+

+ + + + +
+ + +
CRefPtr<CMaterialBase> NL3D::CAnimatedMaterial::_MaterialBase [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 250 of file animated_material.h. +

+Referenced by CAnimatedMaterial(), getDefaultTrack(), getMaterialName(), and update().

+

+ + + + +
+ + +
CAnimatedValueFloat NL3D::CAnimatedMaterial::_Opacity [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 260 of file animated_material.h. +

+Referenced by CAnimatedMaterial(), getValue(), and update().

+

+ + + + +
+ + +
CAnimatedValueFloat NL3D::CAnimatedMaterial::_Shininess [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 258 of file animated_material.h. +

+Referenced by CAnimatedMaterial(), getValue(), and update().

+

+ + + + +
+ + +
CAnimatedValueRGBA NL3D::CAnimatedMaterial::_Specular [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 257 of file animated_material.h. +

+Referenced by CAnimatedMaterial(), getValue(), and update().

+

+ + + + +
+ + +
CTexAnimatedMatValues NL3D::CAnimatedMaterial::_TexAnimatedMatValues[IDRV_MAT_MAXTEXTURES] [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 281 of file animated_material.h. +

+Referenced by CAnimatedMaterial(), getValue(), and update().

+

+ + + + +
+ + +
CAnimatedValueInt NL3D::CAnimatedMaterial::_Texture [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 261 of file animated_material.h. +

+Referenced by getValue(), and update().

+


The documentation for this class was generated from the following files: +
Generated on Tue Mar 16 06:44:22 2004 for NeL by + +doxygen +1.3.6
+ + -- cgit v1.2.1