From Brede Johansen - Fixes to osg::Plane::valid and added a new set method.

From Stephan Huber - Compilation fix to Texture.cpp for OSX.

From Don Tidrow - added dirtyBound() to osgText::Text::setPosition
This commit is contained in:
Robert Osfield
2002-09-12 13:23:15 +00:00
parent 866af14f86
commit 5733cc1470
3 changed files with 12 additions and 4 deletions

View File

@@ -52,6 +52,13 @@ class SG_EXPORT Plane
calculateUpperLowerBBCorners();
}
inline void set(const Vec3& norm, const Vec3& point)
{
float d = -norm[0]*point[0] - norm[1]*point[1] - norm[2]*point[2];
_fv.set(norm[0],norm[1],norm[2],d);
calculateUpperLowerBBCorners();
}
/** flip/reverse the orientation of the plane.*/
inline void flip()
{
@@ -78,7 +85,7 @@ class SG_EXPORT Plane
}
inline bool valid() const { return _fv[0]==0.0f && _fv[1]==0.0f && _fv[2]==0.0f; }
inline bool valid() const { return _fv.valid(); }
inline Vec4& asVec4() { return _fv; }
@@ -88,7 +95,7 @@ class SG_EXPORT Plane
inline float operator [] (unsigned int i) const { return _fv[i]; }
inline osg::Vec3 getNormal() { return osg::Vec3(_fv[0],_fv[1],_fv[2]); }
inline osg::Vec3 getNormal() const { return osg::Vec3(_fv[0],_fv[1],_fv[2]); }
/** calculate the distance between a point and the plane.*/
inline float distance(const osg::Vec3& v) const

View File

@@ -460,8 +460,8 @@ void Texture::flushDeletedTextureObjects(uint contextID)
DeletedTextureObjectCache::iterator citr = s_deletedTextureObjectCache.find(contextID);
if (citr!=s_deletedTextureObjectCache.end())
{
std::set<uint>& textureObjectSet = citr->second;
for(std::set<uint>::iterator titr=textureObjectSet.begin();
std::set<GLuint>& textureObjectSet = citr->second;
for(std::set<GLuint>::iterator titr=textureObjectSet.begin();
titr!=textureObjectSet.end();
++titr)
{

View File

@@ -268,6 +268,7 @@ void Text::
setPosition(const Vec3& pos)
{
_pos=pos;
dirtyBound();
}
void Text::