1 #include "vogleditor_statetreelightitem.h"
2 #include "vogl_state_vector.h"
4 vogleditor_stateTreeLightItem::vogleditor_stateTreeLightItem(QString name, unsigned int lightIndex, vogleditor_stateTreeItem* parent, const vogl_state_vector* pState)
5 : vogleditor_stateTreeItem(name, "", parent),
6 m_lightIndex(lightIndex),
11 #define GET_FLOAT(name, num) if (pState->get<float>(name, 0, fVals, num)) { vogleditor_stateTreeStateVecFloatItem* pItem = new vogleditor_stateTreeStateVecFloatItem(#name, name, 0, *pState, fVals, num, false, this); m_diffableItems.push_back(pItem); this->appendChild(pItem); }
12 GET_FLOAT(GL_CONSTANT_ATTENUATION, 1);
13 GET_FLOAT(GL_LINEAR_ATTENUATION, 1);
14 GET_FLOAT(GL_QUADRATIC_ATTENUATION, 1);
15 GET_FLOAT(GL_SPOT_EXPONENT, 1);
16 GET_FLOAT(GL_SPOT_CUTOFF, 1);
17 GET_FLOAT(GL_AMBIENT, 4);
18 GET_FLOAT(GL_DIFFUSE, 4);
19 GET_FLOAT(GL_SPECULAR, 4);
20 GET_FLOAT(GL_POSITION, 4);
21 GET_FLOAT(GL_SPOT_DIRECTION, 3);
25 void vogleditor_stateTreeLightItem::set_diff_base_state(const vogl_state_vector* pBaseState)
27 m_pDiffBaseState = pBaseState;
29 for (vogleditor_stateTreeStateVecDiffableItem* const* iter = m_diffableItems.begin(); iter != m_diffableItems.end(); iter++)
31 (*iter)->set_diff_base_state(pBaseState);