Difference between revisions of "LlSetSunDirection"

From Second Life Wiki
Jump to navigation Jump to search
 
(18 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{
{{
LSL_Function
LSL_Function
|func=llSetSunPosition|sort=llSetSunPosition
|func=llSetSunDirection|sort=SetSunDirection
|p1_type=vector|p1_name=position|p1_desc=A vector that is the direction of the sun in the region
|p1_type=vector|p1_name=direction|p1_desc=A vector that is the direction of the sun in the region
|p2_type=float|p2_name=Delay|p2_desc=Seconds to allow for the change
|p2_type=float|p2_name=Delay|p2_desc=Seconds to allow for the change
|func_desc=
|func_desc=
Requests the UserAgent's Viewer to change the phase of day/night to a specific SunPosition while sitting on the object containing the script.
Requests the UserAgent's Viewer to change the phase of day/night to a specific Direction while sitting on the object containing the script. ''(This function prototype assumes that the parameter specifying the SunDirection would be a vector, which is probably wrong, as Windlight appears to control this with a float which is the Arc of the Sun.)''
The transition should take the number of seconds specified by the Delay parameter.
The transition should take the number of seconds specified by the Delay parameter.
llSetSunPosition recognizes 5 preset vectors that function similar to the Menu choice World->Force Sun
llSetSunDirection recognizes 5 preset vectors that function similar to the Menu choice World->Force Sun
 
A related JIRA feature request exists at [https://jira.secondlife.com/browse/VWR-7677 VWR-7677]. Please go vote for it if this is important to you.


|constants=
|constants=
Line 17: Line 19:
{{!}} SUNRISE
{{!}} SUNRISE
{{!}} <?,?,?>
{{!}} <?,?,?>
{{!}} Sets the SunPosition to the East.
{{!}} Sets the Direction to the East.
{{!}}-  
{{!}}-  
{{!}} NOON
{{!}} NOON
{{!}} <?,?,?>
{{!}} <?,?,?>
{{!}} Sets the SunPosition to up.
{{!}} Sets the Direction to up.
{{!}}-  
{{!}}-  
{{!}} SUNSET
{{!}} SUNSET
{{!}} <?,?,?>
{{!}} <?,?,?>
{{!}} Sets the SunPosition to the West.
{{!}} Sets the Direction to the West.
{{!}}-  
{{!}}-  
{{!}} MIDNIGHT
{{!}} MIDNIGHT
{{!}} <?,?,?>
{{!}} <?,?,?>
{{!}} Sets the SunPosition to down.
{{!}} Sets the Direction to down.
{{!}}-  
{{!}}-  
{{!}} REGION_DEFAULT
{{!}} REGION_DEFAULT
{{!}} <?,?,?>
{{!}} <?,?,?>
{{!}} Sets the SunPosition to the region's current SunPosition.
{{!}} Sets the Direction to the region's current Direction.
{{!}}}
{{!}}}


|notes=
|notes=
Useful for nightclubs and space oriented sims, which will prefer night environments.
Useful for nightclubs and space oriented sims, which will prefer night environments.
Also for items such as sailboats that tend to prefer day..
Also for items such as sailboats that tend to prefer day.
This function applies to an avatar who is currently seated on a prim with a script that makes this call, much as [[llForceMouselook]] is able to implicitly get permission to change the viewer state.
This might suggest a likely permission (i.e. PERMISSION_CONTROL_ENVIRONMENT) that could be requested of the avatar: llRequestPermissions( AvatarKey, PERMISSION_CONTROL_ENVIRONMENT ) and detected when granted, by the event: run_time_permissions(integer perm) by testing the permission value against the appropriate constant if(perm & PERMISSION_CONTROL_ENVIRONMENT).
Alternatively, this function might have the Avatar Key passed as a parameter. Which could remove the implicit permission that the SIT action would grant.
 


|also_functions=
|also_functions=
{{LSL DefineRow||[[llGetSunDirection]]|Setting the SunDirection, then waiting the Delay period,  
{{LSL DefineRow||[[llGetSunDirection]]|Setting the Direction, then waiting the Delay period, and calling llGetSunDirection should return the vector specified in the original llSetSunPosition.}}
and calling llGetSunDirection should return the vector specified in the original llSetSunPosition.}}
{{LSL DefineRow||[[llForceMouselook]]|Suggests that this type of request is reasonable to send to a User Agent/Viewer.}}
{{LSL DefineRow||[[llForceMouselook]]|Suggests that this type of request is reasonable to send to a User Agent/Viewer.}}
 
{{LSL DefineRow||[[llAvatarOnSitTarget]]|Call this to determine what agent would be affected by this call.}}
Function: vector llGetSunDirection( );


|mode=request
|mode=request
|cat1=Sit
|cat1


}}
}}

Latest revision as of 07:43, 10 March 2012

Emblem-important-yellow.png LSL Feature Request
The described function does not exist. This article is a feature request.

Summary

Function: llSetSunDirection( vector direction, float Delay );

Requests the UserAgent's Viewer to change the phase of day/night to a specific Direction while sitting on the object containing the script. (This function prototype assumes that the parameter specifying the SunDirection would be a vector, which is probably wrong, as Windlight appears to control this with a float which is the Arc of the Sun.) The transition should take the number of seconds specified by the Delay parameter. llSetSunDirection recognizes 5 preset vectors that function similar to the Menu choice World->Force Sun

A related JIRA feature request exists at VWR-7677. Please go vote for it if this is important to you.

• vector direction A vector that is the direction of the sun in the region
• float Delay Seconds to allow for the change

Constants Action
SUNRISE <?,?,?> Sets the Direction to the East.
NOON <?,?,?> Sets the Direction to up.
SUNSET <?,?,?> Sets the Direction to the West.
MIDNIGHT <?,?,?> Sets the Direction to down.
REGION_DEFAULT <?,?,?> Sets the Direction to the region's current Direction.

Examples

Notes

Useful for nightclubs and space oriented sims, which will prefer night environments. Also for items such as sailboats that tend to prefer day. This function applies to an avatar who is currently seated on a prim with a script that makes this call, much as llForceMouselook is able to implicitly get permission to change the viewer state. This might suggest a likely permission (i.e. PERMISSION_CONTROL_ENVIRONMENT) that could be requested of the avatar: llRequestPermissions( AvatarKey, PERMISSION_CONTROL_ENVIRONMENT ) and detected when granted, by the event: run_time_permissions(integer perm) by testing the permission value against the appropriate constant if(perm & PERMISSION_CONTROL_ENVIRONMENT). Alternatively, this function might have the Avatar Key passed as a parameter. Which could remove the implicit permission that the SIT action would grant.

See Also

Functions

•  llGetSunDirection Setting the Direction, then waiting the Delay period, and calling llGetSunDirection should return the vector specified in the original llSetSunPosition.
•  llForceMouselook Suggests that this type of request is reasonable to send to a User Agent/Viewer.
•  llAvatarOnSitTarget Call this to determine what agent would be affected by this call.

Deep Notes

Signature

//function void llSetSunDirection( vector direction, float Delay );