LlForceMouseLook Test

From Second Life Wiki
Jump to navigation Jump to search

[LLForceMouselookTest]

[VERSION] 0.1

[LENGTH] 00:15

[TESTERS] 1

[OVERVIEW] This test has been designed to exercise the llForceMouselook LSL function.

[SETUP] To compare functionality and interoperability, run tests with llSetCameraEyeOffset and llSetCameraAtOffset.

[*]

[Basic Test]

[INV] ForceMouselookTestObject

[0010] With your avatar near the ForceMouselookTestObject, Left-click on it until "TRUE" is displayed above it, and Right-click and select "Sit Here".

[0020] Verify that the avatar will sit on the Object and Mouselook will be forced as the avatar sits.

[*]

[Distance test]

[0030] Right-click on the Ground and Select "Create" From the Pie Menu, Rez 2 Default Cubes.

[0040] Right-click on the first cube, Select "More >>" if necessary and Click the "Contents" Tab

[0050] Click "New Script" and Replace the Default Script with the Following.

[SCRIPT] llForceMouseLookScript

[0060] Click "Save" and close the Script and Edit Windows

[0070] Right-click on the second cube, Select "More >>" if necessary and Click the "Contents" Tab

[0080] Click "New Script" and Replace the Default Script with the Following.

[SCRIPT] llForceMouseLookCamAtScript

[0090] Click "Save" and close the Script and Edit Windows

[0100] Left-click on both cubes until the word "TRUE" Appears above them

[0110] Move your avatar far from the cubes (20 m or so), Right-click on the Objects and select "Sit Here", Repeat that for Both (Clicking "Stand Up" inbetween)

[0120] Verify that the avatar will sit on the object and mouselook will be forced as the avatar sits. Look for the chance that avatar enters mouselook before reaching target.

[0130] "Stand-up" from the Cubes, and Left-click on Both until you See "FALSE" above each cube

[0140] Right-click on the Objects and select "Sit Here" Watch your camera position on each, Repeat that for Both (Clicking "Stand Up" inbetween)

[0150] Verify that sitting on the second object (using the llForceMouseLookCamAtScript) points your camera up heigher than the first object

[0160] Clean up your work area

[*]

[NOTE] The following script will toggle llForceMouseLook between TRUE and FALSE. It will be contained in the ForceMouselookTestObject.

[END]


[llForceMouseLookScript]

integer bool = TRUE;

default
{

    touch_start(integer num)
    {

        llForceMouselook(bool);
        if (bool) llSetText("TRUE",<1,0,0>,1);
        else llSetText("FALSE",<1,0,0>,1);
        llSetCameraEyeOffset(<-2, 0, 1>);
        bool = !bool;

    }

}


[llForceMouseLookCamAtScript]

integer bool = TRUE;

default
{

    touch_start(integer num)
    {

        llForceMouselook(bool);
        if (bool) llSetText("TRUE",<1,0,0>,1);
        else llSetText("FALSE",<1,0,0>,1);
        llSetCameraEyeOffset(<-2, 0, 1>);
        llSetCameraAtOffset(<2, 0, 2>);
        bool = !bool;

    }

}