MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / _initMaterial

Method _initMaterial

Engine/source/T3D/fx/groundCover.cpp:860–879  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

858}
859
860void GroundCover::_initMaterial()
861{
862 SAFE_DELETE(mMaterialInst);
863
864 if (mMaterialAsset.notNull() && mMaterialAsset->getStatus() == MaterialAsset::Ok)
865 mMaterialInst = mMaterial->createMatInstance();
866 else
867 mMaterialInst = MATMGR->createMatInstance("WarningMaterial");
868
869 // Add our special feature that makes it all work...
870 FeatureSet features = MATMGR->getDefaultFeatures();
871 features.addFeature( MFT_Foliage );
872
873 // Our feature requires a pointer back to this object
874 // to properly setup its shader consts.
875 mMaterialInst->setUserObject( this );
876
877 // DO IT!
878 mMaterialInst->init( features, getGFXVertexFormat<GCVertex>() );
879}
880
881void GroundCover::_initShapes()
882{

Callers

nothing calls this directly

Calls 6

notNullMethod · 0.80
addFeatureMethod · 0.80
getStatusMethod · 0.45
createMatInstanceMethod · 0.45
setUserObjectMethod · 0.45
initMethod · 0.45

Tested by

no test coverage detected