Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llMoveToTarget and Physics.

Da5id Zsigmond
Registered User
Join date: 26 Jan 2007
Posts: 34
12-11-2007 14:23
I'm just writing my first script to move something and was just wondering if anyone knows what will happen to a physical object being moved by the llMoveToTarget function, when that function is turned off.

Would the objects mass and velocity continue its movement or would it simply stop at the location it is at when the function is stopped?

I'm trying to make something that will slide on a smooth surface - like ice - for the winter festival and which will interact physically with other objects when they collide.

Tweaking a vehicle script to get the object to be moved apropriately in both x and y dimensions seems pretty tricky while MoveToTarget seems pretty simple but would need to be turned off on a collision with something in the way to act realistically.

The idea here is that by moving the target while the object is moving toward it, would give the equivalent of different force vectors acting on it.

If anyone has any advice about which basic approach to take:
- apply forces to an object with ApplyImpulse
- define the object as a vehicle, or
- move to target
I would love to know.

For those who might be familiar with the game I'm trying to create a curling rock.
This, when thrown down the ice with rotation, will not just go in a straight line so it will have movement in both x and y dimensions before friction stops it. Assuming it doesn't run into another rock.
Lee Ponzu
What Would Steve Do?
Join date: 28 Jun 2006
Posts: 1,770
12-11-2007 14:37
Curling? Oh, boy, the worlds second most boring activity is coming to SL (the world's most boring activity 8-) 8-)

I once found on the web a detailed physics analysis of why curling rocks curl. it turns out to be much much trickier than you at first might think. Try googling for it.

lee
_____________________
So many monkeys, so little Shakespeare.
Da5id Zsigmond
Registered User
Join date: 26 Jan 2007
Posts: 34
Curling Boring ?!?!
12-11-2007 16:12
Curling - like chess and baseball - does have a lot of strategy involved and can seem slow to the uninitiated. The fact it combines this with hurling a 44 pound rock down a hundred feet of ice and making it do tricks fascinates me. As you say the physics are very interesting.

I was going to be more modest and roughly simulate the situation rather than try to build a detailed model in SL. I need something that travels in a straight line for a while at a certain velocity / distance, and then adds a side to side component as it slows. If it hits something on the way the objects should move (we'll leave that up to SL physics). Seems simple until you hit the 'make an object go in a straight line' part in SL.
Day Oh
Registered User
Join date: 3 Feb 2007
Posts: 1,257
12-11-2007 16:32
If you're only concerned about preventing the ground from interfering with movement, llGroundRepel or llSetHoverHeight might be interesting, as long as the ground is perfectly flat. They attempt to keep the object a certain distance above ground level.



llSetBuoyancy(1.0) is often used in things like bullets to make them weightless, so they travel in a straight line.


But I bet with the vehicle system you might be able to both make the object "prefer" the XY plane, and curve too.
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
12-11-2007 17:05

From: someone
Note: The force created by calling this function persists until llMoveToTarget is called again with another target in the same script, is called with a tau of 0.0, or llStopMoveToTarget is called. This can be either helpful or hindersome, especially when using a combination of llApplyImpulse and llMoveToTarget.

Warning: If a llMoveToTarget is called from a script while a llMoveToTarget has been previously called from another script and is still running, the second one will silently fail.


llApplyImpulse may work better for your purpose
see also: llApplyRotationalImpulse
_____________________
|
| . "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...
| -