[A.I.] A controller to synthesize human movements random like


i am fairly new to C++(just graduated a b.sc. in computer science) and i dont really know how to do what i want in a professional way.

The basic principle is synthesizing realistic human "micro" motions ( like arm swiveling, head shaking..blinking..eye gaze..breathing..) and sent it over TCP to a 3D rendering framework.

To achieve this, i created an interface IGenerator, and the (i call them generators) movement synthesizers inherit from this class. Those generators compute some stuff like blinking or little gestures. Each body part has its own generator(ArmGenerator, HandGenerator...). Each generator works within its own thread. When something is computed, it puts every data in a std::deque<Vector3f> container(for euler angles). Every Bodyjoint has its own std::deque<Vector3f>..which means, a hand for example has 16 std::deque<Vector3f> (1 for the wrist and 5x3 for each finger with 3 joints), this is a point where i think my code is really unefficient, but i dont know how to do it better. Since i use only push_back and pop_front from the deque, which has O(1), in theory my code should not be that bad..but it looks really messy.

Those Generators are attached to the "Dispatcher" which sends the euler angles over tcp to the framework. This Dispatcher collects all data with the shared collect() function from the interface. One data package is collected by popping the first element of the deque (if it is not empty).

With this said, i come the point where i need your help. The first thing is: Is this a good way of approaching this problem? How would you do it?

Second: At the moment each "generator" has its own "think" thread. This works fine for some constant movements like blinking or head shaking. But if i want to do something like "scratch the back of your head", i need to work with both head and arm generator. This means i need something like a gamecontroller who tells the other generators something like " raise your arms and make a scratch movement" and at the same time to the head" turn your head a bit but dont move until the scratch is over" and to the gaze generator "look in the direction the head is facing while scratching". What would be a good way to do this?
Topic archived. No new replies allowed.