Change font size
It is currently Sat Feb 16, 2019 8:40 am

Forum rules


{L_IMAGE}



Post a new topicPost a reply Page 1 of 1   [ 1 post ]
Author Message
 Post subject: Ray Caster v1.4 (to ground)
PostPosted: Wed Jan 23, 2013 9:33 pm 
Site Admin
User avatar

Joined: Sat Feb 02, 2008 5:27 pm
Posts: 843
drop this script into a cube, then hover that cube over an object and click it to get raycast info, this script is limited in its functionality and is only intended to be an example of how llCastRay can be used.

{L_CODE}:
default
{

    touch_start(integer total_number)
    {
        vector start = llGetPos();
        vector ground = start;
        ground.z = llGround( ZERO_VECTOR );
        vector end = <start.x, start.y, ground.z>;

        list results = llCastRay(start, end, [RC_DATA_FLAGS, RC_GET_NORMAL, RC_MAX_HITS, 1] );

            key uuid = llList2Key(results, 0);
            vector vect = llList2Vector(results, 1);

            string name = "Land"; // if (uuid == NULL_KEY)
            list pos;

            if (uuid != NULL_KEY)
                name = llKey2Name(uuid);
                pos = llGetObjectDetails(uuid, ([OBJECT_POS]));
            llOwnerSay("Start : " + (string)start + " - " + "End : " + (string)end + ".");
            llOwnerSay("Intercepted Object UUID : " + (string)uuid);
            llOwnerSay("Hit : " + name + " - Location : " + llList2String(pos,0) + ".");
            llOwnerSay("Ray Intersectiing @ : " + (string)vect);

        llResetScript();
    }
}


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


Who is online

Users browsing this forum: No registered users and 2 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