|
|
|
@ -1361,7 +1361,7 @@ void MWShadowTechnique::cull(osgUtil::CullVisitor& cv)
|
|
|
|
|
if (settings->getMultipleShadowMapHint() == ShadowSettings::CASCADED)
|
|
|
|
|
{
|
|
|
|
|
cropShadowCameraToMainFrustum(frustum, camera, cascaseNear, cascadeFar, extraPlanes);
|
|
|
|
|
for (auto plane : extraPlanes)
|
|
|
|
|
for (const auto& plane : extraPlanes)
|
|
|
|
|
local_polytope.getPlaneList().push_back(plane);
|
|
|
|
|
local_polytope.setupMask();
|
|
|
|
|
}
|
|
|
|
@ -1998,19 +1998,19 @@ struct ConvexHull
|
|
|
|
|
Vertices findInternalEdges(osg::Vec3d mainVertex, Vertices connectedVertices)
|
|
|
|
|
{
|
|
|
|
|
Vertices internalEdgeVertices;
|
|
|
|
|
for (auto vertex : connectedVertices)
|
|
|
|
|
for (const auto& vertex : connectedVertices)
|
|
|
|
|
{
|
|
|
|
|
osg::Matrixd matrix;
|
|
|
|
|
osg::Vec3d dir = vertex - mainVertex;
|
|
|
|
|
matrix.makeLookAt(mainVertex, vertex, dir.z() == 0 ? osg::Vec3d(0, 0, 1) : osg::Vec3d(1, 0, 0));
|
|
|
|
|
Vertices testVertices;
|
|
|
|
|
for (auto testVertex : connectedVertices)
|
|
|
|
|
for (const auto& testVertex : connectedVertices)
|
|
|
|
|
{
|
|
|
|
|
if (vertex != testVertex)
|
|
|
|
|
testVertices.push_back(testVertex);
|
|
|
|
|
}
|
|
|
|
|
std::vector<double> bearings;
|
|
|
|
|
for (auto testVertex : testVertices)
|
|
|
|
|
for (const auto& testVertex : testVertices)
|
|
|
|
|
{
|
|
|
|
|
osg::Vec3d transformedVertex = testVertex * matrix;
|
|
|
|
|
bearings.push_back(atan2(transformedVertex.y(), transformedVertex.x()));
|
|
|
|
@ -2039,7 +2039,7 @@ struct ConvexHull
|
|
|
|
|
|
|
|
|
|
// Collect the set of vertices
|
|
|
|
|
VertexSet vertices;
|
|
|
|
|
for (Edge edge : _edges)
|
|
|
|
|
for (const Edge& edge : _edges)
|
|
|
|
|
{
|
|
|
|
|
vertices.insert(edge.first);
|
|
|
|
|
vertices.insert(edge.second);
|
|
|
|
@ -2069,7 +2069,7 @@ struct ConvexHull
|
|
|
|
|
for (auto vertex : extremeVertices)
|
|
|
|
|
{
|
|
|
|
|
Vertices connectedVertices;
|
|
|
|
|
for (Edge edge : _edges)
|
|
|
|
|
for (const Edge& edge : _edges)
|
|
|
|
|
{
|
|
|
|
|
if (edge.first == vertex)
|
|
|
|
|
connectedVertices.push_back(edge.second);
|
|
|
|
@ -2107,7 +2107,7 @@ struct ConvexHull
|
|
|
|
|
osg::Vec3d vertex = *unprocessedConnectedVertices.begin();
|
|
|
|
|
unprocessedConnectedVertices.erase(unprocessedConnectedVertices.begin());
|
|
|
|
|
connectedVertices.insert(vertex);
|
|
|
|
|
for (Edge edge : _edges)
|
|
|
|
|
for (const Edge& edge : _edges)
|
|
|
|
|
{
|
|
|
|
|
osg::Vec3d otherEnd;
|
|
|
|
|
if (edge.first == vertex)
|
|
|
|
@ -2124,7 +2124,7 @@ struct ConvexHull
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (Edge edge : _edges)
|
|
|
|
|
for (const Edge& edge : _edges)
|
|
|
|
|
{
|
|
|
|
|
if (connectedVertices.count(edge.first) || connectedVertices.count(edge.second))
|
|
|
|
|
finalEdges.push_back(edge);
|
|
|
|
|