Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--Properly initialize std::vector member variable to be correct size #2388

Merged
merged 1 commit into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/esp/scene/SceneNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ namespace scene {
SceneNode::SceneNode()
: Mn::SceneGraph::AbstractFeature3D{*this},
nodeSensorSuite_(new esp::sensor::SensorSuite(*this)),
subtreeSensorSuite_(new esp::sensor::SensorSuite(*this)) {
subtreeSensorSuite_(new esp::sensor::SensorSuite(*this)),
semanticIDs_(static_cast<int>(SceneNodeSemanticDataIDX::NUM_SEMANTIC_IDS),
0) {
setCachedTransformations(Mn::SceneGraph::CachedTransformation::Absolute);
absoluteTransformation_ = absoluteTransformation();
// Once created, nodeSensorSuite_ and subtreeSensorSuite_ are features owned
Expand Down
3 changes: 1 addition & 2 deletions src/esp/scene/SceneNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,7 @@ class SceneNode : public MagnumObject,

//! The semantic category of this node. Used to render attached Drawables with
//! Semantic sensor when no perVertexObjectIds are present.
std::vector<int> semanticIDs_{
static_cast<int>(SceneNodeSemanticDataIDX::NUM_SEMANTIC_IDS), 0};
std::vector<int> semanticIDs_;
}; // namespace scene

// Traversal Helpers
Expand Down