diff --git a/code/AssetLib/X3D/X3DImporter_Geometry3D.cpp b/code/AssetLib/X3D/X3DImporter_Geometry3D.cpp index edde34281..2db62dc64 100644 --- a/code/AssetLib/X3D/X3DImporter_Geometry3D.cpp +++ b/code/AssetLib/X3D/X3DImporter_Geometry3D.cpp @@ -897,7 +897,8 @@ void X3DImporter::readSphere(XmlNode &node) { StandardShapes::MakeSphere(tess, tlist); // copy data from temp array and apply scale for (std::vector::iterator it = tlist.begin(); it != tlist.end(); ++it) { - ((X3DNodeElementGeometry3D *)ne)->Vertices.push_back(*it * radius); + aiVector3D v = *it; + ((X3DNodeElementGeometry3D *)ne)->Vertices.emplace_back(v * radius); } ((X3DNodeElementGeometry3D *)ne)->Solid = solid; diff --git a/code/AssetLib/X3D/X3DImporter_Node.hpp b/code/AssetLib/X3D/X3DImporter_Node.hpp index 95b8735d4..8d33c4b7a 100644 --- a/code/AssetLib/X3D/X3DImporter_Node.hpp +++ b/code/AssetLib/X3D/X3DImporter_Node.hpp @@ -108,6 +108,10 @@ struct X3DNodeElementBase { std::list Children; X3DElemType Type; + virtual ~X3DNodeElementBase() { + // empty + } + protected: X3DNodeElementBase(X3DElemType type, X3DNodeElementBase *pParent) : Parent(pParent), Type(type) {