[sldev] How to move the avatar with finer, high precision increments?

John Hurliman jhurliman at wsu.edu
Tue Mar 13 22:18:49 PDT 2007


Ettore Pasquini wrote:
> Hi,
>
> I want to add support for an external input device that I intend to use for
> navigation in SL. The device produces high-res values that I'd like to use
> to move the avatar around with high sensitivity.
>
> So far I had great results for pitch and yaw manipulations (LLAgent::pitch()
> and moveYaw()). However I have unsatisfactory results for moving F/B,
> sliding L/R, flying U/D because the APIs I am using are the same used for
> the keyboard: LLAgent::moveAt/moveLeft/moveUp which are basically on/off
> calls. 
>
> Can anybody point me to something that will allow me to specify higher
> precision values? Something similar to the moveYaw(F32) method would be
> great and if this doesn't exist yet, any hints on how to implement such a
> feature would be highly appreciated as well.
>
> Thanks!
>
> Ettore
>   

High precision movement has been accomplished by libsecondlife team 
members but you have to use some tricks. Movement is done by sending 
AgentUpdate packets with simple status flags saying whether you are 
pushing forward/back/left/right/up/down/etc for basic movement. The 
trick is to look at your current velocity and do your basic equal and 
opposite reaction calculations to move the avatar in a direction and 
then stop on a dime. By setting the current rotation in AgentUpdate you 
can control which direction you are moving, and bringing it all together 
you can achieve precise movement. Maybe I can dig up some code on Monday.

John Hurliman


More information about the SLDev mailing list