Difference between revisions of "Talk:LlRotLookAt"

From Second Life Wiki
Jump to navigation Jump to search
 
(14 intermediate revisions by 5 users not shown)
Line 10: Line 10:


[[User:Dale Innis|Dale Innis]] 19:00, 21 March 2011 (PDT)
[[User:Dale Innis|Dale Innis]] 19:00, 21 March 2011 (PDT)
== Does anyone know... ==
...what the strength parameter actually pertains to? theoretically it could have to do with energy/mass (as some users have assumed), or it could have to do with the with the strength of the logarithmic/exponential scale of speed. I'd like to update the description, but without knowing what strength applies to (or how it's derived) it doesn't make much sense. currently my definition stands at "''smoothly changes object rotation to target over (damping)seconds''". if Strength is energy/mass related we need a formula to derive the required minimal values. If it's the logarithmic speed of change, then we need at least an estimate of the curve formula so we can derive strength values to use.<br/>-- '''[[User:Void_Singer|Void]]''' <sup><small>([[User_talk:Void_Singer|talk]]|[[Special:Contributions/Void_Singer|contribs]])</small></sup> 02:06, 4 October 2011 (PDT)
:Strength may have something to do with how hard it tries to achieve it's goal when there are competing forces. -- '''[[User:Strife_Onizuka|Strife]]''' <sup><small>([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])</small></sup> 09:21, 5 October 2011 (PDT)
:P.S. if you figure it out, please put it in [[Template:LSL_Function/strength]] because (to my knowledge) works the same everywhere.
:P.S.S. It may be equivalent to the *_EFFICIENCY flags used in [[llSetVehicleFloatParam|vehicles]].
:Someone may want to ask Andrew about this at his office hour. {{wikipedia|Damping}} strength sounds like it might be ζ and damping is used to calculate the required velocity. ---- '''[[User:Strife_Onizuka|Strife]]''' <sup><small>([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])</small></sup> 09:44, 5 October 2011 (PDT)
== Bug closed ==
The bug associated with this issue ({{Jira|SVC-1903}}) is fixed. Is there anyone maintaining that? --[[User:Pedro Oval|Pedro Oval]] 06:07, 24 January 2013 (PST)
:Thanks for the heads up. -- '''[[User:Strife_Onizuka|Strife]]''' <sup><small>([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])</small></sup> 20:27, 25 January 2013 (PST)
== RotLookAt, keeping one axis parallel to horizont ==
I didn't find a code for that in the wiki, so here's a snippet of code that will make a prim look towards a position in the region, keeping one axis (x) parallel to the horizont.
<lsl>
llRotLookAtOneAxisParallelToHorizont(vector vDestPos)
{ //x-axis will stay parallel to horizont
        vector pos = llGetPos();
        rotation target = <0.0, -SQRT2/2.0, 0.0, SQRT2/2.0> * llRotBetween( <1.0,0.0,0.0>, <vDestPos.x, vDestPos.y, pos.z> - pos) * llRotBetween( <0.0,0.0,1.0>, vDestPos - pos);
        llSetLocalRot(target);
}
default
{
    state_entry()
    {
    }
    touch_start(integer n)
    {
        vector detected = llDetectedPos( 0 );
        llRotLookAtOneAxisParallelToHorizont(detected);
    }
}
</lsl>
[[User:MartinRJ Fayray|MartinRJ Fayray]]
== Error prim exist ==
I encountered a problem caused by error prim.
llRotLookAt() or llLookAt() didn't work and llMoveToTarget() was working.
It's just a one prim sphere object.
if it turns into non physical object, llRotLookAt() or llLookAt() works and llMoveToTarget() doesn't work.
This means the object's "Physical" property works opposite feature for rotation functions.
If kind of primes are able to exist permanently, I can't trust any properties in primes.
If you want to see this error prim, please contact me, I'll give you it with a test script.
I hope it's simple mistake of mine.

Latest revision as of 00:13, 26 November 2013

An LSL example that shows how to look at some (vector) position would be nice. Every time I've looked at this call, it's been because I had an object that I wanted to look at (face) some other object or avatar. Usually, I hack at it until it works or run away and start drinking instead.

Meade Paravane 21:06, 18 August 2009 (UTC)

Description is wrong and/or unhelpful

The description of the actual function is "Cause object to point its forward axis towards target". This makes no sense, since "target" is a rotation. What would it mean for an object to point its forward axis "towards" a rotation?

I would love to see a nice clear English description of what this function actually does.  :) Every time I've started out trying to use it, I've ended up using something else (llLookAt(), or llSetRot(), or something else). Is this just the equivalent of llSetRot() for physical objects? (In which case it's odd that it works for nonphysical ones as well.) Or does it do something different / more complicated? Does the "forward" (i.e. increasing-x) axis actually play any sort of part in its function? Inquiring scripters want to know!

Dale Innis 19:00, 21 March 2011 (PDT)

Does anyone know...

...what the strength parameter actually pertains to? theoretically it could have to do with energy/mass (as some users have assumed), or it could have to do with the with the strength of the logarithmic/exponential scale of speed. I'd like to update the description, but without knowing what strength applies to (or how it's derived) it doesn't make much sense. currently my definition stands at "smoothly changes object rotation to target over (damping)seconds". if Strength is energy/mass related we need a formula to derive the required minimal values. If it's the logarithmic speed of change, then we need at least an estimate of the curve formula so we can derive strength values to use.
-- Void (talk|contribs) 02:06, 4 October 2011 (PDT)

Strength may have something to do with how hard it tries to achieve it's goal when there are competing forces. -- Strife (talk|contribs) 09:21, 5 October 2011 (PDT)
P.S. if you figure it out, please put it in Template:LSL_Function/strength because (to my knowledge) works the same everywhere.
P.S.S. It may be equivalent to the *_EFFICIENCY flags used in vehicles.
Someone may want to ask Andrew about this at his office hour. "Wikipedia logo"Damping strength sounds like it might be ζ and damping is used to calculate the required velocity. ---- Strife (talk|contribs) 09:44, 5 October 2011 (PDT)

Bug closed

The bug associated with this issue (SVC-1903) is fixed. Is there anyone maintaining that? --Pedro Oval 06:07, 24 January 2013 (PST)

Thanks for the heads up. -- Strife (talk|contribs) 20:27, 25 January 2013 (PST)

RotLookAt, keeping one axis parallel to horizont

I didn't find a code for that in the wiki, so here's a snippet of code that will make a prim look towards a position in the region, keeping one axis (x) parallel to the horizont. <lsl> llRotLookAtOneAxisParallelToHorizont(vector vDestPos) { //x-axis will stay parallel to horizont

       vector pos = llGetPos();
       rotation target = <0.0, -SQRT2/2.0, 0.0, SQRT2/2.0> * llRotBetween( <1.0,0.0,0.0>, <vDestPos.x, vDestPos.y, pos.z> - pos) * llRotBetween( <0.0,0.0,1.0>, vDestPos - pos);
       llSetLocalRot(target);

} default {

   state_entry()
   {
   }
   touch_start(integer n)
   {
       vector detected = llDetectedPos( 0 );
       llRotLookAtOneAxisParallelToHorizont(detected);
   }

} </lsl> MartinRJ Fayray

Error prim exist

I encountered a problem caused by error prim.

llRotLookAt() or llLookAt() didn't work and llMoveToTarget() was working.

It's just a one prim sphere object.

if it turns into non physical object, llRotLookAt() or llLookAt() works and llMoveToTarget() doesn't work.

This means the object's "Physical" property works opposite feature for rotation functions.

If kind of primes are able to exist permanently, I can't trust any properties in primes.

If you want to see this error prim, please contact me, I'll give you it with a test script.

I hope it's simple mistake of mine.