Added osg::State::getCurrentMode and osg::State::getCurrentAttribute().

Aded osg::clampAbove(..) and osg::clampBelow() template functions to
include/osg/Math.
This commit is contained in:
Robert Osfield
2002-05-21 08:59:26 +00:00
parent a57eae47f6
commit b8d8a8be27
3 changed files with 63 additions and 21 deletions

View File

@@ -563,7 +563,6 @@ void State::haveAppliedAttribute(const StateAttribute::Type type)
if (itr!=_attributeMap.end())
{
AttributeStack& as = itr->second;
as.last_applied_attribute = 0L;
// will need to update this attribute on next apply so set it to changed.
@@ -571,6 +570,35 @@ void State::haveAppliedAttribute(const StateAttribute::Type type)
}
}
const bool State::getCurrentMode(const StateAttribute::GLMode mode) const
{
ModeMap::const_iterator itr = _modeMap.find(mode);
if (itr!=_modeMap.end())
{
const ModeStack& ms = itr->second;
return ms.last_applied_value;
}
else
{
return false;
}
}
const StateAttribute* State::getCurrentAttribute(const StateAttribute::Type type) const
{
AttributeMap::const_iterator itr = _attributeMap.find(type);
if (itr!=_attributeMap.end())
{
const AttributeStack& as = itr->second;
return as.last_applied_attribute;
}
else
{
return NULL;
}
}
ClippingVolume State::getClippingVolume() const
{
ClippingVolume cv;