Join us in Outworldz at www.outworldz.com:9000 or follow us:

Search dozens of selected web sites for OpenSim and LSL script

New! Script Meta-Search will search thousands of scripts here and at other sites for LSL or Opensim scripts.
Loading

Want to add a script or a project? Upload it and a half million people will see it and your name here this year.

Home   Show All
Category: Contributor: Creator
Vehicles Car_Script_Rear_Wheel  

Car_Script_Rear_Wheel

Car Script (Rear Wheel).lsl

Category: Vehicles
By : Anonymous
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for Car_Script_Rear_Wheel
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Car_Script_Rear_Wheel_1.lsl
1
2 rotation Inverse(rotation r)
3 {
4 r.x = -r.x;
5 r.y = -r.y;
6 r.z = -r.z;
7 return r;
8 }
9 rotation GetParentRot()
10 {
11 return Inverse(llGetLocalRot())*llGetRot();
12 }
13 SetLocalRot(rotation x)
14 {
15 llSetRot(x*Inverse(GetParentRot()));
16 }
17
18 default
19 {
21 {
22 }
23
24 link_message(integer sender_num, integer num, string str, key id)
25 {
26
27 if(str == "WHEEL_DRIVING")
28 {
29 state driving;
30 }
31
32 }
33
34 }
35
36 state driving
37
38 {
40 {
41 SetLocalRot(llEuler2Rot(<-1 * PI_BY_TWO,0,0> ));
42 llSetTimerEvent(0.5);
43 }
44
45 timer()
46 {
47 vector vel = llGetVel();
48 float speed = llVecMag(vel);
50 }
51
52 link_message(integer sender_num, integer num, string str, key id)
53 {
54 if(str == "WHEEL_DEFAULT")
55 {
56 state default;
57 }
58
59 }
60
62 {
63 SetLocalRot(llEuler2Rot(<-1 * PI_BY_TWO,0,0> ));
64 llSetTextureAnim(0,ALL_SIDES,0,0,0,0,0);
65 }
66
67 }
68 // END //

Back to the Best Free Tools in Second Life and OpenSim.