mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 21:53:51 +00:00
Prevent first-person meshes disappearing.
This commit is contained in:
parent
6ec893b618
commit
c3d7c7de21
1 changed files with 8 additions and 3 deletions
|
@ -350,11 +350,16 @@ public:
|
|||
if (cv->getProjectionMatrix()->getPerspective(fov, aspect, zNear, zFar))
|
||||
{
|
||||
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);
|
||||
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);
|
||||
cv->popProjectionMatrix();
|
||||
cv->popModelViewMatrix();
|
||||
}
|
||||
else
|
||||
traverse(node, nv);
|
||||
|
|
Loading…
Reference in a new issue