mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-24 05:53:53 +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)
|
||||
{
|
||||
return osg::Matrix::translate(entry.mPos.asVec3()) * osg::Matrix(Misc::Convert::makeOsgQuat(entry.mPos))
|
||||
* osg::Matrix::scale(entry.mScale, entry.mScale, entry.mScale);
|
||||
return osg::Matrix::scale(entry.mScale, entry.mScale, entry.mScale) * osg::Matrix(Misc::Convert::makeOsgQuat(entry.mPos))
|
||||
* osg::Matrix::translate(entry.mPos.asVec3());
|
||||
}
|
||||
|
||||
class InstancedComputeNearFarCullCallback : public osg::DrawableCullCallback
|
||||
|
@ -100,7 +100,7 @@ namespace MWRender
|
|||
{
|
||||
osg::Matrix instanceMatrix = computeInstanceMatrix(entry);
|
||||
value_type newNear = cullVisitor.computeNearestPointInFrustum(
|
||||
matrix * instanceMatrix, planes, *drawable);
|
||||
instanceMatrix * matrix, planes, *drawable);
|
||||
dNear = std::min(dNear, newNear);
|
||||
}
|
||||
if (dNear < computedZNear)
|
||||
|
@ -114,7 +114,7 @@ namespace MWRender
|
|||
{
|
||||
osg::Matrix instanceMatrix = computeInstanceMatrix(entry);
|
||||
value_type newFar = cullVisitor.computeFurthestPointInFrustum(
|
||||
matrix * instanceMatrix, planes, *drawable);
|
||||
instanceMatrix * matrix, planes, *drawable);
|
||||
dFar = std::max(dFar, newFar);
|
||||
}
|
||||
if (dFar > computedZFar)
|
||||
|
|
Loading…
Reference in a new issue