1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-08 09:37:53 +00:00
OpenMW/apps/openmw/mwrender/characterpreview.hpp

89 lines
1.7 KiB
C++
Raw Normal View History

2012-09-12 22:54:32 +00:00
#ifndef MWRENDER_CHARACTERPREVIEW_H
#define MWRENDER_CHARACTERPREVIEW_H
#include <OgreRenderTarget.h>
2012-09-14 12:34:18 +00:00
#include <OgreMaterialManager.h>
#include "externalrendering.hpp"
#include "../mwworld/ptr.hpp"
2012-09-14 12:34:18 +00:00
namespace OEngine
{
namespace Render
{
class SelectionBuffer;
}
}
2012-09-12 22:54:32 +00:00
namespace MWRender
{
2012-09-13 17:03:31 +00:00
class NpcAnimation;
class CharacterPreview : public ExternalRendering
2012-09-12 22:54:32 +00:00
{
public:
CharacterPreview(MWWorld::Ptr character, int sizeX, int sizeY, const std::string& name,
2012-09-13 17:03:31 +00:00
Ogre::Vector3 position, Ogre::Vector3 lookAt);
virtual ~CharacterPreview();
virtual void setup (Ogre::SceneManager *sceneManager);
virtual void onSetup();
2012-09-12 22:54:32 +00:00
2012-09-13 17:03:31 +00:00
protected:
2012-09-12 22:54:32 +00:00
Ogre::TexturePtr mTexture;
Ogre::RenderTarget* mRenderTarget;
Ogre::Viewport* mViewport;
Ogre::Camera* mCamera;
Ogre::SceneManager* mSceneMgr;
Ogre::SceneNode* mNode;
2012-09-13 17:03:31 +00:00
Ogre::Vector3 mPosition;
Ogre::Vector3 mLookAt;
MWWorld::Ptr mCharacter;
MWRender::NpcAnimation* mAnimation;
std::string mName;
2012-09-13 17:03:31 +00:00
int mSizeX;
int mSizeY;
};
class InventoryPreview : public CharacterPreview
{
public:
InventoryPreview(MWWorld::Ptr character);
2012-09-14 12:34:18 +00:00
virtual ~InventoryPreview();
virtual void onSetup();
2012-09-13 17:03:31 +00:00
void update(int sizeX, int sizeY);
2012-09-14 12:34:18 +00:00
int getSlotSelected(int posX, int posY);
2012-09-13 17:03:31 +00:00
void setNpcAnimation (NpcAnimation* anim);
private:
2012-09-14 12:34:18 +00:00
OEngine::Render::SelectionBuffer* mSelectionBuffer;
2012-09-13 17:03:31 +00:00
};
class RaceSelectionPreview : public CharacterPreview
{
public:
RaceSelectionPreview();
2012-09-13 17:03:31 +00:00
void update(float angle);
2012-09-12 22:54:32 +00:00
};
}
#endif