Difference between revisions of "Materialization Effects 2"
Jump to navigation
Jump to search
Nika Rugani (talk | contribs) (Created page with "<lsl> integer links = LINK_SET; float alpha_increment = 0.01; nrFadeAlpha(float start_point, float end_point, float speed) { start_point = nrFloatCheck(start_point); en…") |
m (<lsl> tag to <source>) |
||
(3 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
< | <source lang="lsl2"> | ||
integer links = LINK_SET; | integer links = LINK_SET; | ||
Line 40: | Line 40: | ||
return 1.0; | return 1.0; | ||
} | } | ||
return src; | |||
} | } | ||
nrSetGlow(integer link_num, float glow, integer sides) | nrSetGlow(integer link_num, float glow, integer sides) | ||
{ | { | ||
Line 65: | Line 58: | ||
touch_start(integer num) | touch_start(integer num) | ||
{ | { | ||
if(llGetAlpha(ALL_SIDES)>0.5) | if(llGetAlpha(ALL_SIDES)>0.5) | ||
{ | { | ||
Line 79: | Line 71: | ||
} | } | ||
} | } | ||
}</ | }</source> |
Latest revision as of 23:05, 24 January 2015
integer links = LINK_SET;
float alpha_increment = 0.01;
nrFadeAlpha(float start_point, float end_point, float speed)
{
start_point = nrFloatCheck(start_point);
end_point = nrFloatCheck(end_point);
speed = nrFloatCheck(speed);
if(start_point!=end_point)
{
if(start_point<end_point)
{
do
{
start_point = nrFloatCheck((start_point+speed));
llSetLinkPrimitiveParamsFast(links, [PRIM_COLOR, ALL_SIDES, llGetColor(ALL_SIDES), start_point]);
}while(start_point<end_point);
}
else
{
do
{
start_point = nrFloatCheck((start_point-speed));
llSetLinkPrimitiveParamsFast(links, [PRIM_COLOR, ALL_SIDES, llGetColor(ALL_SIDES), start_point]);
}while(start_point>end_point);
}
}
}
float nrFloatCheck(float src)
{
if(src<=0)
{
return 0.0;
}
else if(src>=1)
{
return 1.0;
}
return src;
}
nrSetGlow(integer link_num, float glow, integer sides)
{
llSetLinkPrimitiveParamsFast(link_num, [PRIM_GLOW,sides,glow]);
}
default
{
on_rez(integer a)
{
nrSetGlow(LINK_SET, 0.1, ALL_SIDES);
nrFadeAlpha(0, 1.0, alpha_increment);
nrSetGlow(LINK_SET, 0.0, ALL_SIDES);
}
touch_start(integer num)
{
if(llGetAlpha(ALL_SIDES)>0.5)
{
nrSetGlow(LINK_SET, 0.1, ALL_SIDES);
nrFadeAlpha(1.0, 0.0, alpha_increment);
nrSetGlow(LINK_SET, 0.0, ALL_SIDES);
}
else
{
nrSetGlow(LINK_SET, 0.1, ALL_SIDES);
nrFadeAlpha(0.0, 1.0, alpha_increment);
nrSetGlow(LINK_SET, 0.0, ALL_SIDES);
}
}
}