About Store Forum Documentation Contact



Post Reply 
Materials groupping
Author Message
Harry Offline
Member

Post: #1
Materials groupping
In the past there was user_type field in Material class allowing to group material to certain class of materials like stone, glass, grass and so on.

It looks like this feature does not exist in the engine anymore. Does the engine supports similar feature? My idea for now is to create lookup tables of materials belonging to certain types but it does not sound as convenient as old feature.
02-14-2020 09:27 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Materials groupping
You can do:

Code:
/******************************************************************************/
struct MaterialEx : Material
{
   UInt type;

   MaterialEx()
   {
      type=123;
   }
};
void InitPre()
{
   Materials.replaceClass<MaterialEx>();

After that you can cast all materials from 'Materials' cache into 'MaterialEx' class
02-15-2020 04:39 AM
Find all posts by this user Quote this message in a reply
Post Reply