Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#5623: Spike code to render nodes affected by merge actions
- Loading branch information
1 parent
93fd736
commit 7e8193d
Showing
12 changed files
with
170 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,6 +102,7 @@ class INode : | |
Model, | ||
Particle, | ||
EntityConnection, | ||
MergeAction, | ||
}; | ||
|
||
public: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
#pragma once | ||
|
||
#include "math/AABB.h" | ||
#include "scene/SelectableNode.h" | ||
#include "scene/merge/MergeAction.h" | ||
|
||
namespace map | ||
{ | ||
|
||
class MergeActionNode : | ||
public scene::SelectableNode | ||
{ | ||
private: | ||
scene::merge::MergeAction::Ptr _action; | ||
scene::INodePtr _affectedNode; | ||
|
||
public: | ||
using Ptr = std::shared_ptr<MergeActionNode>; | ||
|
||
MergeActionNode(const scene::merge::MergeAction::Ptr& action) : | ||
_action(action) | ||
{ | ||
_affectedNode = _action->getAffectedNode(); | ||
|
||
// Hide the affected node itself | ||
_affectedNode->enable(Node::eHidden); | ||
} | ||
|
||
void onInsertIntoScene(scene::IMapRootNode& root) override | ||
{ | ||
SelectableNode::onInsertIntoScene(root); | ||
|
||
if (_affectedNode->getRootNode() != getRootNode()) | ||
{ | ||
scene::addNodeToContainer(_affectedNode, getRootNode()); | ||
} | ||
} | ||
|
||
void onRemoveFromScene(scene::IMapRootNode& root) override | ||
{ | ||
SelectableNode::onRemoveFromScene(root); | ||
|
||
if (!_affectedNode->inScene()) | ||
{ | ||
scene::removeNodeFromParent(_affectedNode); | ||
} | ||
} | ||
|
||
void setRenderSystem(const RenderSystemPtr& renderSystem) override | ||
{ | ||
SelectableNode::setRenderSystem(renderSystem); | ||
|
||
_affectedNode->setRenderSystem(renderSystem); | ||
} | ||
|
||
scene::INode::Type getNodeType() const override | ||
{ | ||
return scene::INode::Type::MergeAction; | ||
} | ||
|
||
const AABB& localAABB() const override | ||
{ | ||
return _affectedNode->localAABB(); | ||
} | ||
|
||
void renderSolid(RenderableCollector& collector, const VolumeTest& volume) const override | ||
{ | ||
_affectedNode->renderSolid(collector, volume); | ||
} | ||
|
||
void renderWireframe(RenderableCollector& collector, const VolumeTest& volume) const override | ||
{ | ||
_affectedNode->renderWireframe(collector, volume); | ||
} | ||
|
||
std::size_t getHighlightFlags() override | ||
{ | ||
return Highlight::MergeAction; | ||
} | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters