mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-03 13:15:35 +00:00
Swap matrix order
It still doesn't work, but I think this is more likely to be right.
This commit is contained in:
parent
42711089e7
commit
f721be90aa
1 changed files with 4 additions and 4 deletions
|
@ -36,8 +36,8 @@ namespace MWRender
|
||||||
|
|
||||||
inline osg::Matrix computeInstanceMatrix(const Groundcover::GroundcoverEntry& entry)
|
inline osg::Matrix computeInstanceMatrix(const Groundcover::GroundcoverEntry& entry)
|
||||||
{
|
{
|
||||||
return osg::Matrix::translate(entry.mPos.asVec3()) * osg::Matrix(Misc::Convert::makeOsgQuat(entry.mPos))
|
return osg::Matrix::scale(entry.mScale, entry.mScale, entry.mScale) * osg::Matrix(Misc::Convert::makeOsgQuat(entry.mPos))
|
||||||
* osg::Matrix::scale(entry.mScale, entry.mScale, entry.mScale);
|
* osg::Matrix::translate(entry.mPos.asVec3());
|
||||||
}
|
}
|
||||||
|
|
||||||
class InstancedComputeNearFarCullCallback : public osg::DrawableCullCallback
|
class InstancedComputeNearFarCullCallback : public osg::DrawableCullCallback
|
||||||
|
@ -100,7 +100,7 @@ namespace MWRender
|
||||||
{
|
{
|
||||||
osg::Matrix instanceMatrix = computeInstanceMatrix(entry);
|
osg::Matrix instanceMatrix = computeInstanceMatrix(entry);
|
||||||
value_type newNear = cullVisitor.computeNearestPointInFrustum(
|
value_type newNear = cullVisitor.computeNearestPointInFrustum(
|
||||||
matrix * instanceMatrix, planes, *drawable);
|
instanceMatrix * matrix, planes, *drawable);
|
||||||
dNear = std::min(dNear, newNear);
|
dNear = std::min(dNear, newNear);
|
||||||
}
|
}
|
||||||
if (dNear < computedZNear)
|
if (dNear < computedZNear)
|
||||||
|
@ -114,7 +114,7 @@ namespace MWRender
|
||||||
{
|
{
|
||||||
osg::Matrix instanceMatrix = computeInstanceMatrix(entry);
|
osg::Matrix instanceMatrix = computeInstanceMatrix(entry);
|
||||||
value_type newFar = cullVisitor.computeFurthestPointInFrustum(
|
value_type newFar = cullVisitor.computeFurthestPointInFrustum(
|
||||||
matrix * instanceMatrix, planes, *drawable);
|
instanceMatrix * matrix, planes, *drawable);
|
||||||
dFar = std::max(dFar, newFar);
|
dFar = std::max(dFar, newFar);
|
||||||
}
|
}
|
||||||
if (dFar > computedZFar)
|
if (dFar > computedZFar)
|
||||||
|
|
Loading…
Reference in a new issue