esp::scene::SceneNode class

Constructors, destructors, conversion operators

SceneNode(SceneNode& parent)
~SceneNode() override
SceneNode(MagnumScene& parentNode) protected explicit
SceneNode() protected

Public functions

auto getType() const -> SceneNodeType
void setType(SceneNodeType type)
template<class U, class... Args>
void addFeature(Args && ... args)
auto getSceneNodeTags() const -> SceneNodeTags
void setSceneNodeTags(SceneNodeTags sceneNodeTags)
Sets sceneNodeTags_ of SceneNode.
void addSceneNodeTag(SceneNodeTag sceneNodeTag)
Add SceneNodeTag to sceneNodeTags_ of SceneNode.
void removeSceneNodeTag(SceneNodeTag sceneNodeTag)
Remove SceneNodeTag from sceneNodeTags_ of SceneNode.
auto createChild(SceneNodeTags childNodeTag = {}) -> SceneNode&
auto setParent(SceneNode* newParent) -> SceneNode&
Sets parent SceneNode of this SceneNode, updates parent's nodeSensorSuite and ancestors' subtreeSensorSuites NOTE: Overloads MagnumObject::setParent.
auto getId() const -> int virtual
Returns node id.
void setId(int id) virtual
Sets node id.
auto getSemanticId() const -> int virtual
Returns node semanticId.
void setSemanticId(int semanticId) virtual
Sets node semanticId.
auto getBaseObjectId() const -> int virtual
Gets node's owning objectID, for panoptic rendering.
void setBaseObjectId(int objectId)
Sets node's owning objectID, for panoptic rendering.
auto getDrawableId() const -> int virtual
Gets node's corresponding drawable's id, for panoptic rendering.
void setDrawableId(int drawableId)
Sets node's corresponding drawable's id, for panoptic rendering.
auto getShaderObjectID(int idToGetIDX) const -> int
Retrieve the appropriate semantic/descriptive ID based on the query.
auto getSemanticIDVector() const -> const std::vector<int>&
Return a reference to all the semantic/descriptive IDs used by this scene node.
void setSemanticIDVector(const std::vector<int>& _semanticIDs)
Set the value for the various semantic IDs to be rendered by this scene node. As values are added, we want to make sure we support shorter, older vectors.
auto absoluteTranslation() const -> Magnum::Vector3
auto absoluteTranslation() -> Magnum::Vector3
auto computeCumulativeBB() -> const Magnum::Range3D&
auto getMeshBB() const -> const Magnum::Range3D&
return the local bounding box for meshes stored at this node
auto getAbsoluteAABB() const -> const Magnum::Range3D&
return the global bounding box for the mesh stored at this node
auto getCumulativeBB() const -> const Magnum::Range3D&
auto getNodeSensorSuite() -> esp::sensor::SensorSuite&
Return SensorSuite containing references to Sensors this SceneNode holds.
auto getNodeSensors() -> std::map<std::string, std::reference_wrapper<esp::sensor::Sensor>>&
Return map containing references to Sensors this SceneNode holds. Keys are uuid strings, values are references to Sensors with that uuid.
auto getSubtreeSensorSuite() -> esp::sensor::SensorSuite&
Return SensorSuite containing references to superset of all Sensors held by this SceneNode and its children.
auto getSubtreeSensors() -> std::map<std::string, std::reference_wrapper<esp::sensor::Sensor>>&
Return map containing references to superset of all Sensors held by this SceneNode and its children values. Keys are uuid strings, values are references to Sensors with that uuid.
void addSensorToParentNodeSensorSuite()
Add sensor in this' nodeSensorSuite to parent's nodeSensorSuite NOTE: This only adds a sensor if this is a leaf node and sensor exists.
void removeSensorFromParentNodeSensorSuite()
Remove sensor in this' nodeSensorSuite from parent's nodeSensorSuite NOTE: This only removes a sensor if this is a leaf node and sensor exists.
void removeSubtreeSensorsFromAncestors()
Go bottom to the top, and erase all subtreeSensors from this' ancestors' subtreeSensorSuites.
void addSubtreeSensorsToAncestors()
Go bottom to the top, and add all subtreeSensors to this' ancestors' subtreeSensorSuites.
void setMeshBB(Magnum::Range3D meshBB)
set local bounding box for meshes stored at this node
void setAbsoluteAABB(Magnum::Range3D aabb)
set the global bounding box for mesh stored in this node
auto getFrustumPlaneIndex() const -> int
return the frustum plane in last frame that culls this node
void setFrustumPlaneIndex(int index)
set frustum plane in last frame that culls this node

Protected functions

void clean(const Magnum::Matrix4& absoluteTransformation) override

Protected variables

SceneNodeType type_
int id_
SceneNodeTags sceneNodeTags_
Magnum::Range3D meshBB_
the local bounding box for meshes stored at this node
Magnum::Range3D cumulativeBB_
Corrade::Containers::Optional<Magnum::Range3D> worldCumulativeBB_
Magnum::Matrix4 absoluteTransformation_
The absolute translation of this node, updated in clean.
Corrade::Containers::Optional<Magnum::Range3D> aabb_
the global bounding box for static meshes stored at this node
int frustumPlaneIndex
the frustum plane in last frame that culls this node
esp::sensor::SensorSuite* nodeSensorSuite_
esp::sensor::SensorSuite* subtreeSensorSuite_
std::vector<int> semanticIDs_

Function documentation

void esp::scene::SceneNode::setSceneNodeTags(SceneNodeTags sceneNodeTags)

Sets sceneNodeTags_ of SceneNode.

Parameters
sceneNodeTags in SceneNodeTags to set enumset sceneNodeTags_ to

void esp::scene::SceneNode::addSceneNodeTag(SceneNodeTag sceneNodeTag)

Add SceneNodeTag to sceneNodeTags_ of SceneNode.

Parameters
sceneNodeTag in SceneNodeTag to add to enumset sceneNodeTags_

void esp::scene::SceneNode::removeSceneNodeTag(SceneNodeTag sceneNodeTag)

Remove SceneNodeTag from sceneNodeTags_ of SceneNode.

Parameters
sceneNodeTag in SceneNodeTag to remove from enumset sceneNodeTags_

SceneNode& esp::scene::SceneNode::createChild(SceneNodeTags childNodeTag = {})

Create a new child SceneNode and return it. NOTE: this SceneNode owns and is responsible for deallocating created child NOTE: child node inherits parent id by default

SceneNode& esp::scene::SceneNode::setParent(SceneNode* newParent)

Sets parent SceneNode of this SceneNode, updates parent's nodeSensorSuite and ancestors' subtreeSensorSuites NOTE: Overloads MagnumObject::setParent.

Parameters
newParent in pointer to SceneNode of new parent SceneNode of this SceneNode
Returns reference to self

int esp::scene::SceneNode::getShaderObjectID(int idToGetIDX) const

Retrieve the appropriate semantic/descriptive ID based on the query.

Parameters
idToGetIDX The index of the ID to get
Returns the semantic value corresponding to the given index

void esp::scene::SceneNode::setSemanticIDVector(const std::vector<int>& _semanticIDs)

Set the value for the various semantic IDs to be rendered by this scene node. As values are added, we want to make sure we support shorter, older vectors.

Parameters
_semanticIDs The vector of semantic sensor IDs this scene node will use for rendering. This vector might not be the same size as the current vector.

const Magnum::Range3D& esp::scene::SceneNode::computeCumulativeBB()

recursively compute the cumulative bounding box of the full scene graph tree for which this node is the root

const Magnum::Range3D& esp::scene::SceneNode::getCumulativeBB() const

return the cumulative bounding box of the full scene graph tree for which this node is the root

Variable documentation

Magnum::Range3D esp::scene::SceneNode::cumulativeBB_ protected

the cumulative bounding box of the full scene graph tree for which this node is the root

Corrade::Containers::Optional<Magnum::Range3D> esp::scene::SceneNode::worldCumulativeBB_ protected

The cumulativeBB in world coordinates This is returned instead of aabb_ if that doesn't exist due to this being a node that is part of a dynamic object

std::vector<int> esp::scene::SceneNode::semanticIDs_ protected

The semantic category of this node. Used to render attached Drawables with Semantic sensor when no perVertexObjectIds are present.