New feature: ISceneNode->getMaterialFlag...

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply
disanti
Posts: 367
Joined: Sat Jan 17, 2004 1:36 am
Location: California, US
Contact:

New feature: ISceneNode->getMaterialFlag...

Post by disanti »

Hello, I was busy programming my level editor and I wanted a way to retrieve material flags, so I added this function into ISceneNode.h:

Code: Select all

        //! Gets specifig material flag. Helpful if you want to know if an object is lit.
        //! \param flag: Which flag to return.
        bool getMaterialFlag(video::E_MATERIAL_FLAG flag)
        {
            return getMaterial(0).Flags[flag];
        }
Put that function after the "void setMaterialFlag(video::E_MATERIAL_FLAG flag, bool newvalue)" function in ISceneNode.h.

Finally, enjoy a simplified way of retrieving a material flag.
I am thinking I could have just done this though:
node->getMaterial(0).Flag[video::EMF_LIGHTING]

Oh well, this was fun! ;)
~ John DiSanti
________
HONDA CBF500
Post Reply