Utility: Add a better way to attach objects to joints

This commit is contained in:
SirLynix
2022-08-30 18:31:04 +02:00
parent 45c947faf1
commit 7949c57f16
9 changed files with 67 additions and 20 deletions

View File

@@ -20,7 +20,9 @@ namespace Nz
SkeletonComponentBase(SkeletonComponentBase&&) noexcept = default;
~SkeletonComponentBase() = default;
virtual const Joint& GetAttachedJoint(std::size_t jointIndex) const = 0;
inline std::size_t FindJointByName(const std::string& jointName) const;
inline const Joint& GetAttachedJoint(std::size_t jointIndex) const;
inline const std::shared_ptr<Skeleton>& GetSkeleton() const;
SkeletonComponentBase& operator=(const SkeletonComponentBase&) = default;
@@ -29,6 +31,8 @@ namespace Nz
protected:
SkeletonComponentBase(std::shared_ptr<Skeleton> skeleton);
virtual const Skeleton& GetAttachedSkeleton() const = 0;
std::shared_ptr<Skeleton> m_referenceSkeleton;
};
}