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() void InputManager::screenshot()
{ {
// MOVE THIS ELSEWHERE LATER! // MOVE THIS ELSEWHERE LATER!
int screenshotW = 512; int screenshotW = 1024;
osg::ref_ptr<osg::Image> screenshot (new osg::Image); osg::ref_ptr<osg::Image> screenshot (new osg::Image);
MWBase::Environment::get().getWorld()->screenshot360(screenshot.get(), screenshotW); MWBase::Environment::get().getWorld()->screenshot360(screenshot.get(), screenshotW);

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

Loading…
Cancel
Save