From Eric Wing, pedantic warning fixes

This commit is contained in:
Robert Osfield
2007-04-06 15:36:13 +00:00
parent 0909bd04e4
commit 6d7b5e7ebd
38 changed files with 60 additions and 43 deletions

View File

@@ -135,6 +135,6 @@ private:
osg::ref_ptr<MatrixManipulator> _current;
};
};
}
#endif

View File

@@ -57,7 +57,7 @@ class OSGGA_EXPORT NodeTrackerManipulator : public MatrixManipulator
NODE_CENTER_AND_AZIM,
/** Tack the center of the node's bounding sphere, and the all rotations of the node.
*/
NODE_CENTER_AND_ROTATION,
NODE_CENTER_AND_ROTATION
};
void setTrackerMode(TrackerMode mode);
@@ -71,7 +71,7 @@ class OSGGA_EXPORT NodeTrackerManipulator : public MatrixManipulator
TRACKBALL,
/** Allow the elevation and azimuth angles to be adjust w.r.t the tracked orientation.
*/
ELEVATION_AZIM,
ELEVATION_AZIM
};
void setRotationMode(RotationMode mode);

View File

@@ -31,7 +31,7 @@ class OSGGA_EXPORT TerrainManipulator : public MatrixManipulator
enum RotationMode
{
ELEVATION_AZIM_ROLL,
ELEVATION_AZIM,
ELEVATION_AZIM
};
void setRotationMode(RotationMode mode);

View File

@@ -144,9 +144,18 @@ class OSGSHADOW_EXPORT OccluderGeometry : public osg::Drawable
{
if (edge.boundaryEdge()) return true;
float offset = 0.0f;
osg::Vec3 delta(lightpos-_vertices[edge._p1]);
float n1 = delta * _triangleNormals[edge._t1];
float n2 = delta * _triangleNormals[edge._t2];
delta.normalize();
float n1 = delta * _triangleNormals[edge._t1] + offset;
float n2 = delta * _triangleNormals[edge._t2] + offset;
float angle_offset = 0.0f;
n1 = cos(acosf(n1) + angle_offset);
n2 = cos(acosf(n2) + angle_offset);
if (n1==0.0f && n2==0.0f) return false;
@@ -157,8 +166,15 @@ class OSGSHADOW_EXPORT OccluderGeometry : public osg::Drawable
{
if (edge.boundaryEdge()) return true;
float n1 = lightdirection * _triangleNormals[edge._t1];
float n2 = lightdirection * _triangleNormals[edge._t2];
float offset = 0.0f;
float n1 = lightdirection * _triangleNormals[edge._t1] + offset;
float n2 = lightdirection * _triangleNormals[edge._t2] + offset;
float angle_offset = 0.0f;
n1 = cos(acosf(n1) + angle_offset);
n2 = cos(acosf(n2) + angle_offset);
if (n1==0.0f && n2==0.0f) return false;