[Opensim-users] NPCs DoMoveToPosition vs DoAutoPilot

Teravus Ovares teravus at gmail.com
Thu Oct 28 20:35:57 UTC 2010


* Every avatar in the Scene is represented by a ScenePresence
* The Scene contains Objects and Avatars and Parcels and terrain and all
that good stuff
* The ScenePresence requires you to pump messages to it for it to do normal
movement.

* When you use the Move To Position option, you don't actually need to do
much calculation, you just create the object with a compatible body
rotation.   The rest is just filler and you feed that to the
ScenePresence.   I was using the frame event count mod 5 to pump a message
every 5 frames.   It isn't so much the message data as much as the action of
sending the message using  HandleAgentUpdate.    The code in the
HandleAgentUpdate method actually implements getting you from point A to
point B.   It assumes the avatar's known rotation is sent in the
BodyRotation member and if the BodyRotation isn't reasonable, it might send
you off in another direction to try and correct your course.

Alternatively, you could create a full AgentUpdateArgs and not use the Move
to Position functionality.    You'd do that the same way except you wouldn't
call the respective Move To Position method and you'd create a feedback
controller that fed the proper movement flags to the ScenePresence.

Teravus


On Thu, Oct 28, 2010 at 2:02 PM, bodzette Coignet <bodzettecoignet at gmail.com
> wrote:

> Thanks again Teravus.
>
> Anybody who understands how avatars move willing to take a stab at
> sense-checking my vague understanding?
>
> Here's what I think happens when an avatar moves based on the code Teravus
> produced and my somewhat vague understanding of scenes and regions:
>
> * There is a scene object where all the avatars who are active in a region
> live.
>
>  * Each of the avatars is associated with a scenepresence which is
> basically your particular avatar's view of the scene.
>
> * What you need to do to move an avatar is update some part of your
> scenepresence and the corresponding scene will ripple through to all the
> other scenepresences of the other avatars that have you in their field of
> vision.
>
> * So using the rotation of the av, the current position and the destination
> position of the av what I need to do is generate the avatar movement
> arguments (which I should be able to do by looking at how it's done for a
> real avatar and Teravus's code) and create an update of the screnepresence
> object for each step the avatar takes until the movement is completed.
>
>
>
>
> _______________________________________________
> Opensim-users mailing list
> Opensim-users at lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/opensim-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://opensimulator.org/pipermail/opensim-users/attachments/20101028/c7e9d8f1/attachment.html>


More information about the Opensim-users mailing list