|
|
@ -6,8 +6,8 @@
|
|
|
|
#include <osg/Texture2D>
|
|
|
|
#include <osg/Texture2D>
|
|
|
|
#include <osg/Camera>
|
|
|
|
#include <osg/Camera>
|
|
|
|
#include <osg/PositionAttitudeTransform>
|
|
|
|
#include <osg/PositionAttitudeTransform>
|
|
|
|
#include <osgViewer/Viewer>
|
|
|
|
|
|
|
|
#include <osg/LightModel>
|
|
|
|
#include <osg/LightModel>
|
|
|
|
|
|
|
|
#include <osg/LightSource>
|
|
|
|
#include <osgUtil/IntersectionVisitor>
|
|
|
|
#include <osgUtil/IntersectionVisitor>
|
|
|
|
#include <osgUtil/LineSegmentIntersector>
|
|
|
|
#include <osgUtil/LineSegmentIntersector>
|
|
|
|
|
|
|
|
|
|
|
@ -65,9 +65,9 @@ namespace MWRender
|
|
|
|
unsigned int mLastRenderedFrame;
|
|
|
|
unsigned int mLastRenderedFrame;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
CharacterPreview::CharacterPreview(osgViewer::Viewer* viewer, Resource::ResourceSystem* resourceSystem,
|
|
|
|
CharacterPreview::CharacterPreview(osg::Group* parent, Resource::ResourceSystem* resourceSystem,
|
|
|
|
MWWorld::Ptr character, int sizeX, int sizeY, const osg::Vec3f& position, const osg::Vec3f& lookAt)
|
|
|
|
MWWorld::Ptr character, int sizeX, int sizeY, const osg::Vec3f& position, const osg::Vec3f& lookAt)
|
|
|
|
: mViewer(viewer)
|
|
|
|
: mParent(parent)
|
|
|
|
, mResourceSystem(resourceSystem)
|
|
|
|
, mResourceSystem(resourceSystem)
|
|
|
|
, mPosition(position)
|
|
|
|
, mPosition(position)
|
|
|
|
, mLookAt(lookAt)
|
|
|
|
, mLookAt(lookAt)
|
|
|
@ -139,7 +139,7 @@ namespace MWRender
|
|
|
|
mDrawOnceCallback = new DrawOnceCallback;
|
|
|
|
mDrawOnceCallback = new DrawOnceCallback;
|
|
|
|
mCamera->addUpdateCallback(mDrawOnceCallback);
|
|
|
|
mCamera->addUpdateCallback(mDrawOnceCallback);
|
|
|
|
|
|
|
|
|
|
|
|
mViewer->getSceneData()->asGroup()->addChild(mCamera);
|
|
|
|
mParent->addChild(mCamera);
|
|
|
|
|
|
|
|
|
|
|
|
mCharacter.mCell = NULL;
|
|
|
|
mCharacter.mCell = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -147,7 +147,7 @@ namespace MWRender
|
|
|
|
CharacterPreview::~CharacterPreview ()
|
|
|
|
CharacterPreview::~CharacterPreview ()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
mCamera->removeChildren(0, mCamera->getNumChildren());
|
|
|
|
mCamera->removeChildren(0, mCamera->getNumChildren());
|
|
|
|
mViewer->getSceneData()->asGroup()->removeChild(mCamera);
|
|
|
|
mParent->removeChild(mCamera);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int CharacterPreview::getTextureWidth() const
|
|
|
|
int CharacterPreview::getTextureWidth() const
|
|
|
@ -190,8 +190,8 @@ namespace MWRender
|
|
|
|
// --------------------------------------------------------------------------------------------------
|
|
|
|
// --------------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
InventoryPreview::InventoryPreview(osgViewer::Viewer* viewer, Resource::ResourceSystem* resourceSystem, MWWorld::Ptr character)
|
|
|
|
InventoryPreview::InventoryPreview(osg::Group* parent, Resource::ResourceSystem* resourceSystem, MWWorld::Ptr character)
|
|
|
|
: CharacterPreview(viewer, resourceSystem, character, 512, 1024, osg::Vec3f(0, 700, 71), osg::Vec3f(0,0,71))
|
|
|
|
: CharacterPreview(parent, resourceSystem, character, 512, 1024, osg::Vec3f(0, 700, 71), osg::Vec3f(0,0,71))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -319,8 +319,8 @@ namespace MWRender
|
|
|
|
|
|
|
|
|
|
|
|
// --------------------------------------------------------------------------------------------------
|
|
|
|
// --------------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
RaceSelectionPreview::RaceSelectionPreview(osgViewer::Viewer* viewer, Resource::ResourceSystem* resourceSystem)
|
|
|
|
RaceSelectionPreview::RaceSelectionPreview(osg::Group* parent, Resource::ResourceSystem* resourceSystem)
|
|
|
|
: CharacterPreview(viewer, resourceSystem, MWMechanics::getPlayer(),
|
|
|
|
: CharacterPreview(parent, resourceSystem, MWMechanics::getPlayer(),
|
|
|
|
512, 512, osg::Vec3f(0, 125, 8), osg::Vec3f(0,0,8))
|
|
|
|
512, 512, osg::Vec3f(0, 125, 8), osg::Vec3f(0,0,8))
|
|
|
|
, mBase (*mCharacter.get<ESM::NPC>()->mBase)
|
|
|
|
, mBase (*mCharacter.get<ESM::NPC>()->mBase)
|
|
|
|
, mRef(&mBase)
|
|
|
|
, mRef(&mBase)
|
|
|
|