mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-10 06:44:29 +00:00
Prevent first-person meshes disappearing.
This commit is contained in:
parent
6ec893b618
commit
c3d7c7de21
@ -350,11 +350,16 @@ public:
|
|||||||
if (cv->getProjectionMatrix()->getPerspective(fov, aspect, zNear, zFar))
|
if (cv->getProjectionMatrix()->getPerspective(fov, aspect, zNear, zFar))
|
||||||
{
|
{
|
||||||
fov = mFov;
|
fov = mFov;
|
||||||
osg::RefMatrix* newProjectionMatrix = new osg::RefMatrix(*cv->getProjectionMatrix());
|
osg::ref_ptr<osg::RefMatrix> newProjectionMatrix = new osg::RefMatrix();
|
||||||
newProjectionMatrix->makePerspective(fov, aspect, zNear, zFar);
|
newProjectionMatrix->makePerspective(fov, aspect, zNear, zFar);
|
||||||
cv->pushProjectionMatrix(newProjectionMatrix);
|
osg::ref_ptr<osg::RefMatrix> invertedOldMatrix = cv->getProjectionMatrix();
|
||||||
|
invertedOldMatrix = new osg::RefMatrix(osg::RefMatrix::inverse(*invertedOldMatrix));
|
||||||
|
osg::ref_ptr<osg::RefMatrix> viewMatrix = new osg::RefMatrix(*cv->getModelViewMatrix());
|
||||||
|
viewMatrix->postMult(*newProjectionMatrix);
|
||||||
|
viewMatrix->postMult(*invertedOldMatrix);
|
||||||
|
cv->pushModelViewMatrix(viewMatrix, osg::Transform::ReferenceFrame::ABSOLUTE_RF);
|
||||||
traverse(node, nv);
|
traverse(node, nv);
|
||||||
cv->popProjectionMatrix();
|
cv->popModelViewMatrix();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
traverse(node, nv);
|
traverse(node, nv);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user