Skip to content

Commit 44919d9

Browse files
committed
bug fix: make path to avatar models relative to source file
1 parent dd25ad0 commit 44919d9

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/OpenCOVER/plugins/hlrs/GhostAvatar/controls/GhostAvatarControlsFactory.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include <filesystem>
12
#include <functional>
23
#include <iostream>
34
#include <map>
@@ -10,16 +11,20 @@ namespace
1011
{
1112
using AvatarFactory = std::function<std::unique_ptr<GhostAvatarControls>()>;
1213

14+
1315
const std::map<std::string, AvatarFactory> &createGhostAvatarControlsFactory()
1416
{
17+
static const auto modelsDir = std::filesystem::path(__FILE__).parent_path() / "models";
1518
static const std::map<std::string, AvatarFactory> factory = {
1619
{ "ghost", []
1720
{
18-
return std::make_unique<TestAvatarControls>("models/ghost_avatar.fbx", "RightArm", "");
21+
auto fbxPath = (modelsDir / "ghost_avatar.fbx").string();
22+
return std::make_unique<TestAvatarControls>(fbxPath, "RightArm", "");
1923
} },
2024
{ "planar", []
2125
{
22-
return std::make_unique<PlanarAvatarControls>("models/PLANEE3.fbx", "Arm", "Head");
26+
auto fbxPath = (modelsDir / "PLANEE3.fbx").string();
27+
return std::make_unique<PlanarAvatarControls>(fbxPath, "Arm", "Head");
2328
} },
2429
};
2530

0 commit comments

Comments
 (0)