Material Class Reference

#include <materialDefinition.h>

Inheritance diagram for Material:

Inheritance graph
[legend]
List of all members.

Public Types

 MAX_TEX_PER_PASS = 8
 Number of textures per pass.
 MAX_STAGES = 4
 NUM_EFFECT_COLOR_STAGES = 2
 Number of effect color definitions for transitioning effects.
 NoTexture = 0
 Standard = 1
 Detail
 Bump
 Env
 Cube
 SGCube
 Lightmap
 NormLightmap
 Mask
 Fog
 BlackFog
 BackBuff
 ReflectBuff
 Misc
 DynamicLight
 DynamicLight2
 DynamicLight3
 DynamicLight4
 DynamicLightSecondary
 DynamicLightMask
 NormalizeCube
 None = 0
 Mul
 Add
 AddAlpha
 Sub
 LerpAlpha
 NumBlendTypes
 Scroll = 1
 Rotate = 2
 Wave = 4
 Scale = 8
 Sequence = 16
 Sin = 0
 Triangle
 Square
enum  Constants {
  MAX_TEX_PER_PASS = 8,
  MAX_STAGES = 4,
  NUM_EFFECT_COLOR_STAGES = 2
}
enum  TexType {
  NoTexture = 0,
  Standard = 1,
  Detail,
  Bump,
  Env,
  Cube,
  SGCube,
  Lightmap,
  NormLightmap,
  Mask,
  Fog,
  BlackFog,
  BackBuff,
  ReflectBuff,
  Misc,
  DynamicLight,
  DynamicLight2,
  DynamicLight3,
  DynamicLight4,
  DynamicLightSecondary,
  DynamicLightMask,
  NormalizeCube
}
enum  BlendOp {
  None = 0,
  Mul,
  Add,
  AddAlpha,
  Sub,
  LerpAlpha,
  NumBlendTypes
}
enum  AnimType {
  Scroll = 1,
  Rotate = 2,
  Wave = 4,
  Scale = 8,
  Sequence = 16
}
enum  WaveType {
  Sin = 0,
  Triangle,
  Square
}

Public Member Functions

 Material ()
 Material interface.
virtual BaseMatInstancecreateMatInstance ()
 Allocates and returns a BaseMatInstance for this material.
virtual bool isIFL () const
virtual bool isTranslucent () const
virtual bool isDoubleSided () const
const StringgetPath () const
void updateTimeBasedParams ()
 Called to update time based parameters for a material.
virtual bool onAdd ()
 SimObject interface.
virtual void onRemove ()
 Called when the object is removed from the sim.
 DECLARE_CONOBJECT (Material)

Static Public Member Functions

static GFXCubemapgetNormalizeCube ()
static void initPersistFields ()
 Register dynamic fields in a subclass of ConsoleObject.

Public Attributes

FileName mBaseTexFilename [MAX_STAGES]
FileName mDetailFilename [MAX_STAGES]
FileName mBumpFilename [MAX_STAGES]
FileName mEnvFilename [MAX_STAGES]
StageData mStages [MAX_STAGES]
ColorF mDiffuse [MAX_STAGES]
ColorF mSpecular [MAX_STAGES]
ColorF mColorMultiply [MAX_STAGES]
F32 mSpecularPower [MAX_STAGES]
bool mPixelSpecular [MAX_STAGES]
bool mVertexSpecular [MAX_STAGES]
F32 mDetailScale [MAX_STAGES]
 Per stage control over the repetition scale of the detail texture over the base texture.
U32 mExposure [MAX_STAGES]
U32 mAnimFlags [MAX_STAGES]
Point2F mScrollDir [MAX_STAGES]
F32 mScrollSpeed [MAX_STAGES]
Point2F mScrollOffset [MAX_STAGES]
F32 mRotSpeed [MAX_STAGES]
Point2F mRotPivotOffset [MAX_STAGES]
F32 mRotPos [MAX_STAGES]
F32 mWavePos [MAX_STAGES]
F32 mWaveFreq [MAX_STAGES]
F32 mWaveAmp [MAX_STAGES]
U32 mWaveType [MAX_STAGES]
F32 mSeqFramePerSec [MAX_STAGES]
F32 mSeqSegSize [MAX_STAGES]
bool mGlow [MAX_STAGES]
bool mEmissive [MAX_STAGES]
bool mDoubleSided
String mCubemapName
CubemapDatamCubemapData
bool mDynamicCubemap
bool mTranslucent
BlendOp mTranslucentBlendOp
bool mTranslucentZWrite
bool mAlphaTest
U32 mAlphaRef
bool mPlanarReflection
String mMapTo
bool mShowFootprints
 Behavioral properties. If true, show footprints when walking on surface with this material. Defaults to false.
bool mShowDust
 If true, show dust emitters (footpuffs, hover trails, etc) when on surface with this material. Defaults to false.
ColorF mEffectColor [NUM_EFFECT_COLOR_STAGES]
 Color to use for particle effects and such when located on this material.
S32 mFootstepSoundId
 Footstep sound to play when walking on surface with this material.
S32 mImpactSoundId
SFXProfilemFootstepSoundCustom
 Sound effect to play when walking on surface with this material.
SFXProfilemImpactSoundCustom
F32 mFriction
 Friction coefficient when moving along surface.

Protected Member Functions

virtual void _mapMaterial ()

Protected Attributes

U32 mLastUpdateTime
bool mIsIFL
String mPath

Static Protected Attributes

static EnumTable mBlendOpTable
static EnumTable mWaveTypeTable

Private Types

typedef BaseMaterialDefinition Parent

Static Private Attributes

static GFXCubemapHandle normalizeCube

Classes

struct  StageData

Member Typedef Documentation

Reimplemented from BaseMaterialDefinition.

Reimplemented in CustomMaterial.


Member Enumeration Documentation

Enumerator:
MAX_TEX_PER_PASS  Number of textures per pass.
MAX_STAGES 
NUM_EFFECT_COLOR_STAGES  Number of effect color definitions for transitioning effects.

Enumerator:
NoTexture 
Standard 
Detail 
Bump 
Env 
Cube 
SGCube 
Lightmap 
NormLightmap 
Mask 
Fog 
BlackFog 
BackBuff 
ReflectBuff 
Misc 
DynamicLight 
DynamicLight2 
DynamicLight3 
DynamicLight4 
DynamicLightSecondary 
DynamicLightMask 
NormalizeCube 

Enumerator:
None 
Mul 
Add 
AddAlpha 
Sub 
LerpAlpha 
NumBlendTypes 

Enumerator:
Scroll 
Rotate 
Wave 
Scale 
Sequence 

Enumerator:
Sin 
Triangle 
Square 


Constructor & Destructor Documentation

Material::Material (  ) 

Material interface.


Member Function Documentation

static GFXCubemap* Material::getNormalizeCube (  )  [static]

virtual BaseMatInstance* Material::createMatInstance (  )  [virtual]

Allocates and returns a BaseMatInstance for this material.

Caller is responsible for freeing the instance

Implements BaseMaterialDefinition.

virtual bool Material::isIFL (  )  const [inline, virtual]

virtual bool Material::isTranslucent (  )  const [inline, virtual]

virtual bool Material::isDoubleSided (  )  const [inline, virtual]

const String& Material::getPath (  )  const [inline]

void Material::updateTimeBasedParams (  ) 

Called to update time based parameters for a material.

Ensures that it only happens once per tick.

virtual bool Material::onAdd (  )  [virtual]

SimObject interface.

Reimplemented from SimObject.

Reimplemented in CustomMaterial.

virtual void Material::onRemove (  )  [virtual]

Called when the object is removed from the sim.

Reimplemented from SimObject.

Reimplemented in CustomMaterial.

static void Material::initPersistFields (  )  [static]

Register dynamic fields in a subclass of ConsoleObject.

See also:
addField(), addFieldV(), addDeprecatedField(), addGroup(), endGroup()

Reimplemented from SimObject.

Reimplemented in CustomMaterial.

Material::DECLARE_CONOBJECT ( Material   ) 

virtual void Material::_mapMaterial (  )  [protected, virtual]

Reimplemented in CustomMaterial.


Member Data Documentation

Per stage control over the repetition scale of the detail texture over the base texture.

U32 Material::mExposure[MAX_STAGES]

F32 Material::mRotSpeed[MAX_STAGES]

F32 Material::mRotPos[MAX_STAGES]

F32 Material::mWavePos[MAX_STAGES]

F32 Material::mWaveFreq[MAX_STAGES]

F32 Material::mWaveAmp[MAX_STAGES]

U32 Material::mWaveType[MAX_STAGES]

bool Material::mGlow[MAX_STAGES]

Behavioral properties. If true, show footprints when walking on surface with this material. Defaults to false.

If true, show dust emitters (footpuffs, hover trails, etc) when on surface with this material. Defaults to false.

ColorF Material::mEffectColor[NUM_EFFECT_COLOR_STAGES]

Color to use for particle effects and such when located on this material.

Footstep sound to play when walking on surface with this material.

Numeric ID of footstep sound defined on player datablock (0 == soft, 1 == hard, 2 == metal, 3 == snow). Defaults to -1 which deactivates default sound.

See also:
mFootstepSoundCustom

Sound effect to play when walking on surface with this material.

If defined, overrides mFootstepSoundId.

See also:
mFootstepSoundCustom

Friction coefficient when moving along surface.

bool Material::mIsIFL [protected]

String Material::mPath [protected]

EnumTable Material::mBlendOpTable [static, protected]

EnumTable Material::mWaveTypeTable [static, protected]