This commit is contained in:
Fred Beckhusen
2015-08-07 15:34:30 -05:00
parent ce47ec2f3e
commit fde850293c
8080 changed files with 0 additions and 2443112 deletions

View File

@@ -1,6 +0,0 @@
<Project name="Car_Script_Front_Wheel" guid="D6F47753-6C00-1014-B904-200204C60A89">
<Object name="Object" guid="D6F4782C-6C00-1014-B904-200204C60A89">
<Script name="Car_Script_Front_Wheel_1.lsl" guid="D6F49460-6C00-1014-B904-200204C60A89">
</Script>
</Object>
</Project>

View File

@@ -1,97 +0,0 @@
// :CATEGORY:Vehicles
// :NAME:Car_Script_Front_Wheel
// :AUTHOR:Anonymous
// :CREATED:2010-01-10 05:20:56.000
// :EDITED:2013-09-18 15:38:50
// :ID:155
// :NUM:223
// :REV:1.0
// :WORLD:Second Life
// :DESCRIPTION:
// Car Script (Front Wheel).lsl
// :CODE:
rotation Inverse(rotation r)
{
r.x = -r.x;
r.y = -r.y;
r.z = -r.z;
return r;
}
rotation GetParentRot()
{
return Inverse(llGetLocalRot())*llGetRot();
}
SetLocalRot(rotation x)
{
llSetRot(x*Inverse(GetParentRot()));
}
default
{
state_entry()
{
}
link_message(integer sender_num, integer num, string str, key id)
{
if(str == "WHEEL_DRIVING")
{
state driving;
}
}
}
state driving
{
state_entry()
{
SetLocalRot(llEuler2Rot(<-1 * PI_BY_TWO,0,0> ));
llSetTimerEvent(0.5);
}
timer()
{
vector vel = llGetVel();
float speed = llVecMag(vel);
llSetTextureAnim(ANIM_ON|LOOP|SMOOTH|ROTATE,ALL_SIDES,0,0,0,0,speed);
}
link_message(integer sender_num, integer num, string str, key id)
{
if(str == "WHEEL_DEFAULT")
{
state default;
}
if(str == "WHEEL_FORWARD")
{
SetLocalRot(llEuler2Rot(<-1 * PI_BY_TWO,0,0> ));
}
if(str == "WHEEL_REVERSE")
{
SetLocalRot(llEuler2Rot(<-1 * PI_BY_TWO,0,0> ));
}
if(str == "WHEEL_LEFT")
{
SetLocalRot(llEuler2Rot(<-1 * PI_BY_TWO, -1 * PI_BY_TWO / 2, 0> ));
}
if(str == "WHEEL_RIGHT")
{
SetLocalRot(llEuler2Rot(<-1 * PI_BY_TWO, PI_BY_TWO / 2, 0> ));
}
}
state_exit()
{
SetLocalRot(llEuler2Rot(<-1 * PI_BY_TWO,0,0> ));
llSetTextureAnim(0,ALL_SIDES,0,0,0,0,0);
}
}
// END //