Support Forum       G3D Web Page     
Public Types | Static Public Member Functions | Public Attributes | Static Protected Member Functions | List of all members
G3D::MD3Model::Skin Class Reference

A set of materials for a MD3Model. More...

Inherits G3D::ReferenceCountedObject.

Public Types

typedef Table< String, shared_ptr< UniversalMaterial > > PartSkin
 Maps triList names to materials. More...
 

Static Public Member Functions

static shared_ptr< Skincreate ()
 
static shared_ptr< Skincreate (const String &commonPath, const String &lowerSkin, const String &upperSkin, const String &headSkin)
 
static shared_ptr< Skincreate (const String &commonPath, const String &commonSuffix)
 Loads commonPath + "lower_" + commonSuffix + ".skin", etc. More...
 
static shared_ptr< Skincreate (const Any &a)
 Format is either: More...
 

Public Attributes

Array< PartSkinpartSkin
 Table for each part. More...
 

Static Protected Member Functions

template<class T , class ... ArgTypes>
static shared_ptr< T > createShared (ArgTypes &&... args)
 Like std::make_shared, but works for protected constructors. More...
 

Detailed Description

A set of materials for a MD3Model.

Member Typedef Documentation

◆ PartSkin

Maps triList names to materials.

If a material is specified as nullptr (which corresponds to Quake's common/nodraw), that means "do not draw this triList".

Member Function Documentation

◆ create() [1/4]

static shared_ptr<Skin> G3D::MD3Model::Skin::create ( )
inlinestatic

◆ create() [2/4]

static shared_ptr<Skin> G3D::MD3Model::Skin::create ( const String commonPath,
const String lowerSkin,
const String upperSkin,
const String headSkin 
)
static

◆ create() [3/4]

static shared_ptr<Skin> G3D::MD3Model::Skin::create ( const String commonPath,
const String commonSuffix 
)
static

Loads commonPath + "lower_" + commonSuffix + ".skin", etc.

for other parts

◆ create() [4/4]

static shared_ptr<Skin> G3D::MD3Model::Skin::create ( const Any a)
static

Format is either:

  • MD3Model::Skin( <list of part skins> )

Each part skin is either a .skin file relative to the md3 directory or an Any table mapping a tri list name to a material. It may have an optional name; it is optional but convenient to make this the name of the part. For example:

    MD3Model::Skin(
       "lower_dragon.skin",
       "upper_dragon.skin",
       head {
         h_cap = NONE, 
         h_head = UniversalMaterial::Specification {
            diffuse = "Happy.tga"
         },
         h_Visor = NONE,
         h_Helmet = UniversalMaterial::Specification {
            diffuse = "Knight2A1.tga"
         }
       }
   )

◆ createShared()

template<class T , class ... ArgTypes>
static shared_ptr<T> G3D::ReferenceCountedObject::createShared ( ArgTypes &&...  args)
inlinestaticprotectedinherited

Like std::make_shared, but works for protected constructors.

Call as createShared<myclass>.

Member Data Documentation

◆ partSkin

Array<PartSkin> G3D::MD3Model::Skin::partSkin

Table for each part.

Indices are PartTypes.


documentation generated on Wed Nov 24 2021 08:01:58 using doxygen 1.8.15