class Material (client-side)
Available since version: 0.3.5
This class represents material.
Constructor
Material()
Parameters:
No parameters.
Constructor
Material(string name)
Parameters:
stringname: the name of the material.
Properties
string name
Available since version: 0.3.5.2
Represents the name of the material.
userdata texture (read-only)
Available since version: 0.3.5.2
Represents texture pointer.
Color color
Available since version: 0.3.5.2
Represents color.
float smoothAngle
Available since version: 0.3.5.2
Represents smooth angle.
int matGroup
Available since version: 0.3.5.2
Represents material group. For more information see MaterialGroup constants.
string detailObjectVisualName
Available since version: 0.3.5.2
Represents detail object visual name.
float kambient
Available since version: 0.3.5.2
Represents kambient.
float kdiffuse
Available since version: 0.3.5.2
Represents kambient.
float environmentalMappingStrength
Available since version: 0.3.5.2
Represents environmental mapping strength.
bool smooth
Available since version: 0.3.5.2
Represents true if smooth is enabled, otherwise false.
bool dontUseLightmaps
Available since version: 0.3.5.2
Represents true if lightmaps shouldn't be used, otherwise false.
bool texAniMap
Available since version: 0.3.5.2
Represents true if texture uv mapping is enabled, otherwise false.
bool lodDontCollapse
Available since version: 0.3.5.2
Represents true if lod collapsing is disabled, otherwise false (unused by the game).
bool noCollDet
Available since version: 0.3.5.2
Represents true if collision detection is disabled for polygons that are using this material, otherwise false.
bool forceOccluder
Available since version: 0.3.5.2
Represents true if polygons that are using this material should be treated as occluder, otherwise false.
bool environmentalMapping
Available since version: 0.3.5.2
Represents true if environmental mapping is enabled, otherwise false.
bool polyListNeedsSort
Available since version: 0.3.5.2
Represents true if poly list requires sorting, otherwise false.
int matUsage
Available since version: 0.3.5.2
Represents material usage scope (uint8 type). For more information see MaterialUsage constants
int libFlag
Available since version: 0.3.5.2
Represents material internal lib flag (uint8 type) (unused by the game).
int rndAlphaBlendFunc
Available since version: 0.3.5.2
Represents alpha render blending function type. For more information see AlphaFunc constants.
bool ignoreSun
Available since version: 0.3.5.2
Represents true sun should be ignored by the material polys, otherwise false.
int waveAniMode
Available since version: 0.3.5.2
Represents wave animation mode. For more information see WaveAniMode constants.
int waveAniSpeed
Available since version: 0.3.5.2
Represents wave animation speed. For more information see FFT constants.
float waveMaxAmplitude
Available since version: 0.3.5.2
Represents wave max amplitude.
float waveGridSize
Available since version: 0.3.5.2
Represents wave grid size.
float detailTextureScale
Available since version: 0.3.5.2
Represents detail texture scale.
userdata detailTexture (read-only)
Available since version: 0.3.5.2
Represents detail texture pointer.
Vec2 texAniMapDelta
Available since version: 0.3.5.2
Represents texture ani map delta.
Vec2 defaultMapping
Available since version: 0.3.5.2
Represents default mapping.
Vec2 texScale
Available since version: 0.3.5.2
Represents texture scale.
string matGroupString
Available since version: 0.3.5.2
Represents material group as string.
bool isPortal (read-only)
Available since version: 0.3.5.2
Represents true if the material is a portal, otherwise false.
Methods
getTextureName
Available since version: 0.3.5.2
This method will get the material texture name.
void getTextureName(string texture)
Parameters:
stringtexture: name.
setTexture
Available since version: 0.3.5.6
This method will set the material texture by name.
void setTexture(string texture)
Parameters:
stringtexture: name.
static getMatGroupString
Available since version: 0.3.5.2
This static method will return the string material group name based of the given material group type.
string getMatGroupString(int material_group)
Parameters:
intmaterial_group: . For more information see MaterialGroup constants.
Returns string:
static searchByName
Available since version: 0.3.5.2
This static method will try to find loaded material by it's name.
void searchByName(string material_name)
Parameters:
stringmaterial_name: the name of the material.
Callbacks
No callbacks.