OsSetProjectionParams: Difference between revisions
From OpenSimulator
Jump to navigationJump to search
imported>MakoBot m some syntax modification (may be major or minor) |
imported>BlueWall No edit summary |
||
| Line 8: | Line 8: | ||
integer pstate = FALSE; | integer pstate = FALSE; | ||
// These variables | // These variables correspond to the settings found in the | ||
// "Features" tab of the build editor | // "Features" tab of the build editor | ||
float FOV = 1.5; // Values 0.00 - 3.00 | float FOV = 1.5; // Values 0.00 - 3.00 | ||
| Line 15: | Line 15: | ||
key Texture = "b4c6b075-4940-4270-bb10-d293fd6f8091"; | key Texture = "b4c6b075-4940-4270-bb10-d293fd6f8091"; | ||
// UUID of other prim that we | // UUID of other prim that we want to control | ||
key Remote = "9772974a-a0f6-43ec-b1a2-da558b0b0d59"; | key Remote = "9772974a-a0f6-43ec-b1a2-da558b0b0d59"; | ||
Revision as of 19:20, 25 October 2012
void osSetProjectionParams(integer projection, key texture, float fov, float focus, float amb)
void osSetProjectionParams(key prim, integer projection, key texture, float fov, float focus, float amb) | |
2 Variations possible.
| |
| Threat Level | High |
| Permissions | No permissions specified |
| Extra Delay | No function delay specified |
| Example(s) | |
This example will control the projection map in the host prim 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 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);
// Control the remote prim...
osSetProjectionParams(Remote, pstate, Texture, FOV, Focus, Ambiance);
}
}
| |