[osg-users] ReplicantBody: body velocity problems

Renato Silveira silveira.ren at gmail.com
Wed Aug 1 07:25:42 PDT 2007


Thank you for help me. But I'm still in problem.
=(


2007/7/31, Daniel Sjolie <dsjolie at gmail.com>:
>
> Hmm...
>
> I guess it was a long time since we actually used varying speed in
> replicant body... I don't remember all the details of the top of my
> head but I think the idea was to have something like the commented out
> "walk_speed" animation in bizguy1.rbody that blends between walking
> and running depending on what speed you set... Try activating that
> animation and use something like this:
>
> action =  ..... ->getBody()->getActionPrototype( "ACT_WALK_SPEED" );



I checked the file bizguy1.rbody, the animation was not commented:

xAnimationSpeed {
        name "walk_speed"
        act_name "ACT_WALK_SPEED"
        default_speed 0.7
        Animation {
            name "walk"
        }

        Animation {
            name "run"
        }
    }


Then, I associate a keyboard key to do this action:


 rbody::ActionRequest *action =
m_body_vector[m_curr_body]->getBody()->getActionPrototype( "ACT_WALK_SPEED"
);

                if (action)
                {
                    float vel = 0.0;

                    action->setPropertyFloat( "speed", vel );

                    action->setPrioritized(false);

m_body_vector[m_curr_body]->getBody()->executeAction(action, true);
                }


When I do it, action  is NULL.
I think I must activating this animation before do it. Do you know what I'm
doing wrong?

Thank you!!

Renato




and then set the speed as before...
>
> Maybe you should add an
>
> Animation {
>      name "stand"
> }
>
> to "walk_speed" as well...
>
> I think that's the way it was suppose to work... :)
>
> /Daniel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20070801/181e3c5d/attachment.html 


More information about the osg-users mailing list