Difference between revisions of "PRIM POINT LIGHT"

From Second Life Wiki
Jump to: navigation, search
m (lsl code tagging)
Line 1: Line 1:
{{#if:
+
<onlyinclude>{{#if:
{{LSL_Constants/PrimitiveParams}}
+
 
 +
{{#vardefine:light_const|{{LSL Const|PRIM_POINT_LIGHT|integer|23|c=Used to {{GetSet|{{{1|}}}|get|set|/}} the prim's point light configuration}}}}
 +
 
 +
{{#vardefine:p_radius_desc|ranges from 0.1 to 10.0}}
 +
{{#vardefine:p_falloff_desc|ranges from 0.01 to 1.0}}
 +
{{#vardefine:p_intensity_desc|ranges from 0.0 to 1.0}}
 +
 
 +
}}</onlyinclude>{{#if:
 +
 
 +
{{LSL_Function/boolean|boolean}}
 +
{{LSL_Function/color|color}}
 +
 
 
}}{{LSL Constant
 
}}{{LSL Constant
 
|name=PRIM_POINT_LIGHT
 
|name=PRIM_POINT_LIGHT
 
|type=integer
 
|type=integer
 
|value=23
 
|value=23
|desc=PRIM_POINT_LIGHT is used to configure the light status of the prim
+
|desc=PRIM_POINT_LIGHT is used to configure the point light configuration of the prim
|pa={{LSL Constant/List|i_front=[&#32;[[PRIM_POINT_LIGHT]],&#32;|i_end=&nbsp;]
+
|pa={{LSL Constant/List|i_front=[&#32;{{#var:light_const}},&#32;|i_end=&nbsp;]
 
|text=When used with [[llSetPrimitiveParams]] & [[llSetLinkPrimitiveParams]]
 
|text=When used with [[llSetPrimitiveParams]] & [[llSetLinkPrimitiveParams]]
 
|i1_type=integer|i1_name=boolean
 
|i1_type=integer|i1_name=boolean
Line 13: Line 24:
 
|i4_type=float|i4_name=radius
 
|i4_type=float|i4_name=radius
 
|i5_type=float|i5_name=falloff}}
 
|i5_type=float|i5_name=falloff}}
|pb={{LSL Constant/List|i_front=[[llGetPrimitiveParams]]([&nbsp;[[PRIM_POINT_LIGHT]]|i_end=&nbsp;]);|
+
|pb={{LSL Constant/List|i_front=[[llGetPrimitiveParams]]([&nbsp;{{#var:light_const}}|i_end=&nbsp;]);|
 
|r_front=Returns the list [&nbsp;|r_end=&nbsp;]
 
|r_front=Returns the list [&nbsp;|r_end=&nbsp;]
 
|text
 
|text

Revision as of 19:52, 17 April 2008

Description

Constant: integer PRIM_POINT_LIGHT = 23;

The integer constant PRIM_POINT_LIGHT has the value 23

PRIM_POINT_LIGHT is used to configure the point light configuration of the prim

[ PRIM_POINT_LIGHT, integer boolean, vector color, float intensity, float radius, float falloff ]

[ PRIM_POINT_LIGHT, integer boolean, vector color, float intensity, float radius, float falloff ]
• integer boolean TRUE enables, FALSE disables
• vector color color in RGB <R, G, B> (<0.0, 0.0, 0.0> = black, <1.0, 1.0, 1.0> = white)
• float intensity ranges from 0.0 to 1.0
• float radius ranges from 0.1 to 10.0
• float falloff ranges from 0.01 to 1.0

When used with llSetPrimitiveParams & llSetLinkPrimitiveParams

llGetPrimitiveParams([ PRIM_POINT_LIGHT ]);

llGetPrimitiveParams([ PRIM_POINT_LIGHT ]);

Returns the list [ integer boolean, vector color, float intensity, float radius, float falloff ]

• integer boolean TRUE enables, FALSE disables
• vector color color in RGB <R, G, B> (<0.0, 0.0, 0.0> = black, <1.0, 1.0, 1.0> = white)
• float intensity ranges from 0.0 to 1.0
• float radius ranges from 0.1 to 10.0
• float falloff ranges from 0.01 to 1.0

Related Articles

Constants

•  CHANGED_SHAPE

Functions

•  llSetPrimitiveParams
•  llSetLinkPrimitiveParams
•  llGetPrimitiveParams

Events

•  changed

Articles

•  Color in LSL

Examples

<lsl> // simple light source demonstrator // 8feb07 "tetsumo kuri" // thanks to squee janitor for line to dissect

integer light_s = TRUE; // "_s" for status

default {

   state_entry()
   {
     //  llSetText("click me",<1,0,0.6>,.5);  // in case you like labels
   }
   touch_start(integer total_number)
   {
       if ( light_s )
       { 
           light_s = FALSE;
           // fullbright doesn't have anything to do with light in NEW(2006?) lighting model 
           // setting fullbright does look good though
           llSetPrimitiveParams([PRIM_FULLBRIGHT,ALL_SIDES,FALSE]);
             
           llSetPrimitiveParams([PRIM_POINT_LIGHT, FALSE,   // if this is false, light is off,
                                    <0.0,1.0,0.0>,1.0, 10.0, 0.5]); // rest of params don't matter
       }            
       else
       {
           light_s = TRUE;
           //llSetPrimitiveParams([PRIM_FULLBRIGHT,ALL_SIDES,TRUE]);   //leave fullbright commented for now
           llSetPrimitiveParams([PRIM_POINT_LIGHT,TRUE,
                                   <1.0,0.7,1.0>,  // light color vector range: 0.0-1.0 *3
                                   1.0,            // intensity    (0.0-1.0)
                                   10.0,           // radius       (.1-10.0)
                                   0.6 ]);         // falloff      (.01-1.0)
               
           // this could have been done in one line, like this     
           //llSetPrimitiveParams([PRIM_FULLBRIGHT,ALL_SIDES,FALSE,PRIM_POINT_LIGHT,TRUE,<1.0,1.0,0.5>,20,1.0,0.5]);
           //      ... but thats kinda hard to take in...       
       }
       //llSay(0, " Click!");
   }

} </lsl>

Deep Notes

Search JIRA for related Issues

Signature

integer PRIM_POINT_LIGHT = 23;