Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Non Physical Movement

Zuzi Martinez
goth dachshund
Join date: 4 Sep 2004
Posts: 1,860
02-27-2005 00:28
i haven't been able to find anything. can sombody please point me to any resources about non physical vehicle movement and issues and discussion about it? thanks.
McWheelie Baldwin
Registered User
Join date: 9 Apr 2004
Posts: 154
02-27-2005 02:03
Non-physical movement can be used, however, it won't be smooth movement. The basic way of doing movement without the physics engine is to either use llSetPos(<x, y, z>;); or llSetPrimitiveParams([PRIM_POSITION, <x, y, z>]);. You would also need to use a non-physical rotation call, such as llSetRot(); Most vehicles don't use this method, simply because of the harshness of movement. Without knowing what it is you're trying to actually accomplish, the best I can do is point you to the LSL wiki, and suggest reading up on the kinematic functions in the dynamics/movement section. If you would like to discuss this in more detail, either send me a PM through the forums, or IM me when the grid is back up. :D

Good Luck,
McW
_____________________


Kyrah Abattoir
cruelty delight
Join date: 4 Jun 2004
Posts: 2,786
02-27-2005 02:52
yehaaa the topic on the dreadnought secrets rise again ^_^

actually its not really a secret, just the art to implement it properly

the issues:
-jerky movements
-sim lines crossing problems
-unable to have "standing passengers" when moving
_____________________

tired of XStreetSL? try those!
apez http://tinyurl.com/yfm9d5b
metalife http://tinyurl.com/yzm3yvw
metaverse exchange http://tinyurl.com/yzh7j4a
slapt http://tinyurl.com/yfqah9u
Zuzi Martinez
goth dachshund
Join date: 4 Sep 2004
Posts: 1,860
02-27-2005 02:53
basically i'm making a vehicle that's just too many prims to use real vehicle code plus it can be slow and doesn't matter if it's kinda jerky. i was thinking maybe llMoveToTarget and llRotLookAt was the way to go but i need to read up and see whether those work and whether this non physical way gets nasty when you rotate your heading and if you have to go to alot of trouble to figure out where to move to next. i guess that's like local versus global coordinates stuff. complicated! i already spent way too much time fighting this stuff trying to make an object that could rez another object in the same relative position no matter how you rotate it. i can't take the ordeal again. :D

it will all be one linkset which i think will help some.

edit: umm i guess llMoveToTarget requires physics so forget i'm that ignorant hehe.
Shack Dougall
self become: Object new
Join date: 9 Aug 2004
Posts: 1,028
02-27-2005 03:23
Zuzi,

As you say in your edit, llMoveToTarget requires physics. That said, it isn't really that much more useful than llSetPos. Both functions have limitations that make using them difficult for a novice.

llMoveToTarget won't move an object more than 64 meters in a single call. I've read, but not verified, that llSetPos won't move an object more than 10m in a single call. llSetPos won't move an object to a Z position greater than 768m. That's probably the biggest practical difference between the two calls.

Probably, if you get down to it. llMoveToTarget is actually harder to use than llSetPos because you have to wait for it to reach the target. That requires the additional step of setting up an llTarget or some such. At least with llSetPos, you know that your object will jump immediately to the new coordinates.

I've thought for a long time that the scripting library could use a general movement script. One that makes it easy to move in arbitrary directions between two points. I basically have this script written, I just need to test and package it. Let me know if you're interested and I'll bump it to the top of my todo list.
_____________________
Prim Composer for 3dsMax
-- complete offline builder for prims and sculpties in 3ds Max
http://liferain.com/downloads/primcomposer/

Hierarchical Prim Archive (HPA)
-- HPA is is a fully-documented, platform-independent specification for storing and transferring builds between Second Life-compatible platforms and tools.
https://liferain.com/projects/hpa
Timeless Prototype
Humble
Join date: 14 Aug 2004
Posts: 216
02-27-2005 03:40
llMoveToTarget() accelerates the object during the first half of the damp time and then decelerates in the second half till it reaches its destination and will then appear to stop.

However, if you:

1. Run a timer at exactly half the speed of the llMoveToTarget() damp time;
2. Before every llMoveToTarget() in the timer event do an llStopMoveToTarget()

then you will get smooth movement. You may need to work out target positions along the way as it travels.
_____________________
Zuzi Martinez
goth dachshund
Join date: 4 Sep 2004
Posts: 1,860
02-27-2005 03:42
that would be great Shack. i'm totally cool with all the non physical movement limitations it's just the problem of figuring out how to make on object go in the direction it's pointing when you're dealing with global coordinates. :P vectors and rotations hurt me.
Shack Dougall
self become: Object new
Join date: 9 Aug 2004
Posts: 1,028
02-27-2005 03:52
From: Zuzi Martinez
that would be great Shack. i'm totally cool with all the non physical movement limitations it's just the problem of figuring out how to make on object go in the direction it's pointing when you're dealing with global coordinates. :P vectors and rotations hurt me.


I think I can put something together that will be at least a start for you. Most of what I've done so far has been on the assumption that I want the object to go from Point A to Point B. You've got the additional twist of wanting the object to point in a direction and go in that direction, but the two problems are related.

I've debated with myself several times whether this type of script was something that I wanted to sell and each time I come down on the idea that it is just too basic and useful to sell. Everyone should have this from Day 1. This is something that should be in the scripting library.

Okay, well, I guess I'll get off my butt and get it done then. :)
_____________________
Prim Composer for 3dsMax
-- complete offline builder for prims and sculpties in 3ds Max
http://liferain.com/downloads/primcomposer/

Hierarchical Prim Archive (HPA)
-- HPA is is a fully-documented, platform-independent specification for storing and transferring builds between Second Life-compatible platforms and tools.
https://liferain.com/projects/hpa
Jillian Callahan
Rotary-winged Neko Girl
Join date: 24 Jun 2004
Posts: 3,766
02-27-2005 03:58
Assuming your vehicle's "forward" is along the root prim's local X axis...

llRot2Fwd(llGetRot());

Gives you a vector pointing to a one meter offset toward "front". So , if the prim was unrotated, it would return <1,0,0>. So, moving forward 7 meters would look like:

llSetPos(llGetPos() + (llRot2Fwd(llGetRot()) * 7));


There's also llRot2Left and llRot2Up, so finding your way isn't all that hard.
This lets you turn the vehicle with llSetRot without being concerned with how you're going to travel in that direction.
Hope this helps! :D
_____________________
Shack Dougall
self become: Object new
Join date: 9 Aug 2004
Posts: 1,028
02-27-2005 04:03
Good stuff. Thanks Jillian!!
_____________________
Prim Composer for 3dsMax
-- complete offline builder for prims and sculpties in 3ds Max
http://liferain.com/downloads/primcomposer/

Hierarchical Prim Archive (HPA)
-- HPA is is a fully-documented, platform-independent specification for storing and transferring builds between Second Life-compatible platforms and tools.
https://liferain.com/projects/hpa
Zuzi Martinez
goth dachshund
Join date: 4 Sep 2004
Posts: 1,860
02-27-2005 04:05
thanks Jillian that's a huge help!