From 1d1bfe66bdd5bc11cd211d8f46071422e1441515 Mon Sep 17 00:00:00 2001 From: Alex Foster <123afoster@gmail.com> Date: Wed, 4 Dec 2024 23:50:00 -0800 Subject: [PATCH] document animmodel::addpart/parts --- src/engine/model/animmodel.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/engine/model/animmodel.h b/src/engine/model/animmodel.h index c9923d1f..1335b65a 100644 --- a/src/engine/model/animmodel.h +++ b/src/engine/model/animmodel.h @@ -644,13 +644,20 @@ class animmodel : public model bool calcanim(int animpart, int anim, int basetime, int basetime2, dynent *d, int interp, animinfo &info, int &animinterptime) const; }; - std::vector parts; + std::vector parts; //vector of part objects heap-allocated by skelmodel::addpart or part::addpart //ordinary methods ~animmodel(); animmodel(const animmodel& a) = delete; animmodel &operator=(const animmodel &a) = delete; + /** + * @brief Creates a heap-allocated part object. + * + * This must be `delete`'d or it will cause a memory leak. + * + * @return a reference to the newly created part + */ part &addpart(); /** * @brief Sets up a transformation matrix based on this model's rotation, translation, and scale