Douglas Callahan
Fresh Prince Of SL
Join date: 2 Jul 2004
Posts: 349
|
08-05-2005 00:31
So, I'm making this little thing to sit on and move around, and I'm looking for some help on controls. It's not going fast, and has no need to be physical, as I can just use llSetPos(). My question is, how can I make it go "forward", forward being whatever direction the av is facing. The controls are supposed to work like this:
Left makes the object the user is sitting on turn left, not go left. Right, does the same as left, but obviously the other way. Back makes the object rotate 180 degrees to face behind the av. So basically, the only control that moves it is forward, just going whatever way they user is facing.
Anyone know how I could do this?
P.S., no need to include permissions or llTakeControl() info here, I've already got it all in the script.
_____________________
Other than that, Mrs. Lincoln, how was the play?
|
Hiro Pendragon
bye bye f0rums!
Join date: 22 Jan 2004
Posts: 5,905
|
08-05-2005 00:51
I had considered how to do this.
Finding where to move something is the easy part - just some vector math.
The tricky part is considering obstacles and sloped land.
_____________________
Hiro Pendragon ------------------ http://www.involve3d.com - Involve - Metaverse / Emerging Media Studio
Visit my SL blog: http://secondtense.blogspot.com
|
Douglas Callahan
Fresh Prince Of SL
Join date: 2 Jul 2004
Posts: 349
|
08-05-2005 02:27
i'm not worrying about sloped land or obstacles, since this is just a way of moving around a premade area. what is the vector math needed to make it go where the av is facing?
_____________________
Other than that, Mrs. Lincoln, how was the play?
|
Jesrad Seraph
Nonsense
Join date: 11 Dec 2004
Posts: 1,463
|
08-05-2005 03:11
llRot2Fwd(llGetRot()) will give you a normalized (length = 1) vector pointing forward of your object. If you need to know what is the rotation of the AV, you can use a sensor and substitute llGetRot() for llDetectedRot(0).
_____________________
Either Man can enjoy universal freedom, or Man cannot. If it is possible then everyone can act freely if they don't stop anyone else from doing same. If it is not possible, then conflict will arise anyway so punch those that try to stop you. In conclusion the only strategy that wins in all cases is that of doing what you want against all adversity, as long as you respect that right in others.
|
Douglas Callahan
Fresh Prince Of SL
Join date: 2 Jul 2004
Posts: 349
|
08-05-2005 12:42
that works perfectly! thanks Jesrad!
_____________________
Other than that, Mrs. Lincoln, how was the play?
|
Douglas Callahan
Fresh Prince Of SL
Join date: 2 Jul 2004
Posts: 349
|
08-05-2005 13:36
Just another quick question, is there any way to make a nonphysical object hover above ground at a set distance. I was using a variation of llSetPos() and llGround() to get ground height, but this didn't work for objects (buildings) on the ground. Would the only way be a sensor to test below the object? I'm trying to avoid things that use sim recources (sensors,listens..). Any ideas?
If there is no way of doing this, I guess I could just control the vehicle to go down or up, but I would prefer if it did this automatically.
_____________________
Other than that, Mrs. Lincoln, how was the play?
|
Jesrad Seraph
Nonsense
Join date: 11 Dec 2004
Posts: 1,463
|
08-05-2005 23:41
You could use a fast sensor looking for objects of any type right below your vehicle then use the detected scale of this along with its position and your vehicle's scale to know how far you can go... but that'd be very laggy.
_____________________
Either Man can enjoy universal freedom, or Man cannot. If it is possible then everyone can act freely if they don't stop anyone else from doing same. If it is not possible, then conflict will arise anyway so punch those that try to stop you. In conclusion the only strategy that wins in all cases is that of doing what you want against all adversity, as long as you respect that right in others.
|