Change font size
It is currently Wed Aug 15, 2018 1:17 pm

Forum rules


{L_IMAGE}



Post a new topicPost a reply Page 1 of 1   [ 2 posts ]
Author Message
 Post subject: New temp function (look at)
PostPosted: Wed Dec 10, 2008 7:52 pm 

Joined: Fri Nov 07, 2008 5:26 am
Posts: 2
Yeah I noticed this one was missing and a friend wanted it, so here's my remake for anyone that would like a copy.

{L_CODE}:
rotation emLookAt(vector vTarget)
{
     vector vLocation = llGetPos();
     vLocation.x = 255;
     vLocation = llGetPos() - vLocation;
     vTarget = llGetPos() - vTarget;
     vector vTurn = vLocation;
     vector vTTurn = vTarget;
     vTurn.z = 0;
     vTTurn.z = 0;
     
     float fDist = llVecMag (vTTurn);
     rotation rRot = llRotBetween(vTurn,vTTurn);
     float fUp = llAtan2(vTarget.z, fDist);
     rotation x_45 = llEuler2Rot( <0,fUp, 0> );
     rRot =x_45 * rRot;   
        return rRot;
}


Any input how to improve or any bugs anyone finds please let me know, remember it returns the rotation so you still need llSetRot to make it point at something.


Top
 Profile  
 
 Post subject: Re: New temp function (look at)
PostPosted: Mon Dec 15, 2008 10:34 am 

Joined: Fri Mar 14, 2008 4:29 am
Posts: 17
Thank you Emily..I will be using this function soon :D


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 2 posts ]


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
610nm Style by Daniel St. Jules of Gamexe.net