In my case I only want to track a head so I’ve mad my own plugin.
It inherits from AActor and everything seems to be ok until I try to read the body list like
const sl::BodyData first_object = detected_bodies.body_list[0];
Notice that I can read and print detected_bodies.body_list.size() without problems, even I can read the properties of first_object but it crashes once first_object is freed.
Also I managed it to work by using
const sl::BodyData *first_object = &detected_bodies.body_list[0];
But I cannot understand the reason under the hood for that, so my questions are:
- Is there any ‘best practices’ guide?
- Is there any deeper explanation about using these types?
Regards.