3ds Max C++ API Reference
Loading...
Searching...
No Matches
Material Class Reference

The main material class definition. More...

#include <mtl.h>

+ Inheritance diagram for Material:

Public Member Functions

DllExport Material ()
 
virtual ~Material ()
 
DllExport Material (const Material &from)
 Copy constructor.
 
DllExport Materialoperator= (const Material &from)
 Assignment operator.
 
DllExport BaseInterfaceGetInterface (Interface_ID id)
 Gets the BaseInterface pointer.
 
- Public Member Functions inherited from BaseInterfaceServer
UtilExport BaseInterfaceGetInterface (Interface_ID id) override
 
virtual UtilExport int NumInterfaces () const
 
virtual UtilExport BaseInterfaceGetInterfaceAt (int i) const
 
virtual UtilExport ~BaseInterfaceServer ()
 
- Public Member Functions inherited from InterfaceServer
virtual UtilExport ~InterfaceServer ()
 Destructor.
 
virtual UtilExport BaseInterfaceGetInterface (Interface_ID id)
 
template<class InterfaceType >
InterfaceType * GetTypedInterface ()
 

Public Attributes

Point3 Ka
 Ambient color setting.
 
Point3 Kd
 Diffuse color setting.
 
Point3 Ks
 Specular color setting.
 
float shininess
 Shininess setting. This value ranges from 0.0 to 1.0.
 
float shinStrength
 Shininess strength setting. This value ranges from 0.0 to 1.0.
 
float opacity
 Opacity setting. This value ranges from 0.0 to 1.0.
 
float selfIllum
 Self Illumination setting. This value ranges from 0.0 to 1.0.
 
int dblSided
 Double sided material setting. Nonzero indicates double sided material, otherwise single sided.
 
int shadeLimit
 Shading limit setting. See Rendering Modes.
 
MaxSDK::Array< TextureInfotexture
 The textures used by this material.
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown.
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned.
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown.
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown.
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned.
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown.
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned.
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown.
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned.
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown.
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects.
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned.
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown.
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned.
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen.
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen.
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen.
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen.
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen.
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown.
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator.
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator.
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary.
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary.
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc.
 
- Protected Attributes inherited from BaseInterfaceServer
Tab< BaseInterface * > interfaces
 

Detailed Description

The main material class definition.

This class describes the properties of a material used by the renderer.

See also
Class TextureInfo, Template Class Tab, Class Point3, Rendering Modes.

Constructor & Destructor Documentation

◆ Material() [1/2]

Remarks
Class constructor. The data members are initialized as follows:

Ka[0] = Ka[1] = Ka[2] = 0.3f;

Kd[0] = Kd[1] = Kd[2] = 0.9f;

Ks[0] = Ks[1] = Ks[2] = 0.9f;

shininess = 10.0f;

shinStrength = 1.0f;

opacity = 1.0f;

selfIllum = 0.0f;

dblSided = 0;

shadeLimit = 3;

TextureInfo texInfo;

texture.Append(1, &texInfo);

◆ ~Material()

virtual ~Material ( )
inlinevirtual
Remarks
Class destructor.
226{};

◆ Material() [2/2]

DllExport Material ( const Material from)

Copy constructor.

Parameters
[in]fromThe object that will be copied.

Member Function Documentation

◆ operator=()

DllExport Material & operator= ( const Material from)

Assignment operator.

Parameters
[in]fromThe object that will be copied.

◆ GetInterface()

DllExport BaseInterface * GetInterface ( Interface_ID  id)
virtual

Gets the BaseInterface pointer.

Reimplemented from BaseInterfaceServer.

Member Data Documentation

◆ Ka

Point3 Ka

Ambient color setting.

The values for x, y, and z range from 0.0 to 1.0. These correspond to red, green, and blue respectively.

◆ Kd

Point3 Kd

Diffuse color setting.

The values for x, y, and z range from 0.0 to 1.0. These correspond to red, green, and blue respectively.

◆ Ks

Point3 Ks

Specular color setting.

The values for x, y, and z range from 0.0 to 1.0. These correspond to red, green, and blue respectively.

◆ shininess

float shininess

Shininess setting. This value ranges from 0.0 to 1.0.

◆ shinStrength

float shinStrength

Shininess strength setting. This value ranges from 0.0 to 1.0.

◆ opacity

float opacity

Opacity setting. This value ranges from 0.0 to 1.0.

◆ selfIllum

float selfIllum

Self Illumination setting. This value ranges from 0.0 to 1.0.

◆ dblSided

int dblSided

Double sided material setting. Nonzero indicates double sided material, otherwise single sided.

◆ shadeLimit

int shadeLimit

Shading limit setting. See Rendering Modes.

◆ texture

The textures used by this material.