mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 22:23:51 +00:00
Merge commit '8a8107e8'
This commit is contained in:
commit
e1a5435531
68 changed files with 320 additions and 290 deletions
|
@ -97,6 +97,10 @@ opencs_units_noqt (view/render
|
|||
cellarrow cellmarker cellborder pathgrid
|
||||
)
|
||||
|
||||
opencs_hdrs_noqt (view/render
|
||||
mask
|
||||
)
|
||||
|
||||
|
||||
opencs_units (view/tools
|
||||
reportsubview reporttable searchsubview searchbox merge
|
||||
|
|
|
@ -8,10 +8,9 @@
|
|||
|
||||
#include <osgUtil/LineSegmentIntersector>
|
||||
|
||||
#include <components/sceneutil/vismask.hpp>
|
||||
|
||||
#include "../../model/world/cellcoordinates.hpp"
|
||||
#include "../widget/brushshapes.hpp"
|
||||
#include "mask.hpp"
|
||||
|
||||
CSVRender::BrushDraw::BrushDraw(osg::ref_ptr<osg::Group> parentNode, bool textureMode) :
|
||||
mParentNode(parentNode), mTextureMode(textureMode)
|
||||
|
@ -46,7 +45,7 @@ float CSVRender::BrushDraw::getIntersectionHeight (const osg::Vec3d& point)
|
|||
intersector->setIntersectionLimit(osgUtil::LineSegmentIntersector::NO_LIMIT);
|
||||
osgUtil::IntersectionVisitor visitor(intersector);
|
||||
|
||||
visitor.setTraversalMask(SceneUtil::Mask_Terrain);
|
||||
visitor.setTraversalMask(Mask_Terrain);
|
||||
|
||||
mParentNode->accept(visitor);
|
||||
|
||||
|
@ -258,7 +257,6 @@ void CSVRender::BrushDraw::update(osg::Vec3d point, int brushSize, CSVWidget::Br
|
|||
{
|
||||
if (mBrushDrawNode->containsNode(mGeometry))
|
||||
mBrushDrawNode->removeChild(mGeometry);
|
||||
mBrushDrawNode->setNodeMask (SceneUtil::Mask_GUI);
|
||||
float radius = (mLandSizeFactor * brushSize) / 2;
|
||||
osg::Vec3d snapToGridPoint = point;
|
||||
if (mTextureMode)
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
#include <components/esm/loadcell.hpp>
|
||||
#include <components/esm/loadland.hpp>
|
||||
#include <components/sceneutil/pathgridutil.hpp>
|
||||
#include <components/sceneutil/vismask.hpp>
|
||||
#include <components/terrain/terraingrid.hpp>
|
||||
|
||||
#include "../../model/world/idtable.hpp"
|
||||
|
@ -22,6 +21,7 @@
|
|||
#include "cellborder.hpp"
|
||||
#include "cellarrow.hpp"
|
||||
#include "cellmarker.hpp"
|
||||
#include "mask.hpp"
|
||||
#include "pathgrid.hpp"
|
||||
#include "terrainstorage.hpp"
|
||||
#include "object.hpp"
|
||||
|
@ -92,7 +92,7 @@ bool CSVRender::Cell::addObjects (int start, int end)
|
|||
|
||||
std::unique_ptr<Object> object (new Object (mData, mCellNode, id, false));
|
||||
|
||||
if (mSubModeElementMask & SceneUtil::Mask_EditorReference)
|
||||
if (mSubModeElementMask & Mask_Reference)
|
||||
object->setSubMode (mSubMode);
|
||||
|
||||
mObjects.insert (std::make_pair (id, object.release()));
|
||||
|
@ -134,7 +134,7 @@ void CSVRender::Cell::updateLand()
|
|||
else
|
||||
{
|
||||
mTerrain.reset(new Terrain::TerrainGrid(mCellNode, mCellNode,
|
||||
mData.getResourceSystem().get(), mTerrainStorage));
|
||||
mData.getResourceSystem().get(), mTerrainStorage, Mask_Terrain));
|
||||
}
|
||||
|
||||
mTerrain->loadCell(esmLand.mX, esmLand.mY);
|
||||
|
@ -434,7 +434,7 @@ void CSVRender::Cell::reloadAssets()
|
|||
|
||||
void CSVRender::Cell::setSelection (int elementMask, Selection mode)
|
||||
{
|
||||
if (elementMask & SceneUtil::Mask_EditorReference)
|
||||
if (elementMask & Mask_Reference)
|
||||
{
|
||||
for (std::map<std::string, Object *>::const_iterator iter (mObjects.begin());
|
||||
iter!=mObjects.end(); ++iter)
|
||||
|
@ -451,7 +451,7 @@ void CSVRender::Cell::setSelection (int elementMask, Selection mode)
|
|||
iter->second->setSelected (selected);
|
||||
}
|
||||
}
|
||||
if (mPathgrid && elementMask & SceneUtil::Mask_Pathgrid)
|
||||
if (mPathgrid && elementMask & Mask_Pathgrid)
|
||||
{
|
||||
// Only one pathgrid may be selected, so some operations will only have an effect
|
||||
// if the pathgrid is already focused
|
||||
|
@ -546,12 +546,12 @@ std::vector<osg::ref_ptr<CSVRender::TagBase> > CSVRender::Cell::getSelection (un
|
|||
{
|
||||
std::vector<osg::ref_ptr<TagBase> > result;
|
||||
|
||||
if (elementMask & SceneUtil::Mask_EditorReference)
|
||||
if (elementMask & Mask_Reference)
|
||||
for (std::map<std::string, Object *>::const_iterator iter (mObjects.begin());
|
||||
iter!=mObjects.end(); ++iter)
|
||||
if (iter->second->getSelected())
|
||||
result.push_back (iter->second->getTag());
|
||||
if (mPathgrid && elementMask & SceneUtil::Mask_Pathgrid)
|
||||
if (mPathgrid && elementMask & Mask_Pathgrid)
|
||||
if (mPathgrid->isSelected())
|
||||
result.push_back(mPathgrid->getTag());
|
||||
|
||||
|
@ -562,7 +562,7 @@ std::vector<osg::ref_ptr<CSVRender::TagBase> > CSVRender::Cell::getEdited (unsig
|
|||
{
|
||||
std::vector<osg::ref_ptr<TagBase> > result;
|
||||
|
||||
if (elementMask & SceneUtil::Mask_EditorReference)
|
||||
if (elementMask & Mask_Reference)
|
||||
for (std::map<std::string, Object *>::const_iterator iter (mObjects.begin());
|
||||
iter!=mObjects.end(); ++iter)
|
||||
if (iter->second->isEdited())
|
||||
|
@ -576,7 +576,7 @@ void CSVRender::Cell::setSubMode (int subMode, unsigned int elementMask)
|
|||
mSubMode = subMode;
|
||||
mSubModeElementMask = elementMask;
|
||||
|
||||
if (elementMask & SceneUtil::Mask_EditorReference)
|
||||
if (elementMask & Mask_Reference)
|
||||
for (std::map<std::string, Object *>::const_iterator iter (mObjects.begin());
|
||||
iter!=mObjects.end(); ++iter)
|
||||
iter->second->setSubMode (subMode);
|
||||
|
@ -584,10 +584,10 @@ void CSVRender::Cell::setSubMode (int subMode, unsigned int elementMask)
|
|||
|
||||
void CSVRender::Cell::reset (unsigned int elementMask)
|
||||
{
|
||||
if (elementMask & SceneUtil::Mask_EditorReference)
|
||||
if (elementMask & Mask_Reference)
|
||||
for (std::map<std::string, Object *>::const_iterator iter (mObjects.begin());
|
||||
iter!=mObjects.end(); ++iter)
|
||||
iter->second->reset();
|
||||
if (mPathgrid && elementMask & SceneUtil::Mask_Pathgrid)
|
||||
if (mPathgrid && elementMask & Mask_Pathgrid)
|
||||
mPathgrid->resetIndicators();
|
||||
}
|
||||
|
|
|
@ -11,10 +11,11 @@
|
|||
#include "../../model/prefs/shortcutmanager.hpp"
|
||||
|
||||
#include <components/misc/constants.hpp>
|
||||
#include <components/sceneutil/vismask.hpp>
|
||||
|
||||
#include "mask.hpp"
|
||||
|
||||
CSVRender::CellArrowTag::CellArrowTag (CellArrow *arrow)
|
||||
: TagBase (SceneUtil::Mask_EditorCellArrow), mArrow (arrow)
|
||||
: TagBase (Mask_CellArrow), mArrow (arrow)
|
||||
{}
|
||||
|
||||
CSVRender::CellArrow *CSVRender::CellArrowTag::getCellArrow() const
|
||||
|
@ -174,7 +175,7 @@ CSVRender::CellArrow::CellArrow (osg::Group *cellNode, Direction direction,
|
|||
|
||||
mParentNode->addChild (mBaseNode);
|
||||
|
||||
mBaseNode->setNodeMask (SceneUtil::Mask_EditorCellArrow);
|
||||
mBaseNode->setNodeMask (Mask_CellArrow);
|
||||
|
||||
adjustTransform();
|
||||
buildShape();
|
||||
|
|
|
@ -7,7 +7,8 @@
|
|||
#include <osg/PrimitiveSet>
|
||||
|
||||
#include <components/esm/loadland.hpp>
|
||||
#include <components/sceneutil/vismask.hpp>
|
||||
|
||||
#include "mask.hpp"
|
||||
|
||||
#include "../../model/world/cellcoordinates.hpp"
|
||||
|
||||
|
@ -19,7 +20,7 @@ CSVRender::CellBorder::CellBorder(osg::Group* cellNode, const CSMWorld::CellCoor
|
|||
: mParentNode(cellNode)
|
||||
{
|
||||
mBaseNode = new osg::PositionAttitudeTransform();
|
||||
mBaseNode->setNodeMask(SceneUtil::Mask_EditorCellBorder);
|
||||
mBaseNode->setNodeMask(Mask_CellBorder);
|
||||
mBaseNode->setPosition(osg::Vec3f(coords.getX() * CellSize, coords.getY() * CellSize, 10));
|
||||
|
||||
mParentNode->addChild(mBaseNode);
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#include <components/misc/constants.hpp>
|
||||
|
||||
CSVRender::CellMarkerTag::CellMarkerTag(CellMarker *marker)
|
||||
: TagBase(SceneUtil::Mask_EditorCellMarker), mMarker(marker)
|
||||
: TagBase(Mask_CellMarker), mMarker(marker)
|
||||
{}
|
||||
|
||||
CSVRender::CellMarker *CSVRender::CellMarkerTag::getCellMarker() const
|
||||
|
@ -79,7 +79,7 @@ CSVRender::CellMarker::CellMarker(
|
|||
mMarkerNode->getOrCreateStateSet()->setAttribute(mat);
|
||||
|
||||
mMarkerNode->setUserData(new CellMarkerTag(this));
|
||||
mMarkerNode->setNodeMask(SceneUtil::Mask_EditorCellMarker);
|
||||
mMarkerNode->setNodeMask(Mask_CellMarker);
|
||||
|
||||
mCellNode->addChild(mMarkerNode);
|
||||
|
||||
|
|
|
@ -11,12 +11,12 @@
|
|||
#include <components/resource/imagemanager.hpp>
|
||||
#include <components/resource/resourcesystem.hpp>
|
||||
#include <components/sceneutil/waterutil.hpp>
|
||||
#include <components/sceneutil/vismask.hpp>
|
||||
|
||||
#include "../../model/world/cell.hpp"
|
||||
#include "../../model/world/cellcoordinates.hpp"
|
||||
#include "../../model/world/data.hpp"
|
||||
|
||||
#include "mask.hpp"
|
||||
|
||||
namespace CSVRender
|
||||
{
|
||||
|
@ -38,7 +38,7 @@ namespace CSVRender
|
|||
mWaterTransform->setPosition(osg::Vec3f(cellCoords.getX() * CellSize + CellSize / 2.f,
|
||||
cellCoords.getY() * CellSize + CellSize / 2.f, 0));
|
||||
|
||||
mWaterTransform->setNodeMask(SceneUtil::Mask_Water);
|
||||
mWaterTransform->setNodeMask(Mask_Water);
|
||||
mParentNode->addChild(mWaterTransform);
|
||||
|
||||
mWaterNode = new osg::Geode();
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include "../widget/scenetoolbar.hpp"
|
||||
#include "../widget/scenetoolmode.hpp"
|
||||
|
||||
#include <components/sceneutil/vismask.hpp>
|
||||
#include "mask.hpp"
|
||||
|
||||
#include "object.hpp"
|
||||
#include "worldspacewidget.hpp"
|
||||
|
@ -97,7 +97,7 @@ osg::Vec3f CSVRender::InstanceMode::getScreenCoords(const osg::Vec3f& pos)
|
|||
}
|
||||
|
||||
CSVRender::InstanceMode::InstanceMode (WorldspaceWidget *worldspaceWidget, osg::ref_ptr<osg::Group> parentNode, QWidget *parent)
|
||||
: EditMode (worldspaceWidget, QIcon (":scenetoolbar/editing-instance"), SceneUtil::Mask_EditorReference | SceneUtil::Mask_Terrain, "Instance editing",
|
||||
: EditMode (worldspaceWidget, QIcon (":scenetoolbar/editing-instance"), Mask_Reference | Mask_Terrain, "Instance editing",
|
||||
parent), mSubMode (0), mSubModeId ("move"), mSelectionMode (0), mDragMode (DragMode_None),
|
||||
mDragAxis (-1), mLocked (false), mUnitScaleDist(1), mParentNode (parentNode)
|
||||
{
|
||||
|
@ -157,13 +157,13 @@ void CSVRender::InstanceMode::activate (CSVWidget::SceneToolbar *toolbar)
|
|||
|
||||
std::string subMode = mSubMode->getCurrentId();
|
||||
|
||||
getWorldspaceWidget().setSubMode (getSubModeFromId (subMode), SceneUtil::Mask_EditorReference);
|
||||
getWorldspaceWidget().setSubMode (getSubModeFromId (subMode), Mask_Reference);
|
||||
}
|
||||
|
||||
void CSVRender::InstanceMode::deactivate (CSVWidget::SceneToolbar *toolbar)
|
||||
{
|
||||
mDragMode = DragMode_None;
|
||||
getWorldspaceWidget().reset (SceneUtil::Mask_EditorReference);
|
||||
getWorldspaceWidget().reset (Mask_Reference);
|
||||
|
||||
if (mSelectionMode)
|
||||
{
|
||||
|
@ -216,7 +216,7 @@ void CSVRender::InstanceMode::secondaryEditPressed (const WorldspaceHitResult& h
|
|||
|
||||
void CSVRender::InstanceMode::primarySelectPressed (const WorldspaceHitResult& hit)
|
||||
{
|
||||
getWorldspaceWidget().clearSelection (SceneUtil::Mask_EditorReference);
|
||||
getWorldspaceWidget().clearSelection (Mask_Reference);
|
||||
|
||||
if (hit.tag)
|
||||
{
|
||||
|
@ -251,13 +251,13 @@ bool CSVRender::InstanceMode::primaryEditStartDrag (const QPoint& pos)
|
|||
|
||||
WorldspaceHitResult hit = getWorldspaceWidget().mousePick (pos, getWorldspaceWidget().getInteractionMask());
|
||||
|
||||
std::vector<osg::ref_ptr<TagBase> > selection = getWorldspaceWidget().getSelection (SceneUtil::Mask_EditorReference);
|
||||
std::vector<osg::ref_ptr<TagBase> > selection = getWorldspaceWidget().getSelection (Mask_Reference);
|
||||
if (selection.empty())
|
||||
{
|
||||
// Only change selection at the start of drag if no object is already selected
|
||||
if (hit.tag && CSMPrefs::get()["3D Scene Input"]["context-select"].isTrue())
|
||||
{
|
||||
getWorldspaceWidget().clearSelection (SceneUtil::Mask_EditorReference);
|
||||
getWorldspaceWidget().clearSelection (Mask_Reference);
|
||||
if (CSVRender::ObjectTag *objectTag = dynamic_cast<CSVRender::ObjectTag *> (hit.tag.get()))
|
||||
{
|
||||
CSVRender::Object* object = objectTag->mObject;
|
||||
|
@ -265,7 +265,7 @@ bool CSVRender::InstanceMode::primaryEditStartDrag (const QPoint& pos)
|
|||
}
|
||||
}
|
||||
|
||||
selection = getWorldspaceWidget().getSelection (SceneUtil::Mask_EditorReference);
|
||||
selection = getWorldspaceWidget().getSelection (Mask_Reference);
|
||||
if (selection.empty())
|
||||
return false;
|
||||
}
|
||||
|
@ -291,7 +291,7 @@ bool CSVRender::InstanceMode::primaryEditStartDrag (const QPoint& pos)
|
|||
mDragMode = DragMode_Scale;
|
||||
|
||||
// Calculate scale factor
|
||||
std::vector<osg::ref_ptr<TagBase> > editedSelection = getWorldspaceWidget().getEdited (SceneUtil::Mask_EditorReference);
|
||||
std::vector<osg::ref_ptr<TagBase> > editedSelection = getWorldspaceWidget().getEdited (Mask_Reference);
|
||||
osg::Vec3f center = getScreenCoords(getSelectionCenter(editedSelection));
|
||||
|
||||
int widgetHeight = getWorldspaceWidget().height();
|
||||
|
@ -327,7 +327,7 @@ void CSVRender::InstanceMode::drag (const QPoint& pos, int diffX, int diffY, dou
|
|||
osg::Vec3f offset;
|
||||
osg::Quat rotation;
|
||||
|
||||
std::vector<osg::ref_ptr<TagBase> > selection = getWorldspaceWidget().getEdited (SceneUtil::Mask_EditorReference);
|
||||
std::vector<osg::ref_ptr<TagBase> > selection = getWorldspaceWidget().getEdited (Mask_Reference);
|
||||
|
||||
if (mDragMode == DragMode_Move)
|
||||
{
|
||||
|
@ -484,7 +484,7 @@ void CSVRender::InstanceMode::drag (const QPoint& pos, int diffX, int diffY, dou
|
|||
void CSVRender::InstanceMode::dragCompleted(const QPoint& pos)
|
||||
{
|
||||
std::vector<osg::ref_ptr<TagBase> > selection =
|
||||
getWorldspaceWidget().getEdited (SceneUtil::Mask_EditorReference);
|
||||
getWorldspaceWidget().getEdited (Mask_Reference);
|
||||
|
||||
QUndoStack& undoStack = getWorldspaceWidget().getDocument().getUndoStack();
|
||||
|
||||
|
@ -516,7 +516,7 @@ void CSVRender::InstanceMode::dragCompleted(const QPoint& pos)
|
|||
|
||||
void CSVRender::InstanceMode::dragAborted()
|
||||
{
|
||||
getWorldspaceWidget().reset (SceneUtil::Mask_EditorReference);
|
||||
getWorldspaceWidget().reset (Mask_Reference);
|
||||
mDragMode = DragMode_None;
|
||||
}
|
||||
|
||||
|
@ -535,7 +535,7 @@ void CSVRender::InstanceMode::dragWheel (int diff, double speedFactor)
|
|||
offset *= diff * speedFactor;
|
||||
|
||||
std::vector<osg::ref_ptr<TagBase> > selection =
|
||||
getWorldspaceWidget().getEdited (SceneUtil::Mask_EditorReference);
|
||||
getWorldspaceWidget().getEdited (Mask_Reference);
|
||||
|
||||
for (std::vector<osg::ref_ptr<TagBase> >::iterator iter (selection.begin());
|
||||
iter!=selection.end(); ++iter)
|
||||
|
@ -677,12 +677,12 @@ void CSVRender::InstanceMode::subModeChanged (const std::string& id)
|
|||
{
|
||||
mSubModeId = id;
|
||||
getWorldspaceWidget().abortDrag();
|
||||
getWorldspaceWidget().setSubMode (getSubModeFromId (id), SceneUtil::Mask_EditorReference);
|
||||
getWorldspaceWidget().setSubMode (getSubModeFromId (id), Mask_Reference);
|
||||
}
|
||||
|
||||
void CSVRender::InstanceMode::deleteSelectedInstances(bool active)
|
||||
{
|
||||
std::vector<osg::ref_ptr<TagBase> > selection = getWorldspaceWidget().getSelection (SceneUtil::Mask_EditorReference);
|
||||
std::vector<osg::ref_ptr<TagBase> > selection = getWorldspaceWidget().getSelection (Mask_Reference);
|
||||
if (selection.empty()) return;
|
||||
|
||||
CSMDoc::Document& document = getWorldspaceWidget().getDocument();
|
||||
|
@ -695,7 +695,7 @@ void CSVRender::InstanceMode::deleteSelectedInstances(bool active)
|
|||
if (CSVRender::ObjectTag *objectTag = dynamic_cast<CSVRender::ObjectTag *> (tag.get()))
|
||||
macro.push(new CSMWorld::DeleteCommand(referencesTable, objectTag->mObject->getReferenceId()));
|
||||
|
||||
getWorldspaceWidget().clearSelection (SceneUtil::Mask_EditorReference);
|
||||
getWorldspaceWidget().clearSelection (Mask_Reference);
|
||||
}
|
||||
|
||||
void CSVRender::InstanceMode::dropInstance(DropMode dropMode, CSVRender::Object* object, float objectHeight)
|
||||
|
@ -713,9 +713,9 @@ void CSVRender::InstanceMode::dropInstance(DropMode dropMode, CSVRender::Object*
|
|||
osgUtil::IntersectionVisitor visitor(intersector);
|
||||
|
||||
if (dropMode == TerrainSep)
|
||||
visitor.setTraversalMask(SceneUtil::Mask_Terrain);
|
||||
visitor.setTraversalMask(Mask_Terrain);
|
||||
if (dropMode == CollisionSep)
|
||||
visitor.setTraversalMask(SceneUtil::Mask_Terrain | SceneUtil::Mask_EditorReference);
|
||||
visitor.setTraversalMask(Mask_Terrain | Mask_Reference);
|
||||
|
||||
mParentNode->accept(visitor);
|
||||
|
||||
|
@ -745,9 +745,9 @@ float CSVRender::InstanceMode::getDropHeight(DropMode dropMode, CSVRender::Objec
|
|||
osgUtil::IntersectionVisitor visitor(intersector);
|
||||
|
||||
if (dropMode == Terrain)
|
||||
visitor.setTraversalMask(SceneUtil::Mask_Terrain);
|
||||
visitor.setTraversalMask(Mask_Terrain);
|
||||
if (dropMode == Collision)
|
||||
visitor.setTraversalMask(SceneUtil::Mask_Terrain | SceneUtil::Mask_EditorReference);
|
||||
visitor.setTraversalMask(Mask_Terrain | Mask_Reference);
|
||||
|
||||
mParentNode->accept(visitor);
|
||||
|
||||
|
@ -784,7 +784,7 @@ void CSVRender::InstanceMode::dropSelectedInstancesToTerrainSeparately()
|
|||
|
||||
void CSVRender::InstanceMode::handleDropMethod(DropMode dropMode, QString commandMsg)
|
||||
{
|
||||
std::vector<osg::ref_ptr<TagBase> > selection = getWorldspaceWidget().getSelection (SceneUtil::Mask_EditorReference);
|
||||
std::vector<osg::ref_ptr<TagBase> > selection = getWorldspaceWidget().getSelection (Mask_Reference);
|
||||
if (selection.empty())
|
||||
return;
|
||||
|
||||
|
@ -841,7 +841,7 @@ void CSVRender::InstanceMode::handleDropMethod(DropMode dropMode, QString comman
|
|||
CSVRender::DropObjectDataHandler::DropObjectDataHandler(WorldspaceWidget* worldspacewidget)
|
||||
: mWorldspaceWidget(worldspacewidget)
|
||||
{
|
||||
std::vector<osg::ref_ptr<TagBase> > selection = mWorldspaceWidget->getSelection (SceneUtil::Mask_EditorReference);
|
||||
std::vector<osg::ref_ptr<TagBase> > selection = mWorldspaceWidget->getSelection (Mask_Reference);
|
||||
for(osg::ref_ptr<TagBase> tag: selection)
|
||||
{
|
||||
if (CSVRender::ObjectTag *objectTag = dynamic_cast<CSVRender::ObjectTag *> (tag.get()))
|
||||
|
@ -850,7 +850,7 @@ CSVRender::DropObjectDataHandler::DropObjectDataHandler(WorldspaceWidget* worlds
|
|||
osg::ref_ptr<osg::Group> objectNodeWithoutGUI = objectTag->mObject->getBaseNode();
|
||||
|
||||
osg::ComputeBoundsVisitor computeBounds;
|
||||
computeBounds.setTraversalMask(SceneUtil::Mask_EditorReference);
|
||||
computeBounds.setTraversalMask(Mask_Reference);
|
||||
objectNodeWithoutGUI->accept(computeBounds);
|
||||
osg::BoundingBox bounds = computeBounds.getBoundingBox();
|
||||
float boundingBoxOffset = 0.0f;
|
||||
|
@ -860,14 +860,14 @@ CSVRender::DropObjectDataHandler::DropObjectDataHandler(WorldspaceWidget* worlds
|
|||
mObjectHeights.emplace_back(boundingBoxOffset);
|
||||
mOldMasks.emplace_back(objectNodeWithGUI->getNodeMask());
|
||||
|
||||
objectNodeWithGUI->setNodeMask(SceneUtil::Mask_Disabled);
|
||||
objectNodeWithGUI->setNodeMask(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CSVRender::DropObjectDataHandler::~DropObjectDataHandler()
|
||||
{
|
||||
std::vector<osg::ref_ptr<TagBase> > selection = mWorldspaceWidget->getSelection (SceneUtil::Mask_EditorReference);
|
||||
std::vector<osg::ref_ptr<TagBase> > selection = mWorldspaceWidget->getSelection (Mask_Reference);
|
||||
int counter = 0;
|
||||
for(osg::ref_ptr<TagBase> tag: selection)
|
||||
{
|
||||
|
|
|
@ -6,15 +6,13 @@
|
|||
#include "../../model/world/idtable.hpp"
|
||||
#include "../../model/world/commands.hpp"
|
||||
|
||||
#include <components/sceneutil/vismask.hpp>
|
||||
|
||||
#include "worldspacewidget.hpp"
|
||||
#include "object.hpp"
|
||||
|
||||
namespace CSVRender
|
||||
{
|
||||
InstanceSelectionMode::InstanceSelectionMode(CSVWidget::SceneToolbar* parent, WorldspaceWidget& worldspaceWidget)
|
||||
: SelectionMode(parent, worldspaceWidget, SceneUtil::Mask_EditorReference)
|
||||
: SelectionMode(parent, worldspaceWidget, Mask_Reference)
|
||||
{
|
||||
mSelectSame = new QAction("Extend selection to instances with same object ID", this);
|
||||
mDeleteSelection = new QAction("Delete selected instances", this);
|
||||
|
@ -38,12 +36,12 @@ namespace CSVRender
|
|||
|
||||
void InstanceSelectionMode::selectSame()
|
||||
{
|
||||
getWorldspaceWidget().selectAllWithSameParentId(SceneUtil::Mask_EditorReference);
|
||||
getWorldspaceWidget().selectAllWithSameParentId(Mask_Reference);
|
||||
}
|
||||
|
||||
void InstanceSelectionMode::deleteSelection()
|
||||
{
|
||||
std::vector<osg::ref_ptr<TagBase> > selection = getWorldspaceWidget().getSelection(SceneUtil::Mask_EditorReference);
|
||||
std::vector<osg::ref_ptr<TagBase> > selection = getWorldspaceWidget().getSelection(Mask_Reference);
|
||||
|
||||
CSMWorld::IdTable& referencesTable = dynamic_cast<CSMWorld::IdTable&>(
|
||||
*getWorldspaceWidget().getDocument().getData().getTableModel(CSMWorld::UniversalId::Type_References));
|
||||
|
|
35
apps/opencs/view/render/mask.hpp
Normal file
35
apps/opencs/view/render/mask.hpp
Normal file
|
@ -0,0 +1,35 @@
|
|||
#ifndef CSV_RENDER_ELEMENTS_H
|
||||
#define CSV_RENDER_ELEMENTS_H
|
||||
|
||||
namespace CSVRender
|
||||
{
|
||||
|
||||
/// Node masks used on the OSG scene graph in OpenMW-CS.
|
||||
/// @note See the respective file in OpenMW (apps/openmw/mwrender/vismask.hpp)
|
||||
/// for general usage hints about node masks.
|
||||
/// @copydoc MWRender::VisMask
|
||||
enum Mask
|
||||
{
|
||||
// internal use within NifLoader, do not change
|
||||
Mask_UpdateVisitor = 0x1,
|
||||
|
||||
// elements that are part of the actual scene
|
||||
Mask_Reference = 0x2,
|
||||
Mask_Pathgrid = 0x4,
|
||||
Mask_Water = 0x8,
|
||||
Mask_Fog = 0x10,
|
||||
Mask_Terrain = 0x20,
|
||||
|
||||
// used within models
|
||||
Mask_ParticleSystem = 0x100,
|
||||
|
||||
Mask_Lighting = 0x200,
|
||||
|
||||
// control elements
|
||||
Mask_CellMarker = 0x10000,
|
||||
Mask_CellArrow = 0x20000,
|
||||
Mask_CellBorder = 0x40000
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
|
@ -29,9 +29,9 @@
|
|||
#include <components/resource/scenemanager.hpp>
|
||||
#include <components/sceneutil/lightutil.hpp>
|
||||
#include <components/sceneutil/lightmanager.hpp>
|
||||
#include <components/sceneutil/vismask.hpp>
|
||||
|
||||
#include "actor.hpp"
|
||||
#include "mask.hpp"
|
||||
|
||||
|
||||
const float CSVRender::Object::MarkerShaftWidth = 30;
|
||||
|
@ -58,7 +58,7 @@ namespace
|
|||
|
||||
|
||||
CSVRender::ObjectTag::ObjectTag (Object* object)
|
||||
: TagBase (SceneUtil::Mask_EditorReference), mObject (object)
|
||||
: TagBase (Mask_Reference), mObject (object)
|
||||
{}
|
||||
|
||||
QString CSVRender::ObjectTag::getToolTip (bool hideBasics) const
|
||||
|
@ -140,7 +140,7 @@ void CSVRender::Object::update()
|
|||
if (light)
|
||||
{
|
||||
bool isExterior = false; // FIXME
|
||||
SceneUtil::addLight(mBaseNode, light, isExterior);
|
||||
SceneUtil::addLight(mBaseNode, light, Mask_ParticleSystem, Mask_Lighting, isExterior);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -429,7 +429,7 @@ CSVRender::Object::Object (CSMWorld::Data& data, osg::Group* parentNode,
|
|||
|
||||
parentNode->addChild (mRootNode);
|
||||
|
||||
mRootNode->setNodeMask(SceneUtil::Mask_EditorReference);
|
||||
mRootNode->setNodeMask(Mask_Reference);
|
||||
|
||||
if (referenceable)
|
||||
{
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include "../widget/scenetooltoggle2.hpp"
|
||||
|
||||
#include "editmode.hpp"
|
||||
#include "mask.hpp"
|
||||
#include "cameracontroller.hpp"
|
||||
#include "cellarrow.hpp"
|
||||
#include "terraintexturemode.hpp"
|
||||
|
@ -126,8 +127,8 @@ void CSVRender::PagedWorldspaceWidget::addVisibilitySelectorButtons (
|
|||
CSVWidget::SceneToolToggle2 *tool)
|
||||
{
|
||||
WorldspaceWidget::addVisibilitySelectorButtons (tool);
|
||||
tool->addButton (Button_Terrain, SceneUtil::Mask_Terrain, "Terrain");
|
||||
//tool->addButton (Button_Fog, Mask_Fog, "Fog", "", true);
|
||||
tool->addButton (Button_Terrain, Mask_Terrain, "Terrain");
|
||||
tool->addButton (Button_Fog, Mask_Fog, "Fog", "", true);
|
||||
}
|
||||
|
||||
void CSVRender::PagedWorldspaceWidget::addEditModeSelectorButtons (
|
||||
|
@ -141,16 +142,16 @@ void CSVRender::PagedWorldspaceWidget::addEditModeSelectorButtons (
|
|||
tool->addButton (
|
||||
new TerrainTextureMode (this, mRootNode, tool), "terrain-texture");
|
||||
tool->addButton (
|
||||
new EditMode (this, QIcon (":placeholder"), SceneUtil::Mask_EditorReference, "Terrain vertex paint editing"),
|
||||
new EditMode (this, QIcon (":placeholder"), Mask_Reference, "Terrain vertex paint editing"),
|
||||
"terrain-vertex");
|
||||
tool->addButton (
|
||||
new EditMode (this, QIcon (":placeholder"), SceneUtil::Mask_EditorReference, "Terrain movement"),
|
||||
new EditMode (this, QIcon (":placeholder"), Mask_Reference, "Terrain movement"),
|
||||
"terrain-move");
|
||||
}
|
||||
|
||||
void CSVRender::PagedWorldspaceWidget::handleInteractionPress (const WorldspaceHitResult& hit, InteractionType type)
|
||||
{
|
||||
if (hit.tag && hit.tag->getMask()==SceneUtil::Mask_EditorCellArrow)
|
||||
if (hit.tag && hit.tag->getMask()==Mask_CellArrow)
|
||||
{
|
||||
if (CellArrowTag *cellArrowTag = dynamic_cast<CSVRender::CellArrowTag *> (hit.tag.get()))
|
||||
{
|
||||
|
@ -873,9 +874,9 @@ CSVWidget::SceneToolToggle2 *CSVRender::PagedWorldspaceWidget::makeControlVisibi
|
|||
mControlElements = new CSVWidget::SceneToolToggle2 (parent,
|
||||
"Controls & Guides Visibility", ":scenetoolbar/scene-view-marker-c", ":scenetoolbar/scene-view-marker-");
|
||||
|
||||
mControlElements->addButton (1, SceneUtil::Mask_EditorCellMarker, "Cell Marker");
|
||||
mControlElements->addButton (2, SceneUtil::Mask_EditorCellArrow, "Cell Arrows");
|
||||
mControlElements->addButton (4, SceneUtil::Mask_EditorCellBorder, "Cell Border");
|
||||
mControlElements->addButton (1, Mask_CellMarker, "Cell Marker");
|
||||
mControlElements->addButton (2, Mask_CellArrow, "Cell Arrows");
|
||||
mControlElements->addButton (4, Mask_CellBorder, "Cell Border");
|
||||
|
||||
mControlElements->setSelectionMask (0xffffffff);
|
||||
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
#include <osg/Vec3>
|
||||
|
||||
#include <components/sceneutil/pathgridutil.hpp>
|
||||
#include <components/sceneutil/vismask.hpp>
|
||||
|
||||
#include "../../model/world/cell.hpp"
|
||||
#include "../../model/world/commands.hpp"
|
||||
|
@ -32,7 +31,7 @@ namespace CSVRender
|
|||
};
|
||||
|
||||
PathgridTag::PathgridTag(Pathgrid* pathgrid)
|
||||
: TagBase(SceneUtil::Mask_Pathgrid), mPathgrid(pathgrid)
|
||||
: TagBase(Mask_Pathgrid), mPathgrid(pathgrid)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -71,7 +70,7 @@ namespace CSVRender
|
|||
mBaseNode->setPosition(osg::Vec3f(mCoords.getX() * CoordScalar, mCoords.getY() * CoordScalar, 0.f));
|
||||
mBaseNode->setUserData(mTag);
|
||||
mBaseNode->setUpdateCallback(new PathgridNodeCallback());
|
||||
mBaseNode->setNodeMask(SceneUtil::Mask_Pathgrid);
|
||||
mBaseNode->setNodeMask(Mask_Pathgrid);
|
||||
mParent->addChild(mBaseNode);
|
||||
|
||||
mPathgridGeode = new osg::Geode();
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
#include <QPoint>
|
||||
|
||||
#include <components/sceneutil/pathgridutil.hpp>
|
||||
#include <components/sceneutil/vismask.hpp>
|
||||
|
||||
#include "../../model/prefs/state.hpp"
|
||||
|
||||
|
@ -16,6 +15,7 @@
|
|||
#include "../widget/scenetoolbar.hpp"
|
||||
|
||||
#include "cell.hpp"
|
||||
#include "mask.hpp"
|
||||
#include "pathgrid.hpp"
|
||||
#include "pathgridselectionmode.hpp"
|
||||
#include "worldspacewidget.hpp"
|
||||
|
@ -23,7 +23,7 @@
|
|||
namespace CSVRender
|
||||
{
|
||||
PathgridMode::PathgridMode(WorldspaceWidget* worldspaceWidget, QWidget* parent)
|
||||
: EditMode(worldspaceWidget, QIcon(":placeholder"), SceneUtil::Mask_Pathgrid | SceneUtil::Mask_Terrain | SceneUtil::Mask_EditorReference,
|
||||
: EditMode(worldspaceWidget, QIcon(":placeholder"), Mask_Pathgrid | Mask_Terrain | Mask_Reference,
|
||||
getTooltip(), parent)
|
||||
, mDragMode(DragMode_None)
|
||||
, mFromNode(0)
|
||||
|
@ -110,7 +110,7 @@ namespace CSVRender
|
|||
|
||||
void PathgridMode::primarySelectPressed(const WorldspaceHitResult& hit)
|
||||
{
|
||||
getWorldspaceWidget().clearSelection(SceneUtil::Mask_Pathgrid);
|
||||
getWorldspaceWidget().clearSelection(Mask_Pathgrid);
|
||||
|
||||
if (hit.tag)
|
||||
{
|
||||
|
@ -131,7 +131,7 @@ namespace CSVRender
|
|||
{
|
||||
if (tag->getPathgrid()->getId() != mLastId)
|
||||
{
|
||||
getWorldspaceWidget().clearSelection(SceneUtil::Mask_Pathgrid);
|
||||
getWorldspaceWidget().clearSelection(Mask_Pathgrid);
|
||||
mLastId = tag->getPathgrid()->getId();
|
||||
}
|
||||
|
||||
|
@ -142,12 +142,12 @@ namespace CSVRender
|
|||
}
|
||||
}
|
||||
|
||||
getWorldspaceWidget().clearSelection(SceneUtil::Mask_Pathgrid);
|
||||
getWorldspaceWidget().clearSelection(Mask_Pathgrid);
|
||||
}
|
||||
|
||||
bool PathgridMode::primaryEditStartDrag(const QPoint& pos)
|
||||
{
|
||||
std::vector<osg::ref_ptr<TagBase> > selection = getWorldspaceWidget().getSelection (SceneUtil::Mask_Pathgrid);
|
||||
std::vector<osg::ref_ptr<TagBase> > selection = getWorldspaceWidget().getSelection (Mask_Pathgrid);
|
||||
|
||||
if (CSMPrefs::get()["3D Scene Input"]["context-select"].isTrue())
|
||||
{
|
||||
|
@ -156,7 +156,7 @@ namespace CSVRender
|
|||
if (dynamic_cast<PathgridTag*>(hit.tag.get()))
|
||||
{
|
||||
primarySelectPressed(hit);
|
||||
selection = getWorldspaceWidget().getSelection (SceneUtil::Mask_Pathgrid);
|
||||
selection = getWorldspaceWidget().getSelection (Mask_Pathgrid);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -192,7 +192,7 @@ namespace CSVRender
|
|||
{
|
||||
if (mDragMode == DragMode_Move)
|
||||
{
|
||||
std::vector<osg::ref_ptr<TagBase> > selection = getWorldspaceWidget().getSelection(SceneUtil::Mask_Pathgrid);
|
||||
std::vector<osg::ref_ptr<TagBase> > selection = getWorldspaceWidget().getSelection(Mask_Pathgrid);
|
||||
|
||||
for (std::vector<osg::ref_ptr<TagBase> >::iterator it = selection.begin(); it != selection.end(); ++it)
|
||||
{
|
||||
|
@ -233,7 +233,7 @@ namespace CSVRender
|
|||
{
|
||||
if (mDragMode == DragMode_Move)
|
||||
{
|
||||
std::vector<osg::ref_ptr<TagBase> > selection = getWorldspaceWidget().getSelection (SceneUtil::Mask_Pathgrid);
|
||||
std::vector<osg::ref_ptr<TagBase> > selection = getWorldspaceWidget().getSelection (Mask_Pathgrid);
|
||||
for (std::vector<osg::ref_ptr<TagBase> >::iterator it = selection.begin(); it != selection.end(); ++it)
|
||||
{
|
||||
if (PathgridTag* tag = dynamic_cast<PathgridTag*>(it->get()))
|
||||
|
@ -272,11 +272,11 @@ namespace CSVRender
|
|||
}
|
||||
|
||||
mDragMode = DragMode_None;
|
||||
getWorldspaceWidget().reset(SceneUtil::Mask_Pathgrid);
|
||||
getWorldspaceWidget().reset(Mask_Pathgrid);
|
||||
}
|
||||
|
||||
void PathgridMode::dragAborted()
|
||||
{
|
||||
getWorldspaceWidget().reset(SceneUtil::Mask_Pathgrid);
|
||||
getWorldspaceWidget().reset(Mask_Pathgrid);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
namespace CSVRender
|
||||
{
|
||||
PathgridSelectionMode::PathgridSelectionMode(CSVWidget::SceneToolbar* parent, WorldspaceWidget& worldspaceWidget)
|
||||
: SelectionMode(parent, worldspaceWidget, SceneUtil::Mask_Pathgrid)
|
||||
: SelectionMode(parent, worldspaceWidget, Mask_Pathgrid)
|
||||
{
|
||||
mRemoveSelectedNodes = new QAction("Remove selected nodes", this);
|
||||
mRemoveSelectedEdges = new QAction("Remove edges between selected nodes", this);
|
||||
|
@ -37,7 +37,7 @@ namespace CSVRender
|
|||
|
||||
void PathgridSelectionMode::removeSelectedNodes()
|
||||
{
|
||||
std::vector<osg::ref_ptr<TagBase> > selection = getWorldspaceWidget().getSelection (SceneUtil::Mask_Pathgrid);
|
||||
std::vector<osg::ref_ptr<TagBase> > selection = getWorldspaceWidget().getSelection (Mask_Pathgrid);
|
||||
|
||||
for (std::vector<osg::ref_ptr<TagBase> >::iterator it = selection.begin(); it != selection.end(); ++it)
|
||||
{
|
||||
|
@ -54,7 +54,7 @@ namespace CSVRender
|
|||
|
||||
void PathgridSelectionMode::removeSelectedEdges()
|
||||
{
|
||||
std::vector<osg::ref_ptr<TagBase> > selection = getWorldspaceWidget().getSelection (SceneUtil::Mask_Pathgrid);
|
||||
std::vector<osg::ref_ptr<TagBase> > selection = getWorldspaceWidget().getSelection (Mask_Pathgrid);
|
||||
|
||||
for (std::vector<osg::ref_ptr<TagBase> >::iterator it = selection.begin(); it != selection.end(); ++it)
|
||||
{
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
#include <components/resource/scenemanager.hpp>
|
||||
#include <components/resource/resourcesystem.hpp>
|
||||
#include <components/sceneutil/lightmanager.hpp>
|
||||
#include <components/sceneutil/vismask.hpp>
|
||||
|
||||
#include "../widget/scenetoolmode.hpp"
|
||||
|
||||
|
@ -26,6 +25,7 @@
|
|||
#include "../../model/prefs/shortcuteventhandler.hpp"
|
||||
|
||||
#include "lighting.hpp"
|
||||
#include "mask.hpp"
|
||||
#include "cameracontroller.hpp"
|
||||
|
||||
namespace CSVRender
|
||||
|
@ -71,7 +71,7 @@ RenderWidget::RenderWidget(QWidget *parent, Qt::WindowFlags f)
|
|||
|
||||
SceneUtil::LightManager* lightMgr = new SceneUtil::LightManager;
|
||||
lightMgr->setStartLight(1);
|
||||
lightMgr->setLightingMask(SceneUtil::Mask_Lighting);
|
||||
lightMgr->setLightingMask(Mask_Lighting);
|
||||
mRootNode = lightMgr;
|
||||
|
||||
mView->getCamera()->getOrCreateStateSet()->setMode(GL_NORMALIZE, osg::StateAttribute::ON);
|
||||
|
@ -88,7 +88,7 @@ RenderWidget::RenderWidget(QWidget *parent, Qt::WindowFlags f)
|
|||
// Add ability to signal osg to show its statistics for debugging purposes
|
||||
mView->addEventHandler(new osgViewer::StatsHandler);
|
||||
|
||||
mView->getCamera()->setCullMask(~(SceneUtil::Mask_UpdateVisitor));
|
||||
mView->getCamera()->setCullMask(~(Mask_UpdateVisitor));
|
||||
|
||||
viewer.addView(mView);
|
||||
viewer.setDone(false);
|
||||
|
@ -122,7 +122,7 @@ void RenderWidget::flagAsModified()
|
|||
|
||||
void RenderWidget::setVisibilityMask(int mask)
|
||||
{
|
||||
mView->getCamera()->setCullMask(mask | SceneUtil::Mask_ParticleSystem | SceneUtil::Mask_Lighting);
|
||||
mView->getCamera()->setCullMask(mask | Mask_ParticleSystem | Mask_Lighting);
|
||||
}
|
||||
|
||||
osg::Camera *RenderWidget::getCamera()
|
||||
|
@ -212,7 +212,7 @@ SceneWidget::SceneWidget(std::shared_ptr<Resource::ResourceSystem> resourceSyste
|
|||
mOrbitCamControl = new OrbitCameraController(this);
|
||||
mCurrentCamControl = mFreeCamControl;
|
||||
|
||||
mOrbitCamControl->setPickingMask(SceneUtil::Mask_EditorReference | SceneUtil::Mask_Terrain);
|
||||
mOrbitCamControl->setPickingMask(Mask_Reference | Mask_Terrain);
|
||||
|
||||
mOrbitCamControl->setConstRoll( CSMPrefs::get()["3D Scene Input"]["navi-orbit-const-roll"].isTrue() );
|
||||
|
||||
|
@ -221,7 +221,7 @@ SceneWidget::SceneWidget(std::shared_ptr<Resource::ResourceSystem> resourceSyste
|
|||
|
||||
setLighting(&mLightingDay);
|
||||
|
||||
mResourceSystem->getSceneManager()->setParticleSystemMask(SceneUtil::Mask_ParticleSystem);
|
||||
mResourceSystem->getSceneManager()->setParticleSystemMask(Mask_ParticleSystem);
|
||||
|
||||
// Recieve mouse move event even if mouse button is not pressed
|
||||
setMouseTracking(true);
|
||||
|
@ -350,7 +350,7 @@ void SceneWidget::update(double dt)
|
|||
}
|
||||
else
|
||||
{
|
||||
mCurrentCamControl->setup(mRootNode, SceneUtil::Mask_EditorReference | SceneUtil::Mask_Terrain, CameraController::WorldUp);
|
||||
mCurrentCamControl->setup(mRootNode, Mask_Reference | Mask_Terrain, CameraController::WorldUp);
|
||||
mCamPositionSet = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
|
||||
#include "../widget/scenetoolmode.hpp"
|
||||
|
||||
#include "mask.hpp"
|
||||
|
||||
class QAction;
|
||||
|
||||
namespace CSVRender
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
|
||||
#include "tagbase.hpp"
|
||||
|
||||
CSVRender::TagBase::TagBase (SceneUtil::VisMask mask) : mMask (mask) {}
|
||||
CSVRender::TagBase::TagBase (Mask mask) : mMask (mask) {}
|
||||
|
||||
SceneUtil::VisMask CSVRender::TagBase::getMask() const
|
||||
CSVRender::Mask CSVRender::TagBase::getMask() const
|
||||
{
|
||||
return mMask;
|
||||
}
|
||||
|
|
|
@ -5,19 +5,19 @@
|
|||
|
||||
#include <QString>
|
||||
|
||||
#include <components/sceneutil/vismask.hpp>
|
||||
#include "mask.hpp"
|
||||
|
||||
namespace CSVRender
|
||||
{
|
||||
class TagBase : public osg::Referenced
|
||||
{
|
||||
SceneUtil::VisMask mMask;
|
||||
Mask mMask;
|
||||
|
||||
public:
|
||||
|
||||
TagBase (SceneUtil::VisMask mask);
|
||||
TagBase (Mask mask);
|
||||
|
||||
SceneUtil::VisMask getMask() const;
|
||||
Mask getMask() const;
|
||||
|
||||
virtual QString getToolTip (bool hideBasics) const;
|
||||
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
|
||||
#include <components/esm/loadland.hpp>
|
||||
#include <components/debug/debuglog.hpp>
|
||||
#include <components/sceneutil/vismask.hpp>
|
||||
|
||||
#include "../widget/brushshapes.hpp"
|
||||
#include "../widget/modebutton.hpp"
|
||||
|
@ -40,12 +39,13 @@
|
|||
#include "brushdraw.hpp"
|
||||
#include "editmode.hpp"
|
||||
#include "pagedworldspacewidget.hpp"
|
||||
#include "mask.hpp"
|
||||
#include "tagbase.hpp"
|
||||
#include "terrainselection.hpp"
|
||||
#include "worldspacewidget.hpp"
|
||||
|
||||
CSVRender::TerrainShapeMode::TerrainShapeMode (WorldspaceWidget *worldspaceWidget, osg::Group* parentNode, QWidget *parent)
|
||||
: EditMode (worldspaceWidget, QIcon {":scenetoolbar/editing-terrain-shape"}, SceneUtil::Mask_Terrain | SceneUtil::Mask_EditorReference, "Terrain land editing", parent),
|
||||
: EditMode (worldspaceWidget, QIcon {":scenetoolbar/editing-terrain-shape"}, Mask_Terrain | Mask_Reference, "Terrain land editing", parent),
|
||||
mParentNode(parentNode)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
#include <osg/Group>
|
||||
|
||||
#include <components/esm/loadland.hpp>
|
||||
#include <components/sceneutil/vismask.hpp>
|
||||
|
||||
#include "../widget/modebutton.hpp"
|
||||
#include "../widget/scenetoolbar.hpp"
|
||||
|
@ -37,11 +36,12 @@
|
|||
#include "brushdraw.hpp"
|
||||
#include "editmode.hpp"
|
||||
#include "pagedworldspacewidget.hpp"
|
||||
#include "mask.hpp"
|
||||
#include "object.hpp" // Something small needed regarding pointers from here ()
|
||||
#include "worldspacewidget.hpp"
|
||||
|
||||
CSVRender::TerrainTextureMode::TerrainTextureMode (WorldspaceWidget *worldspaceWidget, osg::Group* parentNode, QWidget *parent)
|
||||
: EditMode (worldspaceWidget, QIcon {":scenetoolbar/editing-terrain-texture"}, SceneUtil::Mask_Terrain | SceneUtil::Mask_EditorReference, "Terrain texture editing", parent),
|
||||
: EditMode (worldspaceWidget, QIcon {":scenetoolbar/editing-terrain-texture"}, Mask_Terrain | Mask_Reference, "Terrain texture editing", parent),
|
||||
mBrushTexture("L0#0"),
|
||||
mBrushSize(1),
|
||||
mBrushShape(CSVWidget::BrushShape_Point),
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include "../widget/scenetooltoggle2.hpp"
|
||||
|
||||
#include "cameracontroller.hpp"
|
||||
#include "mask.hpp"
|
||||
#include "tagbase.hpp"
|
||||
|
||||
void CSVRender::UnpagedWorldspaceWidget::update()
|
||||
|
@ -303,8 +304,8 @@ void CSVRender::UnpagedWorldspaceWidget::addVisibilitySelectorButtons (
|
|||
CSVWidget::SceneToolToggle2 *tool)
|
||||
{
|
||||
WorldspaceWidget::addVisibilitySelectorButtons (tool);
|
||||
tool->addButton (Button_Terrain, SceneUtil::Mask_Terrain, "Terrain", "", true);
|
||||
//tool->addButton (Button_Fog, Mask_Fog, "Fog");
|
||||
tool->addButton (Button_Terrain, Mask_Terrain, "Terrain", "", true);
|
||||
tool->addButton (Button_Fog, Mask_Fog, "Fog");
|
||||
}
|
||||
|
||||
std::string CSVRender::UnpagedWorldspaceWidget::getStartupInstruction()
|
||||
|
|
|
@ -26,9 +26,8 @@
|
|||
#include "../widget/scenetooltoggle2.hpp"
|
||||
#include "../widget/scenetoolrun.hpp"
|
||||
|
||||
#include <components/sceneutil/vismask.hpp>
|
||||
|
||||
#include "object.hpp"
|
||||
#include "mask.hpp"
|
||||
#include "instancemode.hpp"
|
||||
#include "pathgridmode.hpp"
|
||||
#include "cameracontroller.hpp"
|
||||
|
@ -139,7 +138,7 @@ void CSVRender::WorldspaceWidget::settingChanged (const CSMPrefs::Setting *setti
|
|||
{
|
||||
float alpha = setting->toDouble();
|
||||
// getSelection is virtual, thus this can not be called from the constructor
|
||||
auto selection = getSelection(SceneUtil::Mask_EditorReference);
|
||||
auto selection = getSelection(Mask_Reference);
|
||||
for (osg::ref_ptr<TagBase> tag : selection)
|
||||
{
|
||||
if (auto objTag = dynamic_cast<ObjectTag*>(tag.get()))
|
||||
|
@ -346,7 +345,7 @@ unsigned int CSVRender::WorldspaceWidget::getVisibilityMask() const
|
|||
|
||||
void CSVRender::WorldspaceWidget::setInteractionMask (unsigned int mask)
|
||||
{
|
||||
mInteractionMask = mask | SceneUtil::Mask_EditorCellMarker | SceneUtil::Mask_EditorCellArrow;
|
||||
mInteractionMask = mask | Mask_CellMarker | Mask_CellArrow;
|
||||
}
|
||||
|
||||
unsigned int CSVRender::WorldspaceWidget::getInteractionMask() const
|
||||
|
@ -362,9 +361,9 @@ void CSVRender::WorldspaceWidget::setEditLock (bool locked)
|
|||
void CSVRender::WorldspaceWidget::addVisibilitySelectorButtons (
|
||||
CSVWidget::SceneToolToggle2 *tool)
|
||||
{
|
||||
tool->addButton (Button_Reference, SceneUtil::Mask_EditorReference, "Instances");
|
||||
tool->addButton (Button_Water, SceneUtil::Mask_Water, "Water");
|
||||
tool->addButton (Button_Pathgrid, SceneUtil::Mask_Pathgrid, "Pathgrid");
|
||||
tool->addButton (Button_Reference, Mask_Reference, "Instances");
|
||||
tool->addButton (Button_Water, Mask_Water, "Water");
|
||||
tool->addButton (Button_Pathgrid, Mask_Pathgrid, "Pathgrid");
|
||||
}
|
||||
|
||||
void CSVRender::WorldspaceWidget::addEditModeSelectorButtons (CSVWidget::SceneToolMode *tool)
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include "../../model/world/tablemimedata.hpp"
|
||||
|
||||
#include "scenewidget.hpp"
|
||||
#include "mask.hpp"
|
||||
|
||||
namespace CSMPrefs
|
||||
{
|
||||
|
|
|
@ -18,7 +18,7 @@ set(GAME_HEADER
|
|||
source_group(game FILES ${GAME} ${GAME_HEADER})
|
||||
|
||||
add_openmw_dir (mwrender
|
||||
actors objects renderingmanager animation rotatecontroller sky npcanimation
|
||||
actors objects renderingmanager animation rotatecontroller sky npcanimation vismask
|
||||
creatureanimation effectmanager util renderinginterface pathgrid rendermode weaponanimation
|
||||
bulletdebugdraw globalmap characterpreview camera localmap water terrainstorage ripplesimulation
|
||||
renderbin actoranimation landmanager navmesh actorspaths recastmesh
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
|
||||
#include <components/compiler/extensions0.hpp>
|
||||
|
||||
#include <components/sceneutil/vismask.hpp>
|
||||
#include <components/sceneutil/workqueue.hpp>
|
||||
|
||||
#include <components/files/configurationmanager.hpp>
|
||||
|
@ -48,6 +47,8 @@
|
|||
#include "mwworld/player.hpp"
|
||||
#include "mwworld/worldimp.hpp"
|
||||
|
||||
#include "mwrender/vismask.hpp"
|
||||
|
||||
#include "mwclass/classes.hpp"
|
||||
|
||||
#include "mwdialogue/dialoguemanagerimp.hpp"
|
||||
|
@ -537,7 +538,7 @@ void OMW::Engine::prepareEngine (Settings::Manager & settings)
|
|||
std::string myguiResources = (mResDir / "mygui").string();
|
||||
osg::ref_ptr<osg::Group> guiRoot = new osg::Group;
|
||||
guiRoot->setName("GUI Root");
|
||||
guiRoot->setNodeMask(SceneUtil::Mask_GUI);
|
||||
guiRoot->setNodeMask(MWRender::Mask_GUI);
|
||||
rootNode->addChild(guiRoot);
|
||||
MWGui::WindowManager* window = new MWGui::WindowManager(mViewer, guiRoot, mResourceSystem.get(), mWorkQueue.get(),
|
||||
mCfgMgr.getLogPath().string() + std::string("/"), myguiResources,
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
#include <components/esm/loadacti.hpp>
|
||||
#include <components/misc/rng.hpp>
|
||||
#include <components/sceneutil/positionattitudetransform.hpp>
|
||||
#include <components/sceneutil/vismask.hpp>
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/windowmanager.hpp"
|
||||
|
@ -20,6 +19,7 @@
|
|||
|
||||
#include "../mwrender/objects.hpp"
|
||||
#include "../mwrender/renderinginterface.hpp"
|
||||
#include "../mwrender/vismask.hpp"
|
||||
|
||||
#include "../mwgui/tooltips.hpp"
|
||||
|
||||
|
@ -34,7 +34,7 @@ namespace MWClass
|
|||
if (!model.empty())
|
||||
{
|
||||
renderingInterface.getObjects().insertModel(ptr, model, true);
|
||||
ptr.getRefData().getBaseNode()->setNodeMask(SceneUtil::Mask_Static);
|
||||
ptr.getRefData().getBaseNode()->setNodeMask(MWRender::Mask_Static);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
#include <components/esm/loaddoor.hpp>
|
||||
#include <components/esm/doorstate.hpp>
|
||||
#include <components/sceneutil/positionattitudetransform.hpp>
|
||||
#include <components/sceneutil/vismask.hpp>
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/world.hpp"
|
||||
|
@ -26,6 +25,7 @@
|
|||
#include "../mwrender/objects.hpp"
|
||||
#include "../mwrender/renderinginterface.hpp"
|
||||
#include "../mwrender/animation.hpp"
|
||||
#include "../mwrender/vismask.hpp"
|
||||
|
||||
#include "../mwmechanics/actorutil.hpp"
|
||||
|
||||
|
@ -58,7 +58,7 @@ namespace MWClass
|
|||
if (!model.empty())
|
||||
{
|
||||
renderingInterface.getObjects().insertModel(ptr, model, true);
|
||||
ptr.getRefData().getBaseNode()->setNodeMask(SceneUtil::Mask_Static);
|
||||
ptr.getRefData().getBaseNode()->setNodeMask(MWRender::Mask_Static);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
#include <components/esm/loadstat.hpp>
|
||||
#include <components/sceneutil/positionattitudetransform.hpp>
|
||||
#include <components/sceneutil/vismask.hpp>
|
||||
|
||||
#include "../mwworld/ptr.hpp"
|
||||
#include "../mwphysics/physicssystem.hpp"
|
||||
|
@ -10,6 +9,7 @@
|
|||
|
||||
#include "../mwrender/objects.hpp"
|
||||
#include "../mwrender/renderinginterface.hpp"
|
||||
#include "../mwrender/vismask.hpp"
|
||||
|
||||
namespace MWClass
|
||||
{
|
||||
|
@ -19,7 +19,7 @@ namespace MWClass
|
|||
if (!model.empty())
|
||||
{
|
||||
renderingInterface.getObjects().insertModel(ptr, model);
|
||||
ptr.getRefData().getBaseNode()->setNodeMask(SceneUtil::Mask_Static);
|
||||
ptr.getRefData().getBaseNode()->setNodeMask(MWRender::Mask_Static);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -14,13 +14,14 @@
|
|||
#include <components/myguiplatform/myguitexture.hpp>
|
||||
#include <components/settings/settings.hpp>
|
||||
#include <components/vfs/manager.hpp>
|
||||
#include <components/sceneutil/vismask.hpp>
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/statemanager.hpp"
|
||||
#include "../mwbase/windowmanager.hpp"
|
||||
#include "../mwbase/inputmanager.hpp"
|
||||
|
||||
#include "../mwrender/vismask.hpp"
|
||||
|
||||
#include "backgroundimage.hpp"
|
||||
|
||||
namespace MWGui
|
||||
|
@ -334,8 +335,8 @@ namespace MWGui
|
|||
// Turn off rendering except the GUI
|
||||
int oldUpdateMask = mViewer->getUpdateVisitor()->getTraversalMask();
|
||||
int oldCullMask = mViewer->getCamera()->getCullMask();
|
||||
mViewer->getUpdateVisitor()->setTraversalMask(SceneUtil::Mask_GUI|SceneUtil::Mask_PreCompile);
|
||||
mViewer->getCamera()->setCullMask(SceneUtil::Mask_GUI|SceneUtil::Mask_PreCompile);
|
||||
mViewer->getUpdateVisitor()->setTraversalMask(MWRender::Mask_GUI|MWRender::Mask_PreCompile);
|
||||
mViewer->getCamera()->setCullMask(MWRender::Mask_GUI|MWRender::Mask_PreCompile);
|
||||
|
||||
MWBase::Environment::get().getInputManager()->update(0, true, true);
|
||||
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
#include <components/resource/resourcesystem.hpp>
|
||||
#include <components/resource/imagemanager.hpp>
|
||||
|
||||
#include <components/sceneutil/vismask.hpp>
|
||||
#include <components/sceneutil/workqueue.hpp>
|
||||
|
||||
#include <components/translation/translation.hpp>
|
||||
|
@ -51,6 +50,8 @@
|
|||
#include "../mwbase/soundmanager.hpp"
|
||||
#include "../mwbase/world.hpp"
|
||||
|
||||
#include "../mwrender/vismask.hpp"
|
||||
|
||||
#include "../mwworld/class.hpp"
|
||||
#include "../mwworld/player.hpp"
|
||||
#include "../mwworld/cellstore.hpp"
|
||||
|
@ -1878,8 +1879,8 @@ namespace MWGui
|
|||
// Turn off all rendering except for the GUI
|
||||
int oldUpdateMask = mViewer->getUpdateVisitor()->getTraversalMask();
|
||||
int oldCullMask = mViewer->getCamera()->getCullMask();
|
||||
mViewer->getUpdateVisitor()->setTraversalMask(SceneUtil::Mask_GUI);
|
||||
mViewer->getCamera()->setCullMask(SceneUtil::Mask_GUI);
|
||||
mViewer->getUpdateVisitor()->setTraversalMask(MWRender::Mask_GUI);
|
||||
mViewer->getCamera()->setCullMask(MWRender::Mask_GUI);
|
||||
|
||||
MyGUI::IntSize screenSize = MyGUI::RenderManager::getInstance().getViewSize();
|
||||
sizeVideo(screenSize.width, screenSize.height);
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
#include <components/esm/esmwriter.hpp>
|
||||
|
||||
#include <components/sceneutil/positionattitudetransform.hpp>
|
||||
#include <components/sceneutil/vismask.hpp>
|
||||
#include <components/debug/debuglog.hpp>
|
||||
#include <components/misc/rng.hpp>
|
||||
#include <components/settings/settings.hpp>
|
||||
|
@ -25,6 +24,8 @@
|
|||
|
||||
#include "../mwmechanics/aibreathe.hpp"
|
||||
|
||||
#include "../mwrender/vismask.hpp"
|
||||
|
||||
#include "spellcasting.hpp"
|
||||
#include "steering.hpp"
|
||||
#include "npcstats.hpp"
|
||||
|
@ -1422,11 +1423,11 @@ namespace MWMechanics
|
|||
const float dist = (player.getRefData().getPosition().asVec3() - ptr.getRefData().getPosition().asVec3()).length();
|
||||
if (dist > mActorsProcessingRange)
|
||||
{
|
||||
ptr.getRefData().getBaseNode()->setNodeMask(SceneUtil::Mask_Disabled);
|
||||
ptr.getRefData().getBaseNode()->setNodeMask(0);
|
||||
return;
|
||||
}
|
||||
else
|
||||
ptr.getRefData().getBaseNode()->setNodeMask(SceneUtil::Mask_Actor);
|
||||
ptr.getRefData().getBaseNode()->setNodeMask(MWRender::Mask_Actor);
|
||||
|
||||
// Fade away actors on large distance (>90% of actor's processing distance)
|
||||
float visibilityRatio = 1.0;
|
||||
|
@ -1750,12 +1751,12 @@ namespace MWMechanics
|
|||
|
||||
if (!inRange)
|
||||
{
|
||||
iter->first.getRefData().getBaseNode()->setNodeMask(SceneUtil::Mask_Disabled);
|
||||
iter->first.getRefData().getBaseNode()->setNodeMask(0);
|
||||
world->setActorCollisionMode(iter->first, false, false);
|
||||
continue;
|
||||
}
|
||||
else if (!isPlayer)
|
||||
iter->first.getRefData().getBaseNode()->setNodeMask(SceneUtil::Mask_Actor);
|
||||
iter->first.getRefData().getBaseNode()->setNodeMask(MWRender::Mask_Actor);
|
||||
|
||||
const bool isDead = iter->first.getClass().getCreatureStats(iter->first).isDead();
|
||||
if (!isDead && iter->first.getClass().getCreatureStats(iter->first).isParalyzed())
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
#include <components/sceneutil/lightmanager.hpp>
|
||||
#include <components/sceneutil/lightutil.hpp>
|
||||
#include <components/sceneutil/visitor.hpp>
|
||||
#include <components/sceneutil/vismask.hpp>
|
||||
|
||||
#include <components/misc/stringops.hpp>
|
||||
|
||||
|
@ -32,6 +31,8 @@
|
|||
#include "../mwmechanics/actorutil.hpp"
|
||||
#include "../mwmechanics/weapontype.hpp"
|
||||
|
||||
#include "vismask.hpp"
|
||||
|
||||
namespace MWRender
|
||||
{
|
||||
|
||||
|
@ -366,7 +367,7 @@ void ActorAnimation::updateHolsteredWeapon(bool showHolsteredWeapons)
|
|||
// Otherwise add the enchanted glow to it.
|
||||
if (!showHolsteredWeapons)
|
||||
{
|
||||
weaponNode->setNodeMask(SceneUtil::Mask_Disabled);
|
||||
weaponNode->setNodeMask(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -540,7 +541,7 @@ void ActorAnimation::addHiddenItemLight(const MWWorld::ConstPtr& item, const ESM
|
|||
bool exterior = mPtr.isInCell() && mPtr.getCell()->getCell()->isExterior();
|
||||
|
||||
osg::Vec4f ambient(1,1,1,1);
|
||||
osg::ref_ptr<SceneUtil::LightSource> lightSource = SceneUtil::createLightSource(esmLight, exterior, ambient);
|
||||
osg::ref_ptr<SceneUtil::LightSource> lightSource = SceneUtil::createLightSource(esmLight, Mask_Lighting, exterior, ambient);
|
||||
|
||||
mInsert->addChild(lightSource);
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include "actorspaths.hpp"
|
||||
#include "vismask.hpp"
|
||||
|
||||
#include <components/sceneutil/agentpath.hpp>
|
||||
#include <components/sceneutil/vismask.hpp>
|
||||
|
||||
#include <osg/PositionAttitudeTransform>
|
||||
|
||||
|
@ -43,7 +43,7 @@ namespace MWRender
|
|||
const auto newGroup = SceneUtil::createAgentPathGroup(path, halfExtents, start, end, settings);
|
||||
if (newGroup)
|
||||
{
|
||||
newGroup->setNodeMask(SceneUtil::Mask_Debug);
|
||||
newGroup->setNodeMask(Mask_Debug);
|
||||
mRootNode->addChild(newGroup);
|
||||
mGroups[actor] = newGroup;
|
||||
}
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
#include <components/sceneutil/actorutil.hpp>
|
||||
#include <components/sceneutil/statesetupdater.hpp>
|
||||
#include <components/sceneutil/visitor.hpp>
|
||||
#include <components/sceneutil/vismask.hpp>
|
||||
#include <components/sceneutil/lightmanager.hpp>
|
||||
#include <components/sceneutil/lightutil.hpp>
|
||||
#include <components/sceneutil/skeleton.hpp>
|
||||
|
@ -45,6 +44,7 @@
|
|||
|
||||
#include "../mwmechanics/character.hpp" // FIXME: for MWMechanics::Priority
|
||||
|
||||
#include "vismask.hpp"
|
||||
#include "util.hpp"
|
||||
#include "rotatecontroller.hpp"
|
||||
|
||||
|
@ -578,7 +578,7 @@ namespace MWRender
|
|||
else
|
||||
{
|
||||
// Hide effect immediately
|
||||
node->setNodeMask(SceneUtil::Mask_Disabled);
|
||||
node->setNodeMask(0);
|
||||
mFinished = true;
|
||||
}
|
||||
}
|
||||
|
@ -1595,7 +1595,7 @@ namespace MWRender
|
|||
{
|
||||
bool exterior = mPtr.isInCell() && mPtr.getCell()->getCell()->isExterior();
|
||||
|
||||
SceneUtil::addLight(parent, esmLight, exterior);
|
||||
SceneUtil::addLight(parent, esmLight, Mask_ParticleSystem, Mask_Lighting, exterior);
|
||||
}
|
||||
|
||||
void Animation::addEffect (const std::string& model, int effectId, bool loop, const std::string& bonename, const std::string& texture)
|
||||
|
@ -1647,7 +1647,7 @@ namespace MWRender
|
|||
// FreezeOnCull doesn't work so well with effect particles, that tend to have moving emitters
|
||||
SceneUtil::DisableFreezeOnCullVisitor disableFreezeOnCullVisitor;
|
||||
node->accept(disableFreezeOnCullVisitor);
|
||||
node->setNodeMask(SceneUtil::Mask_Effect);
|
||||
node->setNodeMask(Mask_Effect);
|
||||
|
||||
params.mMaxControllerLength = findMaxLengthVisitor.getMaxLength();
|
||||
params.mLoop = loop;
|
||||
|
@ -1806,7 +1806,7 @@ namespace MWRender
|
|||
SceneUtil::configureLight(light, radius, isExterior);
|
||||
|
||||
mGlowLight = new SceneUtil::LightSource;
|
||||
mGlowLight->setNodeMask(SceneUtil::Mask_Lighting);
|
||||
mGlowLight->setNodeMask(Mask_Lighting);
|
||||
mInsert->addChild(mGlowLight);
|
||||
mGlowLight->setLight(light);
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
#include <components/debug/debuglog.hpp>
|
||||
|
||||
#include <components/sceneutil/vismask.hpp>
|
||||
#include "vismask.hpp"
|
||||
|
||||
namespace
|
||||
{
|
||||
|
@ -34,7 +34,7 @@ void DebugDrawer::createGeometry()
|
|||
if (!mGeometry)
|
||||
{
|
||||
mGeometry = new osg::Geometry;
|
||||
mGeometry->setNodeMask(SceneUtil::Mask_Debug);
|
||||
mGeometry->setNodeMask(Mask_Debug);
|
||||
|
||||
mVertices = new osg::Vec3Array;
|
||||
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
#include <components/fallback/fallback.hpp>
|
||||
#include <components/sceneutil/lightmanager.hpp>
|
||||
#include <components/sceneutil/shadow.hpp>
|
||||
#include <components/sceneutil/vismask.hpp>
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/world.hpp"
|
||||
|
@ -28,6 +27,7 @@
|
|||
#include "../mwmechanics/weapontype.hpp"
|
||||
|
||||
#include "npcanimation.hpp"
|
||||
#include "vismask.hpp"
|
||||
|
||||
namespace MWRender
|
||||
{
|
||||
|
@ -61,7 +61,7 @@ namespace MWRender
|
|||
}
|
||||
else
|
||||
{
|
||||
node->setNodeMask(SceneUtil::Mask_Disabled);
|
||||
node->setNodeMask(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -138,9 +138,9 @@ namespace MWRender
|
|||
mCamera->attach(osg::Camera::COLOR_BUFFER, mTexture);
|
||||
mCamera->setName("CharacterPreview");
|
||||
mCamera->setComputeNearFarMode(osg::Camera::COMPUTE_NEAR_FAR_USING_BOUNDING_VOLUMES);
|
||||
mCamera->setCullMask(~(SceneUtil::Mask_UpdateVisitor));
|
||||
mCamera->setCullMask(~(Mask_UpdateVisitor));
|
||||
|
||||
mCamera->setNodeMask(SceneUtil::Mask_RenderToTexture);
|
||||
mCamera->setNodeMask(Mask_RenderToTexture);
|
||||
|
||||
osg::ref_ptr<SceneUtil::LightManager> lightManager = new SceneUtil::LightManager;
|
||||
lightManager->setStartLight(1);
|
||||
|
@ -255,7 +255,7 @@ namespace MWRender
|
|||
|
||||
void CharacterPreview::redraw()
|
||||
{
|
||||
mCamera->setNodeMask(SceneUtil::Mask_RenderToTexture);
|
||||
mCamera->setNodeMask(Mask_RenderToTexture);
|
||||
mDrawOnceCallback->redrawNextFrame();
|
||||
}
|
||||
|
||||
|
@ -364,7 +364,7 @@ namespace MWRender
|
|||
visitor.setTraversalNumber(mDrawOnceCallback->getLastRenderedFrame());
|
||||
|
||||
osg::Node::NodeMask nodeMask = mCamera->getNodeMask();
|
||||
mCamera->setNodeMask(SceneUtil::Mask_Default);
|
||||
mCamera->setNodeMask(~0);
|
||||
mCamera->accept(visitor);
|
||||
mCamera->setNodeMask(nodeMask);
|
||||
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
#include <components/resource/scenemanager.hpp>
|
||||
|
||||
#include <components/sceneutil/controller.hpp>
|
||||
#include <components/sceneutil/vismask.hpp>
|
||||
|
||||
#include "animation.hpp"
|
||||
#include "vismask.hpp"
|
||||
#include "util.hpp"
|
||||
|
||||
namespace MWRender
|
||||
|
@ -29,7 +29,7 @@ void EffectManager::addEffect(const std::string &model, const std::string& textu
|
|||
{
|
||||
osg::ref_ptr<osg::Node> node = mResourceSystem->getSceneManager()->getInstance(model);
|
||||
|
||||
node->setNodeMask(SceneUtil::Mask_Effect);
|
||||
node->setNodeMask(Mask_Effect);
|
||||
|
||||
Effect effect;
|
||||
effect.mAnimTime.reset(new EffectAnimationTime);
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
#include <components/debug/debuglog.hpp>
|
||||
|
||||
#include <components/sceneutil/workqueue.hpp>
|
||||
#include <components/sceneutil/vismask.hpp>
|
||||
|
||||
#include <components/esm/globalmap.hpp>
|
||||
|
||||
|
@ -25,6 +24,8 @@
|
|||
|
||||
#include "../mwworld/esmstore.hpp"
|
||||
|
||||
#include "vismask.hpp"
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
|
@ -75,7 +76,7 @@ namespace
|
|||
{
|
||||
if (mParent->copyResult(static_cast<osg::Camera*>(node), nv->getTraversalNumber()))
|
||||
{
|
||||
node->setNodeMask(SceneUtil::Mask_Disabled);
|
||||
node->setNodeMask(0);
|
||||
mParent->markForRemoval(static_cast<osg::Camera*>(node));
|
||||
}
|
||||
return;
|
||||
|
@ -287,7 +288,7 @@ namespace MWRender
|
|||
float srcLeft, float srcTop, float srcRight, float srcBottom)
|
||||
{
|
||||
osg::ref_ptr<osg::Camera> camera (new osg::Camera);
|
||||
camera->setNodeMask(SceneUtil::Mask_RenderToTexture);
|
||||
camera->setNodeMask(Mask_RenderToTexture);
|
||||
camera->setReferenceFrame(osg::Camera::ABSOLUTE_RF);
|
||||
camera->setViewMatrix(osg::Matrix::identity());
|
||||
camera->setProjectionMatrix(osg::Matrix::identity());
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
#include <components/settings/settings.hpp>
|
||||
#include <components/sceneutil/visitor.hpp>
|
||||
#include <components/sceneutil/shadow.hpp>
|
||||
#include <components/sceneutil/vismask.hpp>
|
||||
#include <components/files/memorystream.hpp>
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
|
@ -26,6 +25,8 @@
|
|||
|
||||
#include "../mwworld/cellstore.hpp"
|
||||
|
||||
#include "vismask.hpp"
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
|
@ -41,7 +42,7 @@ namespace
|
|||
virtual void operator()(osg::Node* node, osg::NodeVisitor*)
|
||||
{
|
||||
if (mRendered)
|
||||
node->setNodeMask(SceneUtil::Mask_Disabled);
|
||||
node->setNodeMask(0);
|
||||
|
||||
if (!mRendered)
|
||||
{
|
||||
|
@ -177,8 +178,8 @@ osg::ref_ptr<osg::Camera> LocalMap::createOrthographicCamera(float x, float y, f
|
|||
camera->setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
camera->setRenderOrder(osg::Camera::PRE_RENDER);
|
||||
|
||||
camera->setCullMask(SceneUtil::Mask_Scene | SceneUtil::Mask_SimpleWater | SceneUtil::Mask_Terrain | SceneUtil::Mask_Object | SceneUtil::Mask_Static);
|
||||
camera->setNodeMask(SceneUtil::Mask_RenderToTexture);
|
||||
camera->setCullMask(Mask_Scene | Mask_SimpleWater | Mask_Terrain | Mask_Object | Mask_Static);
|
||||
camera->setNodeMask(Mask_RenderToTexture);
|
||||
|
||||
osg::ref_ptr<osg::StateSet> stateset = new osg::StateSet;
|
||||
stateset->setAttribute(new osg::PolygonMode(osg::PolygonMode::FRONT_AND_BACK, osg::PolygonMode::FILL), osg::StateAttribute::OVERRIDE);
|
||||
|
@ -375,7 +376,7 @@ void LocalMap::requestExteriorMap(const MWWorld::CellStore* cell)
|
|||
void LocalMap::requestInteriorMap(const MWWorld::CellStore* cell)
|
||||
{
|
||||
osg::ComputeBoundsVisitor computeBoundsVisitor;
|
||||
computeBoundsVisitor.setTraversalMask(SceneUtil::Mask_Scene | SceneUtil::Mask_Terrain | SceneUtil::Mask_Object | SceneUtil::Mask_Static);
|
||||
computeBoundsVisitor.setTraversalMask(Mask_Scene | Mask_Terrain | Mask_Object | Mask_Static);
|
||||
mSceneRoot->accept(computeBoundsVisitor);
|
||||
|
||||
osg::BoundingBox bounds = computeBoundsVisitor.getBoundingBox();
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include "navmesh.hpp"
|
||||
#include "vismask.hpp"
|
||||
|
||||
#include <components/sceneutil/navmesh.hpp>
|
||||
#include <components/sceneutil/vismask.hpp>
|
||||
|
||||
#include <osg/PositionAttitudeTransform>
|
||||
|
||||
|
@ -45,7 +45,7 @@ namespace MWRender
|
|||
mGroup = SceneUtil::createNavMeshGroup(navMesh, settings);
|
||||
if (mGroup)
|
||||
{
|
||||
mGroup->setNodeMask(SceneUtil::Mask_Debug);
|
||||
mGroup->setNodeMask(Mask_Debug);
|
||||
mRootNode->addChild(mGroup);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
#include <components/sceneutil/actorutil.hpp>
|
||||
#include <components/sceneutil/attach.hpp>
|
||||
#include <components/sceneutil/visitor.hpp>
|
||||
#include <components/sceneutil/vismask.hpp>
|
||||
#include <components/sceneutil/skeleton.hpp>
|
||||
|
||||
#include <components/settings/settings.hpp>
|
||||
|
@ -44,6 +43,7 @@
|
|||
#include "camera.hpp"
|
||||
#include "rotatecontroller.hpp"
|
||||
#include "renderbin.hpp"
|
||||
#include "vismask.hpp"
|
||||
|
||||
namespace
|
||||
{
|
||||
|
@ -538,7 +538,7 @@ void NpcAnimation::updateNpcBase()
|
|||
|
||||
addAnimSource(smodel, smodel);
|
||||
|
||||
mObjectRoot->setNodeMask(SceneUtil::Mask_FirstPerson);
|
||||
mObjectRoot->setNodeMask(Mask_FirstPerson);
|
||||
mObjectRoot->addCullCallback(new OverrideFieldOfViewCallback(mFirstPersonFieldOfView));
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
|
||||
#include <components/sceneutil/positionattitudetransform.hpp>
|
||||
#include <components/sceneutil/unrefqueue.hpp>
|
||||
#include <components/sceneutil/vismask.hpp>
|
||||
|
||||
#include "../mwworld/ptr.hpp"
|
||||
#include "../mwworld/class.hpp"
|
||||
|
@ -13,6 +12,8 @@
|
|||
#include "animation.hpp"
|
||||
#include "npcanimation.hpp"
|
||||
#include "creatureanimation.hpp"
|
||||
#include "vismask.hpp"
|
||||
|
||||
|
||||
namespace MWRender
|
||||
{
|
||||
|
@ -70,7 +71,7 @@ void Objects::insertBegin(const MWWorld::Ptr& ptr)
|
|||
void Objects::insertModel(const MWWorld::Ptr &ptr, const std::string &mesh, bool animated, bool allowLight)
|
||||
{
|
||||
insertBegin(ptr);
|
||||
ptr.getRefData().getBaseNode()->setNodeMask(SceneUtil::Mask_Object);
|
||||
ptr.getRefData().getBaseNode()->setNodeMask(Mask_Object);
|
||||
|
||||
osg::ref_ptr<ObjectAnimation> anim (new ObjectAnimation(ptr, mesh, mResourceSystem, animated, allowLight));
|
||||
|
||||
|
@ -80,7 +81,7 @@ void Objects::insertModel(const MWWorld::Ptr &ptr, const std::string &mesh, bool
|
|||
void Objects::insertCreature(const MWWorld::Ptr &ptr, const std::string &mesh, bool weaponsShields)
|
||||
{
|
||||
insertBegin(ptr);
|
||||
ptr.getRefData().getBaseNode()->setNodeMask(SceneUtil::Mask_Actor);
|
||||
ptr.getRefData().getBaseNode()->setNodeMask(Mask_Actor);
|
||||
|
||||
// CreatureAnimation
|
||||
osg::ref_ptr<Animation> anim;
|
||||
|
@ -97,7 +98,7 @@ void Objects::insertCreature(const MWWorld::Ptr &ptr, const std::string &mesh, b
|
|||
void Objects::insertNPC(const MWWorld::Ptr &ptr)
|
||||
{
|
||||
insertBegin(ptr);
|
||||
ptr.getRefData().getBaseNode()->setNodeMask(SceneUtil::Mask_Actor);
|
||||
ptr.getRefData().getBaseNode()->setNodeMask(Mask_Actor);
|
||||
|
||||
osg::ref_ptr<NpcAnimation> anim (new NpcAnimation(ptr, osg::ref_ptr<osg::Group>(ptr.getRefData().getBaseNode()), mResourceSystem));
|
||||
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
|
||||
#include <components/esm/loadpgrd.hpp>
|
||||
#include <components/sceneutil/pathgridutil.hpp>
|
||||
#include <components/sceneutil/vismask.hpp>
|
||||
|
||||
#include "../mwbase/world.hpp" // these includes can be removed once the static-hack is gone
|
||||
#include "../mwbase/environment.hpp"
|
||||
|
@ -18,6 +17,8 @@
|
|||
#include "../mwmechanics/pathfinding.hpp"
|
||||
#include "../mwmechanics/coordinateconverter.hpp"
|
||||
|
||||
#include "vismask.hpp"
|
||||
|
||||
namespace MWRender
|
||||
{
|
||||
|
||||
|
@ -72,7 +73,7 @@ void Pathgrid::togglePathgrid()
|
|||
{
|
||||
// add path grid meshes to already loaded cells
|
||||
mPathGridRoot = new osg::Group;
|
||||
mPathGridRoot->setNodeMask(SceneUtil::Mask_Pathgrid);
|
||||
mPathGridRoot->setNodeMask(Mask_Debug);
|
||||
mRootNode->addChild(mPathGridRoot);
|
||||
|
||||
for(const MWWorld::CellStore* cell : mActiveCells)
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
#include "recastmesh.hpp"
|
||||
|
||||
#include <components/sceneutil/vismask.hpp>
|
||||
#include <components/sceneutil/recastmesh.hpp>
|
||||
#include <components/debug/debuglog.hpp>
|
||||
|
||||
#include <osg/PositionAttitudeTransform>
|
||||
|
||||
#include "vismask.hpp"
|
||||
|
||||
namespace MWRender
|
||||
{
|
||||
RecastMesh::RecastMesh(const osg::ref_ptr<osg::Group>& root, bool enabled)
|
||||
|
@ -49,7 +50,7 @@ namespace MWRender
|
|||
|| it->second.mRevision != tile->second->getRevision())
|
||||
{
|
||||
const auto group = SceneUtil::createRecastMeshGroup(*tile->second, settings);
|
||||
group->setNodeMask(SceneUtil::Mask_Debug);
|
||||
group->setNodeMask(Mask_Debug);
|
||||
mRootNode->removeChild(it->second.mValue);
|
||||
mRootNode->addChild(group);
|
||||
it->second.mValue = group;
|
||||
|
@ -66,7 +67,7 @@ namespace MWRender
|
|||
if (mGroups.count(tile.first))
|
||||
continue;
|
||||
const auto group = SceneUtil::createRecastMeshGroup(*tile.second, settings);
|
||||
group->setNodeMask(SceneUtil::Mask_Debug);
|
||||
group->setNodeMask(Mask_Debug);
|
||||
mGroups.emplace(tile.first, Group {tile.second->getGeneration(), tile.second->getRevision(), group});
|
||||
mRootNode->addChild(group);
|
||||
}
|
||||
|
|
|
@ -40,7 +40,6 @@
|
|||
#include <components/sceneutil/unrefqueue.hpp>
|
||||
#include <components/sceneutil/writescene.hpp>
|
||||
#include <components/sceneutil/shadow.hpp>
|
||||
#include <components/sceneutil/vismask.hpp>
|
||||
|
||||
#include <components/terrain/terraingrid.hpp>
|
||||
#include <components/terrain/quadtreeworld.hpp>
|
||||
|
@ -59,6 +58,7 @@
|
|||
#include "sky.hpp"
|
||||
#include "effectmanager.hpp"
|
||||
#include "npcanimation.hpp"
|
||||
#include "vismask.hpp"
|
||||
#include "pathgrid.hpp"
|
||||
#include "camera.hpp"
|
||||
#include "water.hpp"
|
||||
|
@ -216,7 +216,7 @@ namespace MWRender
|
|||
, mFieldOfViewOverride(0.f)
|
||||
, mBorders(false)
|
||||
{
|
||||
resourceSystem->getSceneManager()->setParticleSystemMask(SceneUtil::Mask_ParticleSystem);
|
||||
resourceSystem->getSceneManager()->setParticleSystemMask(MWRender::Mask_ParticleSystem);
|
||||
resourceSystem->getSceneManager()->setShaderPath(resourcePath + "/shaders");
|
||||
// Shadows and radial fog have problems with fixed-function mode
|
||||
bool forceShaders = Settings::Manager::getBool("radial fog", "Shaders") || Settings::Manager::getBool("force shaders", "Shaders") || Settings::Manager::getBool("enable shadows", "Shadows");
|
||||
|
@ -230,21 +230,21 @@ namespace MWRender
|
|||
resourceSystem->getSceneManager()->setSpecularMapPattern(Settings::Manager::getString("specular map pattern", "Shaders"));
|
||||
|
||||
osg::ref_ptr<SceneUtil::LightManager> sceneRoot = new SceneUtil::LightManager;
|
||||
sceneRoot->setLightingMask(SceneUtil::Mask_Lighting);
|
||||
sceneRoot->setLightingMask(Mask_Lighting);
|
||||
mSceneRoot = sceneRoot;
|
||||
sceneRoot->setStartLight(1);
|
||||
|
||||
int shadowCastingTraversalMask = SceneUtil::Mask_Scene;
|
||||
int shadowCastingTraversalMask = Mask_Scene;
|
||||
if (Settings::Manager::getBool("actor shadows", "Shadows"))
|
||||
shadowCastingTraversalMask |= SceneUtil::Mask_Actor;
|
||||
shadowCastingTraversalMask |= Mask_Actor;
|
||||
if (Settings::Manager::getBool("player shadows", "Shadows"))
|
||||
shadowCastingTraversalMask |= SceneUtil::Mask_Player;
|
||||
shadowCastingTraversalMask |= Mask_Player;
|
||||
if (Settings::Manager::getBool("terrain shadows", "Shadows"))
|
||||
shadowCastingTraversalMask |= SceneUtil::Mask_Terrain;
|
||||
shadowCastingTraversalMask |= Mask_Terrain;
|
||||
|
||||
int indoorShadowCastingTraversalMask = shadowCastingTraversalMask;
|
||||
if (Settings::Manager::getBool("object shadows", "Shadows"))
|
||||
shadowCastingTraversalMask |= (SceneUtil::Mask_Object|SceneUtil::Mask_Static);
|
||||
shadowCastingTraversalMask |= (Mask_Object|Mask_Static);
|
||||
|
||||
mShadowManager.reset(new SceneUtil::ShadowManager(sceneRoot, mRootNode, shadowCastingTraversalMask, indoorShadowCastingTraversalMask, mResourceSystem->getSceneManager()->getShaderManager()));
|
||||
|
||||
|
@ -311,10 +311,11 @@ namespace MWRender
|
|||
float maxCompGeometrySize = Settings::Manager::getFloat("max composite geometry size", "Terrain");
|
||||
maxCompGeometrySize = std::max(maxCompGeometrySize, 1.f);
|
||||
mTerrain.reset(new Terrain::QuadTreeWorld(
|
||||
sceneRoot, mRootNode, mResourceSystem, mTerrainStorage, compMapResolution, compMapLevel, lodFactor, vertexLodMod, maxCompGeometrySize));
|
||||
sceneRoot, mRootNode, mResourceSystem, mTerrainStorage, Mask_Terrain, Mask_PreCompile, Mask_Debug,
|
||||
compMapResolution, compMapLevel, lodFactor, vertexLodMod, maxCompGeometrySize));
|
||||
}
|
||||
else
|
||||
mTerrain.reset(new Terrain::TerrainGrid(sceneRoot, mRootNode, mResourceSystem, mTerrainStorage));
|
||||
mTerrain.reset(new Terrain::TerrainGrid(sceneRoot, mRootNode, mResourceSystem, mTerrainStorage, Mask_Terrain, Mask_PreCompile, Mask_Debug));
|
||||
|
||||
mTerrain->setTargetFrameRate(Settings::Manager::getFloat("target framerate", "Cells"));
|
||||
mTerrain->setWorkQueue(mWorkQueue.get());
|
||||
|
@ -324,7 +325,7 @@ namespace MWRender
|
|||
mViewer->setLightingMode(osgViewer::View::NO_LIGHT);
|
||||
|
||||
osg::ref_ptr<osg::LightSource> source = new osg::LightSource;
|
||||
source->setNodeMask(SceneUtil::Mask_Lighting);
|
||||
source->setNodeMask(Mask_Lighting);
|
||||
mSunLight = new osg::Light;
|
||||
source->setLight(mSunLight);
|
||||
mSunLight->setDiffuse(osg::Vec4f(0,0,0,1));
|
||||
|
@ -343,7 +344,7 @@ namespace MWRender
|
|||
defaultMat->setSpecular(osg::Material::FRONT_AND_BACK, osg::Vec4f(0.f, 0.f, 0.f, 0.f));
|
||||
sceneRoot->getOrCreateStateSet()->setAttribute(defaultMat);
|
||||
|
||||
sceneRoot->setNodeMask(SceneUtil::Mask_Scene);
|
||||
sceneRoot->setNodeMask(Mask_Scene);
|
||||
sceneRoot->setName("Scene Root");
|
||||
|
||||
mSky.reset(new SkyManager(sceneRoot, resourceSystem->getSceneManager()));
|
||||
|
@ -371,7 +372,7 @@ namespace MWRender
|
|||
mViewer->getCamera()->setComputeNearFarMode(osg::Camera::DO_NOT_COMPUTE_NEAR_FAR);
|
||||
mViewer->getCamera()->setCullingMode(cullingMode);
|
||||
|
||||
mViewer->getCamera()->setCullMask(~(SceneUtil::Mask_UpdateVisitor|SceneUtil::Mask_SimpleWater));
|
||||
mViewer->getCamera()->setCullMask(~(Mask_UpdateVisitor|Mask_SimpleWater));
|
||||
|
||||
mNearClip = Settings::Manager::getFloat("near clip", "Camera");
|
||||
mViewDistance = Settings::Manager::getFloat("viewing distance", "Camera");
|
||||
|
@ -573,12 +574,12 @@ namespace MWRender
|
|||
else if (mode == Render_Scene)
|
||||
{
|
||||
int mask = mViewer->getCamera()->getCullMask();
|
||||
bool enabled = mask & SceneUtil::Mask_Scene;
|
||||
bool enabled = mask&Mask_Scene;
|
||||
enabled = !enabled;
|
||||
if (enabled)
|
||||
mask |= SceneUtil::Mask_Scene;
|
||||
mask |= Mask_Scene;
|
||||
else
|
||||
mask &= ~SceneUtil::Mask_Scene;
|
||||
mask &= ~Mask_Scene;
|
||||
mViewer->getCamera()->setCullMask(mask);
|
||||
return enabled;
|
||||
}
|
||||
|
@ -851,7 +852,7 @@ namespace MWRender
|
|||
int maskBackup = mPlayerAnimation->getObjectRoot()->getNodeMask();
|
||||
|
||||
if (mCamera->isFirstPerson())
|
||||
mPlayerAnimation->getObjectRoot()->setNodeMask(SceneUtil::Mask_Disabled);
|
||||
mPlayerAnimation->getObjectRoot()->setNodeMask(0);
|
||||
|
||||
for (int i = 0; i < 6; ++i) // for each cubemap side
|
||||
{
|
||||
|
@ -925,7 +926,7 @@ namespace MWRender
|
|||
|
||||
void RenderingManager::renderCameraToImage(osg::Camera *camera, osg::Image *image, int w, int h)
|
||||
{
|
||||
camera->setNodeMask(SceneUtil::Mask_RenderToTexture);
|
||||
camera->setNodeMask(Mask_RenderToTexture);
|
||||
camera->attach(osg::Camera::COLOR_BUFFER, image);
|
||||
camera->setRenderOrder(osg::Camera::PRE_RENDER);
|
||||
camera->setReferenceFrame(osg::Camera::ABSOLUTE_RF);
|
||||
|
@ -978,7 +979,7 @@ namespace MWRender
|
|||
rttCamera->addChild(mWater->getReflectionCamera());
|
||||
rttCamera->addChild(mWater->getRefractionCamera());
|
||||
|
||||
rttCamera->setCullMask(mViewer->getCamera()->getCullMask() & (~SceneUtil::Mask_GUI));
|
||||
rttCamera->setCullMask(mViewer->getCamera()->getCullMask() & (~Mask_GUI));
|
||||
|
||||
rttCamera->setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
|
@ -991,7 +992,7 @@ namespace MWRender
|
|||
return osg::Vec4f();
|
||||
|
||||
osg::ComputeBoundsVisitor computeBoundsVisitor;
|
||||
computeBoundsVisitor.setTraversalMask(~(SceneUtil::Mask_ParticleSystem|SceneUtil::Mask_Effect));
|
||||
computeBoundsVisitor.setTraversalMask(~(Mask_ParticleSystem|Mask_Effect));
|
||||
ptr.getRefData().getBaseNode()->accept(computeBoundsVisitor);
|
||||
|
||||
osg::Matrix viewProj = mViewer->getCamera()->getViewMatrix() * mViewer->getCamera()->getProjectionMatrix();
|
||||
|
@ -1063,11 +1064,12 @@ namespace MWRender
|
|||
mIntersectionVisitor->setTraversalNumber(mViewer->getFrameStamp()->getFrameNumber());
|
||||
mIntersectionVisitor->setIntersector(intersector);
|
||||
|
||||
int mask = ~(SceneUtil::Mask_RenderToTexture|SceneUtil::Mask_Sky|SceneUtil::Mask_Pathgrid|SceneUtil::Mask_Debug|SceneUtil::Mask_Effect|SceneUtil::Mask_Water|SceneUtil::Mask_SimpleWater);
|
||||
int mask = ~0;
|
||||
mask &= ~(Mask_RenderToTexture|Mask_Sky|Mask_Debug|Mask_Effect|Mask_Water|Mask_SimpleWater);
|
||||
if (ignorePlayer)
|
||||
mask &= ~(SceneUtil::Mask_Player);
|
||||
mask &= ~(Mask_Player);
|
||||
if (ignoreActors)
|
||||
mask &= ~(SceneUtil::Mask_Actor|SceneUtil::Mask_Player);
|
||||
mask &= ~(Mask_Actor|Mask_Player);
|
||||
|
||||
mIntersectionVisitor->setTraversalMask(mask);
|
||||
return mIntersectionVisitor;
|
||||
|
@ -1148,7 +1150,7 @@ namespace MWRender
|
|||
if (!mPlayerNode)
|
||||
{
|
||||
mPlayerNode = new SceneUtil::PositionAttitudeTransform;
|
||||
mPlayerNode->setNodeMask(SceneUtil::Mask_Player);
|
||||
mPlayerNode->setNodeMask(Mask_Player);
|
||||
mPlayerNode->setName("Player Root");
|
||||
mSceneRoot->addChild(mPlayerNode);
|
||||
}
|
||||
|
@ -1392,7 +1394,7 @@ namespace MWRender
|
|||
|
||||
osg::ref_ptr<const osg::Node> node = mResourceSystem->getSceneManager()->getTemplate(modelName);
|
||||
osg::ComputeBoundsVisitor computeBoundsVisitor;
|
||||
computeBoundsVisitor.setTraversalMask(~(SceneUtil::Mask_ParticleSystem|SceneUtil::Mask_Effect));
|
||||
computeBoundsVisitor.setTraversalMask(~(MWRender::Mask_ParticleSystem|MWRender::Mask_Effect));
|
||||
const_cast<osg::Node*>(node.get())->accept(computeBoundsVisitor);
|
||||
osg::BoundingBox bounds = computeBoundsVisitor.getBoundingBox();
|
||||
|
||||
|
|
|
@ -16,7 +16,8 @@
|
|||
#include <components/resource/resourcesystem.hpp>
|
||||
#include <components/resource/scenemanager.hpp>
|
||||
#include <components/fallback/fallback.hpp>
|
||||
#include <components/sceneutil/vismask.hpp>
|
||||
|
||||
#include "vismask.hpp"
|
||||
|
||||
#include "../mwbase/world.hpp"
|
||||
#include "../mwbase/environment.hpp"
|
||||
|
@ -103,7 +104,7 @@ RippleSimulation::RippleSimulation(osg::Group *parent, Resource::ResourceSystem*
|
|||
mParticleNode->setName("Ripple Root");
|
||||
mParticleNode->addChild(updater);
|
||||
mParticleNode->addChild(mParticleSystem);
|
||||
mParticleNode->setNodeMask(SceneUtil::Mask_Water);
|
||||
mParticleNode->setNodeMask(Mask_Water);
|
||||
|
||||
createWaterRippleStateSet(resourceSystem, mParticleNode);
|
||||
|
||||
|
|
|
@ -43,12 +43,12 @@
|
|||
#include <components/sceneutil/statesetupdater.hpp>
|
||||
#include <components/sceneutil/controller.hpp>
|
||||
#include <components/sceneutil/visitor.hpp>
|
||||
#include <components/sceneutil/vismask.hpp>
|
||||
#include <components/sceneutil/shadow.hpp>
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/world.hpp"
|
||||
|
||||
#include "vismask.hpp"
|
||||
#include "renderbin.hpp"
|
||||
|
||||
namespace
|
||||
|
@ -454,7 +454,7 @@ public:
|
|||
|
||||
void setVisible(bool visible)
|
||||
{
|
||||
mTransform->setNodeMask(visible ? mVisibleMask : SceneUtil::Mask_Disabled);
|
||||
mTransform->setNodeMask(visible ? mVisibleMask : 0);
|
||||
}
|
||||
|
||||
protected:
|
||||
|
@ -470,7 +470,7 @@ class Sun : public CelestialBody
|
|||
{
|
||||
public:
|
||||
Sun(osg::Group* parentNode, Resource::ImageManager& imageManager)
|
||||
: CelestialBody(parentNode, 1.0f, 1, SceneUtil::Mask_Sun)
|
||||
: CelestialBody(parentNode, 1.0f, 1, Mask_Sun)
|
||||
, mUpdater(new Updater)
|
||||
{
|
||||
mTransform->addUpdateCallback(mUpdater);
|
||||
|
@ -655,7 +655,7 @@ private:
|
|||
camera->setProjectionMatrix(osg::Matrix::identity());
|
||||
camera->setReferenceFrame(osg::Transform::ABSOLUTE_RF); // add to skyRoot instead?
|
||||
camera->setViewMatrix(osg::Matrix::identity());
|
||||
camera->setClearMask(SceneUtil::Mask_Disabled);
|
||||
camera->setClearMask(0);
|
||||
camera->setRenderOrder(osg::Camera::NESTED_RENDER);
|
||||
camera->setAllowEventFocus(false);
|
||||
|
||||
|
@ -1145,7 +1145,7 @@ SkyManager::SkyManager(osg::Group* parentNode, Resource::SceneManager* sceneMana
|
|||
skyroot->getOrCreateStateSet()->setAttributeAndModes(new osg::Program(), osg::StateAttribute::OVERRIDE|osg::StateAttribute::PROTECTED|osg::StateAttribute::ON);
|
||||
SceneUtil::ShadowManager::disableShadowsForStateSet(skyroot->getOrCreateStateSet());
|
||||
|
||||
skyroot->setNodeMask(SceneUtil::Mask_Sky);
|
||||
skyroot->setNodeMask(Mask_Sky);
|
||||
parentNode->addChild(skyroot);
|
||||
|
||||
mRootNode = skyroot;
|
||||
|
@ -1177,7 +1177,7 @@ void SkyManager::create()
|
|||
mAtmosphereDay->addUpdateCallback(mAtmosphereUpdater);
|
||||
|
||||
mAtmosphereNightNode = new osg::PositionAttitudeTransform;
|
||||
mAtmosphereNightNode->setNodeMask(SceneUtil::Mask_Disabled);
|
||||
mAtmosphereNightNode->setNodeMask(0);
|
||||
mEarlyRenderBinRoot->addChild(mAtmosphereNightNode);
|
||||
|
||||
osg::ref_ptr<osg::Node> atmosphereNight;
|
||||
|
@ -1210,7 +1210,7 @@ void SkyManager::create()
|
|||
mCloudUpdater2 = new CloudUpdater;
|
||||
mCloudUpdater2->setOpacity(0.f);
|
||||
mCloudMesh2->addUpdateCallback(mCloudUpdater2);
|
||||
mCloudMesh2->setNodeMask(SceneUtil::Mask_Disabled);
|
||||
mCloudMesh2->setNodeMask(0);
|
||||
|
||||
osg::ref_ptr<osg::Depth> depth = new osg::Depth;
|
||||
depth->setWriteMask(false);
|
||||
|
@ -1533,7 +1533,7 @@ void SkyManager::createRain()
|
|||
mRainFader = new RainFader(&mWeatherAlpha);
|
||||
mRainNode->addUpdateCallback(mRainFader);
|
||||
mRainNode->addCullCallback(mUnderwaterSwitch);
|
||||
mRainNode->setNodeMask(SceneUtil::Mask_WeatherParticles);
|
||||
mRainNode->setNodeMask(Mask_WeatherParticles);
|
||||
|
||||
mRootNode->addChild(mRainNode);
|
||||
}
|
||||
|
@ -1636,7 +1636,7 @@ void SkyManager::setEnabled(bool enabled)
|
|||
if (enabled && !mCreated)
|
||||
create();
|
||||
|
||||
mRootNode->setNodeMask(enabled ? SceneUtil::Mask_Sky : SceneUtil::Mask_Disabled);
|
||||
mRootNode->setNodeMask(enabled ? Mask_Sky : 0);
|
||||
|
||||
mEnabled = enabled;
|
||||
}
|
||||
|
@ -1729,7 +1729,7 @@ void SkyManager::setWeather(const WeatherResult& weather)
|
|||
{
|
||||
mParticleNode = new osg::PositionAttitudeTransform;
|
||||
mParticleNode->addCullCallback(mUnderwaterSwitch);
|
||||
mParticleNode->setNodeMask(SceneUtil::Mask_WeatherParticles);
|
||||
mParticleNode->setNodeMask(Mask_WeatherParticles);
|
||||
mRootNode->addChild(mParticleNode);
|
||||
}
|
||||
|
||||
|
@ -1799,7 +1799,7 @@ void SkyManager::setWeather(const WeatherResult& weather)
|
|||
|
||||
mCloudUpdater->setOpacity((1.f-mCloudBlendFactor));
|
||||
mCloudUpdater2->setOpacity(mCloudBlendFactor);
|
||||
mCloudMesh2->setNodeMask(mCloudBlendFactor > 0.f ? SceneUtil::Mask_Default : SceneUtil::Mask_Disabled);
|
||||
mCloudMesh2->setNodeMask(mCloudBlendFactor > 0.f ? ~0 : 0);
|
||||
}
|
||||
|
||||
if (mCloudColour != weather.mFogColor)
|
||||
|
@ -1844,7 +1844,7 @@ void SkyManager::setWeather(const WeatherResult& weather)
|
|||
mAtmosphereNightUpdater->setFade(mStarsOpacity);
|
||||
}
|
||||
|
||||
mAtmosphereNightNode->setNodeMask(weather.mNight ? SceneUtil::Mask_Default : SceneUtil::Mask_Disabled);
|
||||
mAtmosphereNightNode->setNodeMask(weather.mNight ? ~0 : 0);
|
||||
|
||||
if (mRainFader)
|
||||
mRainFader->setAlpha(weather.mEffectFade * 0.6); // * Rain_Threshold?
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef OPENMW_COMPONENTS_SCENEUTIL_VISMASK_H
|
||||
#define OPENMW_COMPONENTS_SCENEUTIL_VISMASK_H
|
||||
#ifndef OPENMW_MWRENDER_VISMASK_H
|
||||
#define OPENMW_MWRENDER_VISMASK_H
|
||||
|
||||
namespace SceneUtil
|
||||
namespace MWRender
|
||||
{
|
||||
|
||||
/// Node masks used for controlling visibility of game objects.
|
||||
|
@ -21,8 +21,6 @@ namespace SceneUtil
|
|||
/// compatibility if the enumeration values were to be changed. Feel free to change them when it makes sense.
|
||||
enum VisMask
|
||||
{
|
||||
Mask_Disabled = 0, // For hidden nodes
|
||||
|
||||
Mask_UpdateVisitor = 0x1, // reserved for separating UpdateVisitors from CullVisitors
|
||||
|
||||
// child of Scene
|
||||
|
@ -55,19 +53,7 @@ namespace SceneUtil
|
|||
Mask_PreCompile = (1<<18),
|
||||
|
||||
// Set on a camera's cull mask to enable the LightManager
|
||||
Mask_Lighting = (1<<19),
|
||||
|
||||
// For pathgrid nodes debugging
|
||||
Mask_Pathgrid = (1<<20),
|
||||
|
||||
// Editor control elements
|
||||
Mask_EditorCellMarker = (1<<21),
|
||||
Mask_EditorCellArrow = (1<<22),
|
||||
Mask_EditorCellBorder = (1<<23),
|
||||
Mask_EditorReference = (1<<24),
|
||||
|
||||
// Default mask for OSG nodes
|
||||
Mask_Default = 0xffffffff
|
||||
Mask_Lighting = (1<<19)
|
||||
};
|
||||
|
||||
}
|
|
@ -27,7 +27,6 @@
|
|||
|
||||
#include <components/sceneutil/shadow.hpp>
|
||||
#include <components/sceneutil/waterutil.hpp>
|
||||
#include <components/sceneutil/vismask.hpp>
|
||||
|
||||
#include <components/misc/constants.hpp>
|
||||
|
||||
|
@ -41,6 +40,7 @@
|
|||
|
||||
#include "../mwworld/cellstore.hpp"
|
||||
|
||||
#include "vismask.hpp"
|
||||
#include "ripplesimulation.hpp"
|
||||
#include "renderbin.hpp"
|
||||
#include "util.hpp"
|
||||
|
@ -243,8 +243,8 @@ public:
|
|||
setName("RefractionCamera");
|
||||
setCullCallback(new InheritViewPointCallback);
|
||||
|
||||
setCullMask(SceneUtil::Mask_Effect|SceneUtil::Mask_Scene|SceneUtil::Mask_Object|SceneUtil::Mask_Static|SceneUtil::Mask_Terrain|SceneUtil::Mask_Actor|SceneUtil::Mask_ParticleSystem|SceneUtil::Mask_Sky|SceneUtil::Mask_Sun|SceneUtil::Mask_Player|SceneUtil::Mask_Lighting);
|
||||
setNodeMask(SceneUtil::Mask_RenderToTexture);
|
||||
setCullMask(Mask_Effect|Mask_Scene|Mask_Object|Mask_Static|Mask_Terrain|Mask_Actor|Mask_ParticleSystem|Mask_Sky|Mask_Sun|Mask_Player|Mask_Lighting);
|
||||
setNodeMask(Mask_RenderToTexture);
|
||||
setViewport(0, 0, rttSize, rttSize);
|
||||
|
||||
// No need for Update traversal since the scene is already updated as part of the main scene graph
|
||||
|
@ -337,7 +337,7 @@ public:
|
|||
setCullCallback(new InheritViewPointCallback);
|
||||
|
||||
setInterior(isInterior);
|
||||
setNodeMask(SceneUtil::Mask_RenderToTexture);
|
||||
setNodeMask(Mask_RenderToTexture);
|
||||
|
||||
unsigned int rttSize = Settings::Manager::getInt("rtt size", "Water");
|
||||
setViewport(0, 0, rttSize, rttSize);
|
||||
|
@ -372,11 +372,11 @@ public:
|
|||
int reflectionDetail = Settings::Manager::getInt("reflection detail", "Water");
|
||||
reflectionDetail = std::min(4, std::max(isInterior ? 2 : 0, reflectionDetail));
|
||||
unsigned int extraMask = 0;
|
||||
if(reflectionDetail >= 1) extraMask |= SceneUtil::Mask_Terrain;
|
||||
if(reflectionDetail >= 2) extraMask |= SceneUtil::Mask_Static;
|
||||
if(reflectionDetail >= 3) extraMask |= SceneUtil::Mask_Effect|SceneUtil::Mask_ParticleSystem|SceneUtil::Mask_Object;
|
||||
if(reflectionDetail >= 4) extraMask |= SceneUtil::Mask_Player|SceneUtil::Mask_Actor;
|
||||
setCullMask(SceneUtil::Mask_Scene|SceneUtil::Mask_Sky|SceneUtil::Mask_Lighting|extraMask);
|
||||
if(reflectionDetail >= 1) extraMask |= Mask_Terrain;
|
||||
if(reflectionDetail >= 2) extraMask |= Mask_Static;
|
||||
if(reflectionDetail >= 3) extraMask |= Mask_Effect|Mask_ParticleSystem|Mask_Object;
|
||||
if(reflectionDetail >= 4) extraMask |= Mask_Player|Mask_Actor;
|
||||
setCullMask(Mask_Scene|Mask_Sky|Mask_Lighting|extraMask);
|
||||
}
|
||||
|
||||
void setWaterLevel(float waterLevel)
|
||||
|
@ -441,7 +441,7 @@ Water::Water(osg::Group *parent, osg::Group* sceneRoot, Resource::ResourceSystem
|
|||
|
||||
mWaterGeom = SceneUtil::createWaterGeometry(Constants::CellSizeInUnits*150, 40, 900);
|
||||
mWaterGeom->setDrawCallback(new DepthClampCallback);
|
||||
mWaterGeom->setNodeMask(SceneUtil::Mask_Water);
|
||||
mWaterGeom->setNodeMask(Mask_Water);
|
||||
|
||||
mWaterNode = new osg::PositionAttitudeTransform;
|
||||
mWaterNode->setName("Water Root");
|
||||
|
@ -451,7 +451,7 @@ Water::Water(osg::Group *parent, osg::Group* sceneRoot, Resource::ResourceSystem
|
|||
// simple water fallback for the local map
|
||||
osg::ref_ptr<osg::Geometry> geom2 (osg::clone(mWaterGeom.get(), osg::CopyOp::DEEP_COPY_NODES));
|
||||
createSimpleWaterStateSet(geom2, Fallback::Map::getFloat("Water_Map_Alpha"));
|
||||
geom2->setNodeMask(SceneUtil::Mask_SimpleWater);
|
||||
geom2->setNodeMask(Mask_SimpleWater);
|
||||
mWaterNode->addChild(geom2);
|
||||
|
||||
mSceneRoot->addChild(mWaterNode);
|
||||
|
@ -706,11 +706,11 @@ void Water::update(float dt)
|
|||
void Water::updateVisible()
|
||||
{
|
||||
bool visible = mEnabled && mToggled;
|
||||
mWaterNode->setNodeMask(visible ? SceneUtil::Mask_Default : SceneUtil::Mask_Disabled);
|
||||
mWaterNode->setNodeMask(visible ? ~0 : 0);
|
||||
if (mRefraction)
|
||||
mRefraction->setNodeMask(visible ? SceneUtil::Mask_RenderToTexture : SceneUtil::Mask_Disabled);
|
||||
mRefraction->setNodeMask(visible ? Mask_RenderToTexture : 0);
|
||||
if (mReflection)
|
||||
mReflection->setNodeMask(visible ? SceneUtil::Mask_RenderToTexture : SceneUtil::Mask_Disabled);
|
||||
mReflection->setNodeMask(visible ? Mask_RenderToTexture : 0);
|
||||
}
|
||||
|
||||
bool Water::toggle()
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
|
||||
#include <components/sceneutil/controller.hpp>
|
||||
#include <components/sceneutil/visitor.hpp>
|
||||
#include <components/sceneutil/vismask.hpp>
|
||||
#include <components/sceneutil/lightmanager.hpp>
|
||||
|
||||
#include "../mwworld/manualref.hpp"
|
||||
|
@ -36,6 +35,7 @@
|
|||
#include "../mwmechanics/weapontype.hpp"
|
||||
|
||||
#include "../mwrender/animation.hpp"
|
||||
#include "../mwrender/vismask.hpp"
|
||||
#include "../mwrender/renderingmanager.hpp"
|
||||
#include "../mwrender/util.hpp"
|
||||
|
||||
|
@ -188,7 +188,7 @@ namespace MWWorld
|
|||
bool rotate, bool createLight, osg::Vec4 lightDiffuseColor, std::string texture)
|
||||
{
|
||||
state.mNode = new osg::PositionAttitudeTransform;
|
||||
state.mNode->setNodeMask(SceneUtil::Mask_Effect);
|
||||
state.mNode->setNodeMask(MWRender::Mask_Effect);
|
||||
state.mNode->setPosition(pos);
|
||||
state.mNode->setAttitude(orient);
|
||||
|
||||
|
@ -228,7 +228,7 @@ namespace MWWorld
|
|||
projectileLight->setPosition(osg::Vec4(pos, 1.0));
|
||||
|
||||
SceneUtil::LightSource* projectileLightSource = new SceneUtil::LightSource;
|
||||
projectileLightSource->setNodeMask(SceneUtil::Mask_Lighting);
|
||||
projectileLightSource->setNodeMask(MWRender::Mask_Lighting);
|
||||
projectileLightSource->setRadius(66.f);
|
||||
|
||||
state.mNode->addChild(projectileLightSource);
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
#include <components/resource/resourcesystem.hpp>
|
||||
|
||||
#include <components/sceneutil/positionattitudetransform.hpp>
|
||||
#include <components/sceneutil/vismask.hpp>
|
||||
|
||||
#include <components/detournavigator/debug.hpp>
|
||||
#include <components/detournavigator/navigatorimpl.hpp>
|
||||
|
@ -47,6 +46,7 @@
|
|||
#include "../mwrender/npcanimation.hpp"
|
||||
#include "../mwrender/renderingmanager.hpp"
|
||||
#include "../mwrender/camera.hpp"
|
||||
#include "../mwrender/vismask.hpp"
|
||||
|
||||
#include "../mwscript/globalscripts.hpp"
|
||||
|
||||
|
@ -2273,7 +2273,7 @@ namespace MWWorld
|
|||
{
|
||||
// Adjust position so the location we wanted ends up in the middle of the object bounding box
|
||||
osg::ComputeBoundsVisitor computeBounds;
|
||||
computeBounds.setTraversalMask(~SceneUtil::Mask_ParticleSystem);
|
||||
computeBounds.setTraversalMask(~MWRender::Mask_ParticleSystem);
|
||||
dropped.getRefData().getBaseNode()->accept(computeBounds);
|
||||
osg::BoundingBox bounds = computeBounds.getBoundingBox();
|
||||
if (bounds.valid())
|
||||
|
|
|
@ -51,7 +51,7 @@ add_component_dir (shader
|
|||
add_component_dir (sceneutil
|
||||
clone attach visitor util statesetupdater controller skeleton riggeometry morphgeometry lightcontroller
|
||||
lightmanager lightutil positionattitudetransform workqueue unrefqueue pathgridutil waterutil writescene serialize optimizer
|
||||
actorutil detourdebugdraw navmesh agentpath shadow mwshadowtechnique vismask recastmesh
|
||||
actorutil detourdebugdraw navmesh agentpath shadow mwshadowtechnique recastmesh
|
||||
)
|
||||
|
||||
add_component_dir (nif
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
|
||||
#include <components/nif/data.hpp>
|
||||
#include <components/sceneutil/morphgeometry.hpp>
|
||||
#include <components/sceneutil/vismask.hpp>
|
||||
|
||||
#include "userdata.hpp"
|
||||
|
||||
|
@ -305,7 +304,7 @@ void VisController::operator() (osg::Node* node, osg::NodeVisitor* nv)
|
|||
{
|
||||
bool vis = calculate(getInputValue(nv));
|
||||
// Leave 0x1 enabled for UpdateVisitor, so we can make ourselves visible again in the future from this update callback
|
||||
node->setNodeMask(vis ? SceneUtil::Mask_Default : SceneUtil::Mask_UpdateVisitor);
|
||||
node->setNodeMask(vis ? ~0 : 0x1);
|
||||
}
|
||||
traverse(node, nv);
|
||||
}
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
#include <components/misc/resourcehelpers.hpp>
|
||||
#include <components/resource/imagemanager.hpp>
|
||||
#include <components/sceneutil/util.hpp>
|
||||
#include <components/sceneutil/vismask.hpp>
|
||||
|
||||
// particle
|
||||
#include <osgParticle/ParticleSystem>
|
||||
|
@ -178,7 +177,7 @@ namespace NifOsg
|
|||
|
||||
void setEnabled(bool enabled)
|
||||
{
|
||||
setNodeMask(enabled ? SceneUtil::Mask_Default : SceneUtil::Mask_Effect);
|
||||
setNodeMask(enabled ? ~0 : 0);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -573,7 +572,7 @@ namespace NifOsg
|
|||
{
|
||||
skipMeshes = true;
|
||||
// Leave mask for UpdateVisitor enabled
|
||||
node->setNodeMask(SceneUtil::Mask_UpdateVisitor);
|
||||
node->setNodeMask(0x1);
|
||||
}
|
||||
|
||||
// We can skip creating meshes for hidden nodes if they don't have a VisController that
|
||||
|
@ -588,7 +587,7 @@ namespace NifOsg
|
|||
skipMeshes = true; // skip child meshes, but still create the child node hierarchy for animating collision shapes
|
||||
|
||||
// now hide this node, but leave the mask for UpdateVisitor enabled so that KeyframeController works
|
||||
node->setNodeMask(SceneUtil::Mask_UpdateVisitor);
|
||||
node->setNodeMask(0x1);
|
||||
}
|
||||
|
||||
if ((skipMeshes || hasMarkers) && isAnimated) // make sure the empty node is not optimized away so the physicssystem can find it.
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
#include <osgViewer/Renderer>
|
||||
|
||||
#include <components/myguiplatform/myguidatamanager.hpp>
|
||||
#include <components/sceneutil/vismask.hpp>
|
||||
|
||||
namespace Resource
|
||||
{
|
||||
|
@ -104,14 +103,14 @@ void StatsHandler::toggle(osgViewer::ViewerBase *viewer)
|
|||
|
||||
if (!_statsType)
|
||||
{
|
||||
_camera->setNodeMask(SceneUtil::Mask_Disabled);
|
||||
_camera->setNodeMask(0);
|
||||
_switch->setAllChildrenOff();
|
||||
|
||||
viewer->getViewerStats()->collectStats("resource", false);
|
||||
}
|
||||
else
|
||||
{
|
||||
_camera->setNodeMask(SceneUtil::Mask_Default);
|
||||
_camera->setNodeMask(0xffffffff);
|
||||
_switch->setSingleChildOn(_resourceStatsChildNum);
|
||||
|
||||
viewer->getViewerStats()->collectStats("resource", true);
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
#include "lightcontroller.hpp"
|
||||
#include "util.hpp"
|
||||
#include "visitor.hpp"
|
||||
#include "vismask.hpp"
|
||||
#include "positionattitudetransform.hpp"
|
||||
|
||||
namespace SceneUtil
|
||||
|
@ -59,7 +58,7 @@ namespace SceneUtil
|
|||
light->setQuadraticAttenuation(quadraticAttenuation);
|
||||
}
|
||||
|
||||
void addLight (osg::Group* node, const ESM::Light* esmLight, bool isExterior)
|
||||
void addLight (osg::Group* node, const ESM::Light* esmLight, unsigned int partsysMask, unsigned int lightMask, bool isExterior)
|
||||
{
|
||||
SceneUtil::FindByNameVisitor visitor("AttachLight");
|
||||
node->accept(visitor);
|
||||
|
@ -72,7 +71,7 @@ namespace SceneUtil
|
|||
else
|
||||
{
|
||||
osg::ComputeBoundsVisitor computeBound;
|
||||
computeBound.setTraversalMask(~SceneUtil::Mask_ParticleSystem);
|
||||
computeBound.setTraversalMask(~partsysMask);
|
||||
// We want the bounds of all children of the node, ignoring the node's local transformation
|
||||
// So do a traverse(), not accept()
|
||||
computeBound.traverse(*node);
|
||||
|
@ -86,15 +85,15 @@ namespace SceneUtil
|
|||
attachTo = trans;
|
||||
}
|
||||
|
||||
osg::ref_ptr<LightSource> lightSource = createLightSource(esmLight, isExterior);
|
||||
osg::ref_ptr<LightSource> lightSource = createLightSource(esmLight, lightMask, isExterior);
|
||||
attachTo->addChild(lightSource);
|
||||
}
|
||||
|
||||
osg::ref_ptr<LightSource> createLightSource(const ESM::Light* esmLight, bool isExterior, const osg::Vec4f& ambient)
|
||||
osg::ref_ptr<LightSource> createLightSource(const ESM::Light* esmLight, unsigned int lightMask, bool isExterior, const osg::Vec4f& ambient)
|
||||
{
|
||||
osg::ref_ptr<SceneUtil::LightSource> lightSource (new SceneUtil::LightSource);
|
||||
osg::ref_ptr<osg::Light> light (new osg::Light);
|
||||
lightSource->setNodeMask(SceneUtil::Mask_Lighting);
|
||||
lightSource->setNodeMask(lightMask);
|
||||
|
||||
float radius = esmLight->mData.mRadius;
|
||||
lightSource->setRadius(radius);
|
||||
|
|
|
@ -32,14 +32,14 @@ namespace SceneUtil
|
|||
/// @param partsysMask Node mask to ignore when computing the sub graph's bounding box.
|
||||
/// @param lightMask Mask to assign to the newly created LightSource.
|
||||
/// @param isExterior Is the light outside? May be used for deciding which attenuation settings to use.
|
||||
void addLight (osg::Group* node, const ESM::Light* esmLight, bool isExterior);
|
||||
void addLight (osg::Group* node, const ESM::Light* esmLight, unsigned int partsysMask, unsigned int lightMask, bool isExterior);
|
||||
|
||||
/// @brief Convert an ESM::Light to a SceneUtil::LightSource, and return it.
|
||||
/// @param esmLight The light definition coming from the game files containing radius, color, flicker, etc.
|
||||
/// @param lightMask Mask to assign to the newly created LightSource.
|
||||
/// @param isExterior Is the light outside? May be used for deciding which attenuation settings to use.
|
||||
/// @param ambient Ambient component of the light.
|
||||
osg::ref_ptr<LightSource> createLightSource (const ESM::Light* esmLight, bool isExterior, const osg::Vec4f& ambient=osg::Vec4f(0,0,0,1));
|
||||
osg::ref_ptr<LightSource> createLightSource (const ESM::Light* esmLight, unsigned int lightMask, bool isExterior, const osg::Vec4f& ambient=osg::Vec4f(0,0,0,1));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -22,8 +22,6 @@
|
|||
#include <osg/Transform>
|
||||
#include <osg/Texture2D>
|
||||
|
||||
#include <components/sceneutil/vismask.hpp>
|
||||
|
||||
//#include <osgUtil/Export>
|
||||
|
||||
#include <set>
|
||||
|
@ -44,7 +42,7 @@ class BaseOptimizerVisitor : public osg::NodeVisitor
|
|||
_optimizer(optimizer),
|
||||
_operationType(operation)
|
||||
{
|
||||
setNodeMaskOverride(SceneUtil::Mask_Default);
|
||||
setNodeMaskOverride(0xffffffff);
|
||||
}
|
||||
|
||||
inline bool isOperationPermissibleForObject(const osg::StateSet* object) const;
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
#include <osgShadow/ShadowedScene>
|
||||
|
||||
#include <components/sceneutil/vismask.hpp>
|
||||
#include <components/settings/settings.hpp>
|
||||
|
||||
namespace SceneUtil
|
||||
|
@ -22,7 +21,7 @@ namespace SceneUtil
|
|||
mShadowTechnique->enableShadows();
|
||||
|
||||
mShadowSettings->setLightNum(0);
|
||||
mShadowSettings->setReceivesShadowTraversalMask(SceneUtil::Mask_Default);
|
||||
mShadowSettings->setReceivesShadowTraversalMask(~0u);
|
||||
|
||||
int numberOfShadowMapsPerLight = Settings::Manager::getInt("number of shadow maps", "Shadows");
|
||||
numberOfShadowMapsPerLight = std::max(1, std::min(numberOfShadowMapsPerLight, 8));
|
||||
|
|
|
@ -4,17 +4,16 @@
|
|||
#include <osg/Geometry>
|
||||
#include <osg/Geode>
|
||||
|
||||
#include <components/sceneutil/vismask.hpp>
|
||||
|
||||
#include "world.hpp"
|
||||
#include "../esm/loadland.hpp"
|
||||
|
||||
namespace Terrain
|
||||
{
|
||||
|
||||
CellBorder::CellBorder(Terrain::World *world, osg::Group *root):
|
||||
CellBorder::CellBorder(Terrain::World *world, osg::Group *root, int borderMask):
|
||||
mWorld(world),
|
||||
mRoot(root)
|
||||
mRoot(root),
|
||||
mBorderMask(borderMask)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -70,7 +69,7 @@ void CellBorder::createCellBorderGeometry(int x, int y)
|
|||
polygonmode->setMode(osg::PolygonMode::FRONT_AND_BACK, osg::PolygonMode::LINE);
|
||||
stateSet->setAttributeAndModes(polygonmode,osg::StateAttribute::ON);
|
||||
|
||||
borderGeode->setNodeMask(SceneUtil::Mask_Debug);
|
||||
borderGeode->setNodeMask(mBorderMask);
|
||||
|
||||
mRoot->addChild(borderGeode);
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace Terrain
|
|||
public:
|
||||
typedef std::map<std::pair<int, int>, osg::ref_ptr<osg::Node> > CellGrid;
|
||||
|
||||
CellBorder(Terrain::World *world, osg::Group *root);
|
||||
CellBorder(Terrain::World *world, osg::Group *root, int borderMask);
|
||||
|
||||
void createCellBorderGeometry(int x, int y);
|
||||
void destroyCellBorderGeometry(int x, int y);
|
||||
|
@ -31,6 +31,7 @@ namespace Terrain
|
|||
osg::Group *mRoot;
|
||||
|
||||
CellGrid mCellBorderNodes;
|
||||
int mBorderMask;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
|
||||
#include <components/misc/constants.hpp>
|
||||
#include <components/sceneutil/mwshadowtechnique.hpp>
|
||||
#include <components/sceneutil/vismask.hpp>
|
||||
|
||||
#include "quadtreenode.hpp"
|
||||
#include "storage.hpp"
|
||||
|
@ -217,8 +216,8 @@ private:
|
|||
osg::ref_ptr<RootNode> mRootNode;
|
||||
};
|
||||
|
||||
QuadTreeWorld::QuadTreeWorld(osg::Group *parent, osg::Group *compileRoot, Resource::ResourceSystem *resourceSystem, Storage *storage, int compMapResolution, float compMapLevel, float lodFactor, int vertexLodMod, float maxCompGeometrySize)
|
||||
: TerrainGrid(parent, compileRoot, resourceSystem, storage)
|
||||
QuadTreeWorld::QuadTreeWorld(osg::Group *parent, osg::Group *compileRoot, Resource::ResourceSystem *resourceSystem, Storage *storage, int nodeMask, int preCompileMask, int borderMask, int compMapResolution, float compMapLevel, float lodFactor, int vertexLodMod, float maxCompGeometrySize)
|
||||
: TerrainGrid(parent, compileRoot, resourceSystem, storage, nodeMask, preCompileMask, borderMask)
|
||||
, mViewDataMap(new ViewDataMap)
|
||||
, mQuadTreeBuilt(false)
|
||||
, mLodFactor(lodFactor)
|
||||
|
@ -425,7 +424,7 @@ void QuadTreeWorld::enable(bool enabled)
|
|||
}
|
||||
|
||||
if (mRootNode)
|
||||
mRootNode->setNodeMask(enabled ? SceneUtil::Mask_Default : SceneUtil::Mask_Disabled);
|
||||
mRootNode->setNodeMask(enabled ? ~0 : 0);
|
||||
}
|
||||
|
||||
void QuadTreeWorld::cacheCell(View *view, int x, int y)
|
||||
|
|
|
@ -21,7 +21,7 @@ namespace Terrain
|
|||
class QuadTreeWorld : public TerrainGrid // note: derived from TerrainGrid is only to render default cells (see loadCell)
|
||||
{
|
||||
public:
|
||||
QuadTreeWorld(osg::Group* parent, osg::Group* compileRoot, Resource::ResourceSystem* resourceSystem, Storage* storage, int compMapResolution, float comMapLevel, float lodFactor, int vertexLodMod, float maxCompGeometrySize);
|
||||
QuadTreeWorld(osg::Group* parent, osg::Group* compileRoot, Resource::ResourceSystem* resourceSystem, Storage* storage, int nodeMask, int preCompileMask, int borderMask, int compMapResolution, float comMapLevel, float lodFactor, int vertexLodMod, float maxCompGeometrySize);
|
||||
|
||||
~QuadTreeWorld();
|
||||
|
||||
|
|
|
@ -18,8 +18,8 @@ public:
|
|||
virtual void reset() {}
|
||||
};
|
||||
|
||||
TerrainGrid::TerrainGrid(osg::Group* parent, osg::Group* compileRoot, Resource::ResourceSystem* resourceSystem, Storage* storage)
|
||||
: Terrain::World(parent, compileRoot, resourceSystem, storage)
|
||||
TerrainGrid::TerrainGrid(osg::Group* parent, osg::Group* compileRoot, Resource::ResourceSystem* resourceSystem, Storage* storage, int nodeMask, int preCompileMask, int borderMask)
|
||||
: Terrain::World(parent, compileRoot, resourceSystem, storage, nodeMask, preCompileMask, borderMask)
|
||||
, mNumSplits(4)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace Terrain
|
|||
class TerrainGrid : public Terrain::World
|
||||
{
|
||||
public:
|
||||
TerrainGrid(osg::Group* parent, osg::Group* compileRoot, Resource::ResourceSystem* resourceSystem, Storage* storage);
|
||||
TerrainGrid(osg::Group* parent, osg::Group* compileRoot, Resource::ResourceSystem* resourceSystem, Storage* storage, int nodeMask, int preCompileMask=~0, int borderMask=0);
|
||||
~TerrainGrid();
|
||||
|
||||
virtual void cacheCell(View* view, int x, int y);
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
#include <osg/Camera>
|
||||
|
||||
#include <components/resource/resourcesystem.hpp>
|
||||
#include <components/sceneutil/vismask.hpp>
|
||||
|
||||
#include "storage.hpp"
|
||||
#include "texturemanager.hpp"
|
||||
|
@ -15,14 +14,14 @@
|
|||
namespace Terrain
|
||||
{
|
||||
|
||||
World::World(osg::Group* parent, osg::Group* compileRoot, Resource::ResourceSystem* resourceSystem, Storage* storage)
|
||||
World::World(osg::Group* parent, osg::Group* compileRoot, Resource::ResourceSystem* resourceSystem, Storage* storage, int nodeMask, int preCompileMask, int borderMask)
|
||||
: mStorage(storage)
|
||||
, mParent(parent)
|
||||
, mResourceSystem(resourceSystem)
|
||||
, mBorderVisible(false)
|
||||
{
|
||||
mTerrainRoot = new osg::Group;
|
||||
mTerrainRoot->setNodeMask(SceneUtil::Mask_Terrain);
|
||||
mTerrainRoot->setNodeMask(nodeMask);
|
||||
mTerrainRoot->getOrCreateStateSet()->setRenderingHint(osg::StateSet::OPAQUE_BIN);
|
||||
osg::ref_ptr<osg::Material> material (new osg::Material);
|
||||
material->setColorMode(osg::Material::AMBIENT_AND_DIFFUSE);
|
||||
|
@ -35,8 +34,8 @@ World::World(osg::Group* parent, osg::Group* compileRoot, Resource::ResourceSyst
|
|||
compositeCam->setProjectionMatrix(osg::Matrix::identity());
|
||||
compositeCam->setViewMatrix(osg::Matrix::identity());
|
||||
compositeCam->setReferenceFrame(osg::Camera::ABSOLUTE_RF);
|
||||
compositeCam->setClearMask(SceneUtil::Mask_Disabled);
|
||||
compositeCam->setNodeMask(SceneUtil::Mask_PreCompile);
|
||||
compositeCam->setClearMask(0);
|
||||
compositeCam->setNodeMask(preCompileMask);
|
||||
mCompositeMapCamera = compositeCam;
|
||||
|
||||
compileRoot->addChild(compositeCam);
|
||||
|
@ -48,7 +47,7 @@ World::World(osg::Group* parent, osg::Group* compileRoot, Resource::ResourceSyst
|
|||
|
||||
mTextureManager.reset(new TextureManager(mResourceSystem->getSceneManager()));
|
||||
mChunkManager.reset(new ChunkManager(mStorage, mResourceSystem->getSceneManager(), mTextureManager.get(), mCompositeMapRenderer));
|
||||
mCellBorder.reset(new CellBorder(this,mTerrainRoot.get()));
|
||||
mCellBorder.reset(new CellBorder(this,mTerrainRoot.get(),borderMask));
|
||||
|
||||
mResourceSystem->addResourceManager(mChunkManager.get());
|
||||
mResourceSystem->addResourceManager(mTextureManager.get());
|
||||
|
|
|
@ -63,7 +63,7 @@ namespace Terrain
|
|||
/// @param storage Storage instance to get terrain data from (heights, normals, colors, textures..)
|
||||
/// @param nodeMask mask for the terrain root
|
||||
/// @param preCompileMask mask for pre compiling textures
|
||||
World(osg::Group* parent, osg::Group* compileRoot, Resource::ResourceSystem* resourceSystem, Storage* storage);
|
||||
World(osg::Group* parent, osg::Group* compileRoot, Resource::ResourceSystem* resourceSystem, Storage* storage, int nodeMask, int preCompileMask, int borderMask);
|
||||
virtual ~World();
|
||||
|
||||
/// Set a WorkQueue to delete objects in the background thread.
|
||||
|
|
Loading…
Reference in a new issue