Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Movent A->B via physics

rup Eizenberg
Registered User
Join date: 23 May 2008
Posts: 31
01-11-2009 16:42
I was wondering if there is available code out there that realizes the following

- entirely physics based movement
- Moving from current position to <Vector> either via input or obtained from sensor
- object is floating and movement is realized via force impulses. Meaning it slowly speeds up to a terminal velocity then starts breaking when getting close
- object faces destination with llTargetOmega for smooth movements.

Any hints or tips would be appreciated. I found something similar years ago on the board but those articles are gone.
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
01-12-2009 00:16
I can't imagine target omega being precise enough to get a correct facing, try the ll*LookAt functions instead, similarly llTarget will get you tracking whether you're at your destination or not, and either llMoveToTarget or that in combination with a starting llApplyImpulse or llSetForce for actually getting there... don't forget the related llStop* functions.

this section should be helpful
http://wiki.secondlife.com/wiki/Category:LSL_Movement
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
rup Eizenberg
Registered User
Join date: 23 May 2008
Posts: 31
01-12-2009 09:02
Thank You for the help Void!

Does anyone remember this proof of concept code from way back, or any other codesnipplets that are going into that direction?
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
01-12-2009 09:16
/me suggests voting for SVC-1479.
From: SVC-1479
New llFunction: like llMoveToTarget but with more damping control

Currently llMoveToTarget has two parameters, the destination vector and the time to reach the target. However the current llMoveToTarget slows down towards the end of its movement phase which makes it wholly unsuitable for projectiles (simple cases where you just want an effect, not an actual weapon). I propose a third parameter which controls the rate of acceleration and deceleration (optionally a fourth parameter so the first controls acceleration, and the second controls deceleration) so that the object slows down less or not at all at a 0 setting. This would have the effect of sharper acceleration/deceleration, to the point of instant acceleration, constant speed during travel, and then instant deceleration to a stop at the destination.

Though the description is mostly based around weapons, it'd be useful in many areas..

Vote at: http://jira.secondlife.com/browse/SVC-1479
_____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!!
- Go here: http://jira.secondlife.com/browse/SVC-1224
- If you see "if you were logged in.." on the left, click it and log in
- Click the "Vote for it" link on the left