OsSetProjectionParams

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
Line 7: Line 7:
 
void osSetProjectionParams(integer linknumber, integer projection, key texture, float fov, float focus, float amb)<br />
 
void osSetProjectionParams(integer linknumber, integer projection, key texture, float fov, float focus, float amb)<br />
 
void osSetProjectionParams(key prim, integer projection, key texture, float fov, float focus, float amb)
 
void osSetProjectionParams(key prim, integer projection, key texture, float fov, float focus, float amb)
|ossl_example=This example will control the projection map in the host prim, a prim on the linkset or another prim identified by it's uuid.  
+
|ossl_example=This example will control the projection map in the host prim, a prim on the linkset and another prim identified by it's uuid.  
 
<source lang="lsl">
 
<source lang="lsl">
 
integer pstate = FALSE;
 
integer pstate = FALSE;
Line 33: Line 33:
 
         // This one controls this prim...
 
         // This one controls this prim...
 
         osSetProjectionParams(pstate, Texture, FOV, Focus, Ambiance);
 
         osSetProjectionParams(pstate, Texture, FOV, Focus, Ambiance);
 +
        // This one controls the prim with link number 3
 +
        osSetProjectionParams(3, pstate, Texture, FOV, Focus, Ambiance);
 
         // This one controls the remote prim...
 
         // This one controls the remote prim...
 
         osSetProjectionParams(Remote, pstate, Texture, FOV, Focus, Ambiance);
 
         osSetProjectionParams(Remote, pstate, Texture, FOV, Focus, Ambiance);
 +
 
          
 
          
 
     }
 
     }
Line 52: Line 55:
 
         // Control this prim...
 
         // Control this prim...
 
         osSetProjectionParams(pstate, Texture, FOV, Focus, Ambiance);
 
         osSetProjectionParams(pstate, Texture, FOV, Focus, Ambiance);
 +
        // This one controls the prim with link number 3
 +
        osSetProjectionParams(3, pstate, Texture, FOV, Focus, Ambiance);
 
         // Control the remote prim...
 
         // Control the remote prim...
 
         osSetProjectionParams(Remote, pstate, Texture, FOV, Focus, Ambiance);
 
         osSetProjectionParams(Remote, pstate, Texture, FOV, Focus, Ambiance);

Revision as of 07:52, 18 April 2019

void osSetProjectionParams(integer projection, key texture, float fov, float focus, float amb)

void osSetProjectionParams(integer linknumber, integer projection, key texture, float fov, float focus, float amb)
void osSetProjectionParams(key prim, integer projection, key texture, float fov, float focus, float amb)

Sets a prim projector parameters, argument projection is TRUE(1) or FALSE(0). The prim can be the host prim on first variant, a prim on the linkset or a prim with giving UUID. In last case Threat level is high and controlled by Allow_osSetProjectionParams. In the other cases has no threat level check. Note that you may need to set the prim light also.
Threat Level No threat level specified
Permissions No permissions specified
Delay 0 seconds
Example(s)
This example will control the projection map in the host prim, a prim on the linkset and another prim identified by it's uuid.
integer pstate = FALSE;
 
// These variables correspond to the settings found in the
// "Features" tab of the build editor
float FOV = 1.5; // Values 0.00 - 3.00
float Focus = 15.0; // Values -20.00 - 20.00
float Ambiance = 0.4; // Values 0.00 - 1.00
key Texture = "b4c6b075-4940-4270-bb10-d293fd6f8091";
 
// UUID of other prim that we want to control
key Remote = "9772974a-a0f6-43ec-b1a2-da558b0b0d59";
 
default
{
    state_entry()
    {
        llSay(0, "Script running");
        llSetText((string)llGetKey(),<0.3,0.5,0.75>,1.0);
        llSetPrimitiveParams([]);
 
        // Light must be enabled in "Features"
 
        // This one controls this prim...
        osSetProjectionParams(pstate, Texture, FOV, Focus, Ambiance);
        // This one controls the prim with link number 3
        osSetProjectionParams(3, pstate, Texture, FOV, Focus, Ambiance);
        // This one controls the remote prim...
        osSetProjectionParams(Remote, pstate, Texture, FOV, Focus, Ambiance);
 
 
    }
 
    touch_start(integer _det) 
    {
 
        if (pstate == TRUE) 
        {
            pstate = FALSE;
        }
        else
        {
            pstate = TRUE;
        }
 
        // Control this prim...
        osSetProjectionParams(pstate, Texture, FOV, Focus, Ambiance);
        // This one controls the prim with link number 3
        osSetProjectionParams(3, pstate, Texture, FOV, Focus, Ambiance);
        // Control the remote prim...
        osSetProjectionParams(Remote, pstate, Texture, FOV, Focus, Ambiance);
    }
}
Notes
This function was added in 0.7.2-post-fixes, linkset variant added 2019, April 18


Personal tools
General
About This Wiki