1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-04 02:45:35 +00:00

Make things less readable to appease authoritarian line length limit

This commit is contained in:
AnyOldName3 2023-04-30 02:05:35 +01:00
parent ab625804ab
commit 61712168c6

View file

@ -45,8 +45,8 @@ namespace MWRender
class InstancedComputeNearFarCullCallback : public osg::DrawableCullCallback
{
public:
InstancedComputeNearFarCullCallback(
const std::vector<Groundcover::GroundcoverEntry>& instances, const osg::Vec3& chunkPosition, const osg::BoundingBox& instanceBounds)
InstancedComputeNearFarCullCallback(const std::vector<Groundcover::GroundcoverEntry>& instances,
const osg::Vec3& chunkPosition, const osg::BoundingBox& instanceBounds)
: mInstanceMatrices()
, mInstanceBounds(instanceBounds)
{
@ -107,11 +107,13 @@ namespace MWRender
{
osg::Matrix fullMatrix = instanceMatrix * matrix;
osg::Vec3 instanceLookVector(-fullMatrix(0, 2), -fullMatrix(1, 2), -fullMatrix(2, 2));
unsigned int instanceBbCornerFar
= (instanceLookVector.x() >= 0 ? 1 : 0) | (instanceLookVector.y() >= 0 ? 2 : 0) | (instanceLookVector.z() >= 0 ? 4 : 0);
unsigned int instanceBbCornerFar = (instanceLookVector.x() >= 0 ? 1 : 0)
| (instanceLookVector.y() >= 0 ? 2 : 0) | (instanceLookVector.z() >= 0 ? 4 : 0);
unsigned int instanceBbCornerNear = (~instanceBbCornerFar) & 7;
value_type instanceDNear = distance(mInstanceBounds.corner(instanceBbCornerNear), fullMatrix);
value_type instanceDFar = distance(mInstanceBounds.corner(instanceBbCornerFar), fullMatrix);
value_type instanceDNear
= distance(mInstanceBounds.corner(instanceBbCornerNear), fullMatrix);
value_type instanceDFar
= distance(mInstanceBounds.corner(instanceBbCornerFar), fullMatrix);
if (instanceDNear > instanceDFar)
std::swap(instanceDNear, instanceDFar);
@ -119,8 +121,8 @@ namespace MWRender
if (instanceDFar < 0 || instanceDNear > dNear)
continue;
value_type newNear = cullVisitor.computeNearestPointInFrustum(
fullMatrix, planes, *drawable);
value_type newNear
= cullVisitor.computeNearestPointInFrustum(fullMatrix, planes, *drawable);
dNear = std::min(dNear, newNear);
}
if (dNear < computedZNear)
@ -134,11 +136,13 @@ namespace MWRender
{
osg::Matrix fullMatrix = instanceMatrix * matrix;
osg::Vec3 instanceLookVector(-fullMatrix(0, 2), -fullMatrix(1, 2), -fullMatrix(2, 2));
unsigned int instanceBbCornerFar
= (instanceLookVector.x() >= 0 ? 1 : 0) | (instanceLookVector.y() >= 0 ? 2 : 0) | (instanceLookVector.z() >= 0 ? 4 : 0);
unsigned int instanceBbCornerFar = (instanceLookVector.x() >= 0 ? 1 : 0)
| (instanceLookVector.y() >= 0 ? 2 : 0) | (instanceLookVector.z() >= 0 ? 4 : 0);
unsigned int instanceBbCornerNear = (~instanceBbCornerFar) & 7;
value_type instanceDNear = distance(mInstanceBounds.corner(instanceBbCornerNear), fullMatrix);
value_type instanceDFar = distance(mInstanceBounds.corner(instanceBbCornerFar), fullMatrix);
value_type instanceDNear
= distance(mInstanceBounds.corner(instanceBbCornerNear), fullMatrix);
value_type instanceDFar
= distance(mInstanceBounds.corner(instanceBbCornerFar), fullMatrix);
if (instanceDNear > instanceDFar)
std::swap(instanceDNear, instanceDFar);