Kinematic body to map visually detected presences?

Hello.
I'll try to make a long story short.
I'm writing an application to handle an interactive floor. People walking on the floor are seen by a videocamera and represented in the application by an "array of circles". Translation: a person on the floor will be seen as a list of circles, each one with a center and a radius. For instance, see my hand seen by this application
Image
(Ok, in this case the camera isn't pointing to the floor ^^_ )

I'd like to "bring my hand" inside my Box2D world. The idea is to create a set of cirular static or cinematic bodies whose position and size should move frame by frame to match the green circles.

A ball (or other dinamic bodies) will be on the floor, striked around by the moving green circles.

I see I can't "move around" static objects (no SetPos for a b2Body object).
It seems to me kinematic bodies are there to help me, but there's something I can't understand. How can I place them around simply manipulating their velocity?

Am I missing something?

Thanks for your attention and for any help you'll be able to provide.
AFAIK you *can* move static objects. They are static because they do not move by themselves.
Try b2Body::SetTransform(const b2Vec2& position, float32 angle).
A warning from the header file: Manipulating a body's transform may cause non-physical behavior. But I don't think this will apply to statics.

Regards.
Thanks rodrigorc. I feel a bit dumb... I was looking (and couldn't find) a function like "GetPosition"... SetTransform. Of course! ^^_
I have another question on this topic.
Can I also change the size of a static body? The "presence circles" (i.e. the green circles from my machine vision application) change their position and size to match the detected object at every frame. As I said, I'd like to recreate these "presence circles" in the box2d world and let them reflect the data coming from the machine vision unit.
I can find no function to alter the size of a body (either dynamic, static or cinematic), so I'm guessing I can act per-frame, destroying every static body and creating the new ones (with updated sizes) for every frame.
Is this expensive in terms of performance?

Thanks
Again on this topic:
I am thinking a lot about rodrigorc assertion: "A warning from the header file: Manipulating a body's transform may cause non-physical behavior".
After some experiments I think I'm on a wrong path.
It seems to me that moving "by hand" a body in Box2D, setting his position frame by frame on kinematic basis disrupts Box2D's dynamic simulation, am I right?
To make things work I must "think" in dynamic terms, not kinematics. Apply forces and impulses to bodies instead of setting positions by hand.
I think I should drop the concept of mapping "green circles" to static bodies and start thinking in terms of forces the green circles should generate against my ball/soft body when they come close.

Ok, I'm mostly talking to myself, but any opinion will be appreciated.
Thanks
Hi again.
I've been playing with a problem similar to yours and this is what I discovered.

You *can* change the size of a body, but not directly, because the bodies themselves don't have size. They have fixtures, the fixtures have shapes and the shapes have sizes.
For example, I have a body that hold just one fixture with a b2CircleShape.
Code:
        b2Fixture *fix = body->GetFixtureList();
        b2Shape *shape = fix->GetShape();
        shape->m_radius *= 1.1f;

Naturally, you may prefer to save the b2Fixture pointer from the call to CreateFixture(), particularly if your body contains several of them.

And about the impulse / force issues, I'm getting good enough results with kinematics bodies instead of static ones:
Code:
    b2Vec2 newPos;
    float newAngle;
    ...
    body->SetLinearVelocity(60.0f * (newPos - body->GetPosition()));
    body->SetAngularVelocity(60.0f * (newAngle - body->GetAngle()));

Being 60.0f the inverse of the world time-step.

Hope this helps.
--
Rodrigo
Thanks again rodrigorc.
The Box2d stuff is only a part of a quite big project and it (Box2D ^^_ ) deserves more attention...
Your hints are very appreciated and I'll focus on them in the next days.
I'll try your approach with kinematic objects.
Ciao

Orf Quarenghi

Original thread: https://box2d.org/forum/viewtopic.php?t=6945