Difference between revisions of "Physics Test"

From Second Life Wiki
Jump to navigation Jump to search
Line 6: Line 6:


== Consistency test ==
== Consistency test ==
=== Setup ===
* Wear the avatar from Library > Clothing > Boy Next Door. Avatar mass is determined by shape size, so we need to start with a known quantity.
=== avatar ===
=== avatar ===
* walk speed
* walk speed

Revision as of 16:01, 9 May 2011

Purpose

Test measurable aspects of the physics engine and verify they remain consistent.

Consistency test

Setup

  • Wear the avatar from Library > Clothing > Boy Next Door. Avatar mass is determined by shape size, so we need to start with a known quantity.

avatar

  • walk speed
    • Add the following "Report Velocity script" to a box then wear the box.
    • Walk your avatar and verify the velocity is ~3.2
//Report Velocity script
default
{
    state_entry()
    {
        llSetTimerEvent(2.0);
    }
    timer()
    {
        if (llGetAttached())
        {
            llInstantMessage(llGetOwner(), (string)llVecMag(llGetVel()));
        }
    }
}
  • run speed
    • Wear the "Report Velocity script" object from the previous test.
    • Run your avatar around and verify the velocity is ~5.13
  • fly speed
    • Wear the "Report Velocity script" object.
    • Fly your avatar in a straight line horizontal with the terrain and verify the velocity is ~16.0
  • Add the following "Measure jump height script" to a box then wear the box.
    • Jump and verify the reported jump height ~ 3.97m
//Measure jump height script
vector x;
float starting_height;
float highest_height;
float current_height;
integer started;

default
{
    state_entry()
    {
        llRequestPermissions(llGetOwner(), PERMISSION_TAKE_CONTROLS);
        llTakeControls(CONTROL_UP, 1, 1);
    }

    control(key id, integer level, integer edge)
    {
        if (started == 0)
        {
            x = llGetPos();
            starting_height = x.z;
            llSetTimerEvent(0.05);
            llResetTime(); 
            highest_height = 0.0;
            started = 1;
        }
    }
    
    timer()
    {
        x = llGetPos();
        current_height = x.z;
        if (current_height > highest_height)
        {
            highest_height = current_height;
        }
        
        if (llGetTime() > 5.0)
        {
            llSetTimerEvent(0.0);
            started = 0;
            llSay(0, "Jump height was: "+(string)(highest_height - starting_height));
        }
    }
}
  • jump distance
    • Add the following script to a box then wear the box.
    • Jump while walking forwar and verify the reported jump distance ~ 7.6m
//Measure Jump distance script
vector jump_start_position;
default
{
    land_collision_end(vector start_pos)
    {
        jump_start_position = start_pos;
    }
    land_collision_start(vector end_pos)
    {
        llSay(0, "jump distance: "+ (string)llVecDist(jump_start_position,end_pos));
    }
}
  • hang time
  • Mass when wearing avatar from Library > Clothing > Boy Next Door: 1.735026. You can measure mass with a llGetMass attachment from Bug Island/19/41/26
  • friction when walking on steep terrain
  • friction when walking on
  • friction when dropping from the sky onto steep terrain
  • friction when dropping from the sky onto a steep object

vehicle - Kart

  • turning radius
  • turning friction (is it on rails or fishtailing?)(how to measure this?)
  • coast-to-stop distance
  • maximum speed
  • 0-to-maximum speed time
  • mass

energy

  • bounce pad: (object with llPush)
  • energy lost when launching an avatar (or itself)
  • time to recover energy

buoyancy

  • maximum size of an object that can stay buoyant.
  • verify functionality of an object with buoyancy of -1, 0 , and 1.

collisions

  • (soon) collision tolerance should be 0m
  • (soon) there will be a 5cm gap on any non-convex prim that is set physical

Performance

load

  • performance of physics engine under load.
    • physics accuracy is decreased when load passes a limit.
    • physics accuracy is restored when load is reduced to acceptable levels.




legacy test

[PHYSICSTEST]

[VERSION] 0.2

[LENGTH] 00:15

[TESTERS] 1

[OVERVIEW] This test has been designed to the basic functionality of pinned objects (a.k.a. "non-physical" objects), and non-pinned objects (a.k.a. "physical" objects).

[SETUP] Tester must be in an area where building is enabled.

[*]

[Linked Objects]

[0010] Make a complicated linked object with more than three pinned primitives, each piece with a non-trivial rotation, and preferably not all the same shape:

[0010.0010] Unlink and link the collection a few times... the primitives should not change position/rotation between link/unlink cycles.

[NOTE] Notes are also recognized!

[INV] Inventory

[0010.0020] Duplicate the linked object. Did it copy correctly?

[0010.0030] Unpin the linked object and use Grab to throw it around. Does it collide correctly?

[0010.0040] Throw the object across the region boundary. Did it cross correctly?

[*]

[Simple Grab]

[0020] Find a relatively flat location near a region boundary. Create two single-primitive objects, one pinned and one non-pinned.

[0020.0010] Does Grab move each one in the X-Y plane?

[0020.0020] Does CTRL-Grab move each one in the LeftRight??-Z plane?

[0020.0030] Does SHIFT-CTRL-Grab rotate each object?

[0020.0040] Can Grab be used to move each one across the region boundary?

[0020.0050] Can you Grab each object when they are across the boundary from you

[*]

[Colliding Grab]

[0030] Make a floor, add two walls, and create a single-primitive pinned object near the middle of the floor.

[0030.0010] Can you Grab the pinned object and move it about the floor?

[0030.0020] Create a new object on the floor and make it non-pinned.

[0030.0020.0010] Try to Grab the object and move it beyond the wall; expected behavior is that it will lightly bounce against the wall.

[0030.0020.0020] Do collisions generate sounds and particle systems?

[0030.0020.0030] The object should never be able to interpenetrate or tunnel through the wall.

[0030.0020.0040] Use Grab to collide the non-pinned object against the pinned object that was being grabbed earlier. If the Grabbed object rotates, it should rotate very slowly as if it were being slowed down by molasses.

[*]

[Interpenetration Rules]

[0060] Make two pinned objects and two non-pinned.

[0060.0010] Try to use the build-mode move tool to position one pinned object into a state of interpenetration with the other pinned object. The operation should succeed.

[0060.0020] Try to move the same pinned object into a state of interpenetration with one of the non-pinned objects. While moving the pinned object in edit mode, it should interpenetrate, but as soon as you release the mouse, the objects should move away from one another till there is no interpenetration.

[0060.0030] Move the pinned object back into interpenetration with the other pinned object, then try to unpin it. The objects should move away from one another till there is no interpenetration.

[*]

[NOTE] Don't forget to clean up your test area when finished!