Follow us on Twitter
Digital Concepts Website!

Ray Caster v1.4

Compat OpenSim Aurora-Sim Diva Disto Second Life Langage Lsl
  • Titre
    Ray Caster v1.4
  • Permissions
    Copy | Modify | Transfert
  • Gratuit
    Oui
  • Page vues
    10802 fois
  • Favoris
    Ajouter aux favoris
  • J'aime
  • Voter
    (0 votes)

Déposer ce script dans un cube, puis placez ce cube sur un objet et cliquez dessus pour obtenir des informations raycast, ce script est limité dans ses fonctionnalités et est uniquement un exemple de la façon dont llCastRay peut être utilisés.

OpenSim Lsl Script : Ray Caster v1.4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Ray Caster v1.4
 
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();
 }
}