2015-06-02 16:35:35 +02:00
|
|
|
#ifndef OPENMW_MWRENDER_WATER_H
|
|
|
|
#define OPENMW_MWRENDER_WATER_H
|
2012-01-14 18:34:14 -05:00
|
|
|
|
2015-06-02 16:35:35 +02:00
|
|
|
#include <osg/ref_ptr>
|
2012-07-03 15:32:38 +02:00
|
|
|
|
2015-06-02 16:35:35 +02:00
|
|
|
#include "../mwworld/cellstore.hpp"
|
2012-01-14 18:34:14 -05:00
|
|
|
|
2015-06-02 16:35:35 +02:00
|
|
|
namespace osg
|
2012-07-03 15:32:38 +02:00
|
|
|
{
|
2015-06-02 16:35:35 +02:00
|
|
|
class Group;
|
|
|
|
class PositionAttitudeTransform;
|
2012-10-09 17:10:25 +02:00
|
|
|
}
|
2012-05-29 06:45:44 +02:00
|
|
|
|
2015-06-03 01:18:36 +02:00
|
|
|
namespace osgUtil
|
|
|
|
{
|
|
|
|
class IncrementalCompileOperation;
|
|
|
|
}
|
|
|
|
|
2015-06-02 16:35:35 +02:00
|
|
|
namespace Resource
|
2015-02-09 19:28:29 +01:00
|
|
|
{
|
2015-06-02 16:35:35 +02:00
|
|
|
class ResourceSystem;
|
2015-02-09 19:28:29 +01:00
|
|
|
}
|
|
|
|
|
2015-06-02 16:35:35 +02:00
|
|
|
namespace MWRender
|
|
|
|
{
|
2013-01-16 09:13:36 +01:00
|
|
|
|
2012-07-03 15:32:38 +02:00
|
|
|
/// Water rendering
|
2015-06-02 16:35:35 +02:00
|
|
|
class Water
|
2012-03-29 18:33:08 +02:00
|
|
|
{
|
|
|
|
static const int CELL_SIZE = 8192;
|
2012-07-19 22:23:07 +02:00
|
|
|
|
2015-06-02 16:35:35 +02:00
|
|
|
osg::ref_ptr<osg::Group> mParent;
|
|
|
|
osg::ref_ptr<osg::PositionAttitudeTransform> mWaterNode;
|
|
|
|
Resource::ResourceSystem* mResourceSystem;
|
2015-06-03 01:18:36 +02:00
|
|
|
osg::ref_ptr<osgUtil::IncrementalCompileOperation> mIncrementalCompileOperation;
|
2012-01-14 18:34:14 -05:00
|
|
|
|
2015-06-02 16:35:35 +02:00
|
|
|
bool mEnabled;
|
2012-04-12 16:46:56 +02:00
|
|
|
bool mToggled;
|
2015-03-08 13:07:29 +13:00
|
|
|
float mTop;
|
2012-01-14 18:34:14 -05:00
|
|
|
|
2015-06-02 16:35:35 +02:00
|
|
|
osg::Vec3f getSceneNodeCoordinates(int gridX, int gridY);
|
2012-04-12 16:46:56 +02:00
|
|
|
void updateVisible();
|
2012-04-03 14:23:23 +02:00
|
|
|
|
2012-03-29 18:33:08 +02:00
|
|
|
public:
|
2015-06-03 01:18:36 +02:00
|
|
|
Water(osg::Group* parent, Resource::ResourceSystem* resourceSystem, osgUtil::IncrementalCompileOperation* ico);
|
2012-03-29 18:33:08 +02:00
|
|
|
~Water();
|
2012-01-14 18:34:14 -05:00
|
|
|
|
2015-06-02 16:35:35 +02:00
|
|
|
void setEnabled(bool enabled);
|
2012-04-03 15:13:47 +02:00
|
|
|
|
2014-05-16 09:21:08 +02:00
|
|
|
bool toggle();
|
2012-01-14 18:34:14 -05:00
|
|
|
|
2015-06-02 16:35:35 +02:00
|
|
|
bool isUnderwater(const osg::Vec3f& pos) const;
|
|
|
|
|
|
|
|
/*
|
2013-02-27 09:20:42 +01:00
|
|
|
/// adds an emitter, position will be tracked automatically using its scene node
|
|
|
|
void addEmitter (const MWWorld::Ptr& ptr, float scale = 1.f, float force = 1.f);
|
|
|
|
void removeEmitter (const MWWorld::Ptr& ptr);
|
|
|
|
void updateEmitterPtr (const MWWorld::Ptr& old, const MWWorld::Ptr& ptr);
|
2015-06-02 16:35:35 +02:00
|
|
|
*/
|
2013-02-23 05:53:20 +01:00
|
|
|
|
2015-06-02 16:35:35 +02:00
|
|
|
void changeCell(const MWWorld::CellStore* store);
|
2012-03-29 18:33:08 +02:00
|
|
|
void setHeight(const float height);
|
2012-01-14 18:34:14 -05:00
|
|
|
|
2012-03-29 18:33:08 +02:00
|
|
|
};
|
2012-01-14 18:34:14 -05:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|