hide player in first person 360 screenshot

0.6.3
Miloslav Číž 7 years ago
parent ce55d7c2f5
commit 5afe02505b

@ -1016,7 +1016,7 @@ namespace MWInput
void InputManager::screenshot()
{
// MOVE THIS ELSEWHERE LATER!
int screenshotW = 512;
int screenshotW = 1024;
osg::ref_ptr<osg::Image> screenshot (new osg::Image);
MWBase::Environment::get().getWorld()->screenshot360(screenshot.get(), screenshotW);

@ -636,21 +636,24 @@ namespace MWRender
double fovBackup = mFieldOfView;
mFieldOfView = 90.0; // each side sees 90 degrees
if (mCamera->isFirstPerson())
mPlayerAnimation->getObjectRoot()->setNodeMask(0);
for (int i = 0; i < 6; i++) // for each cube side
{
osg::ref_ptr<osg::Image> sideImage (new osg::Image);
screenshot(sideImage.get(),w,w,directions[i]);
if (i == 0)
{
image->allocateImage(w * 6,w,sideImage->r(),sideImage->getPixelFormat(),sideImage->getDataType());
std::cout << image->s() << " " << image->t() << std::endl;
}
osg::copyImage(sideImage.get(),0,0,0,sideImage->s(),sideImage->t(),sideImage->r(),
image,w * i,0,0);
}
if (mCamera->isFirstPerson())
mPlayerAnimation->getObjectRoot()->setNodeMask(1);
mFieldOfView = fovBackup;
}
@ -667,6 +670,8 @@ namespace MWRender
mViewer->getCamera()->getViewMatrix() * osg::Matrixd::rotate(osg::Vec3(0,0,-1),direction)
);
// TODO: water reflections have to be transformed as well!!!!!
rttCamera->setViewport(0, 0, w, h);
osg::ref_ptr<osg::Texture2D> texture (new osg::Texture2D);

Loading…
Cancel
Save