Mass Lab

From Second Life Wiki
Jump to navigation Jump to search

<lsl>// A simple study of how mass is effected by prim shape/types. The X,Y,Z size is not changed but the mass does.

// Material type and/or physics seem to not effect mass.

default {

   state_entry()
   {
       llSetScale(<1.0, 1.0, 1.0>); // 1 meter cubed
       
       llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_BOX,
       PRIM_HOLE_DEFAULT, <0.0, 1.0, 0.0>, 0.0, <0.0, 0.0, 0.0>, <1.0, 1.0, 0.0>, <0.0, 0.0, 0.0>]);
       
       llOwnerSay("BOX: " + (string)llGetMass()); // Output: Object: 10.000000
       
       llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_CYLINDER,
       PRIM_HOLE_DEFAULT, <0.0, 1.0, 0.0>, 0.0, <0.0, 0.0, 0.0>, <1.0, 1.0, 0.0>, <0.0, 0.0, 0.0>]);
       
       llOwnerSay("CYLINDER: " + (string)llGetMass()); // Output: Object: 10.000000
       
       llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_PRISM,
       PRIM_HOLE_DEFAULT, <0.0, 1.0, 0.0>, 0.0, <0.0, 0.0, 0.0>, <1.0, 1.0, 0.0>, <0.0, 0.0, 0.0>]);
       
       llOwnerSay("PRISM: " + (string)llGetMass()); // Output: Object: 10.000000
       
       llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_SPHERE,
       PRIM_HOLE_DEFAULT, <0.0, 1.0, 0.0>, 0.0, <0.0, 0.0, 0.0>, <0.0, 1.0, 0.0>]);
       
       llOwnerSay("SPHERE: " + (string)llGetMass()); // Output: Object: 5.235988
       
       llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_TORUS,
       PRIM_HOLE_DEFAULT, <0.0, 1.0, 0.0>, 0.0, <0.0, 0.0, 0.0>, <1.0, 0.5, 0.0>, <0.0, 0.0, 0.0>, <0.0, 1.0, 0.0>, <0.0, 0.0, 0.0>, 1.0, 0.0, 0.0]);
       
       llOwnerSay("TORUS: " + (string)llGetMass()); // Output: Object: 5.235988
       
       llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_TUBE,
       PRIM_HOLE_DEFAULT, <0.0, 1.0, 0.0>, 0.0, <0.0, 0.0, 0.0>, <1.0, 0.5, 0.0>, <0.0, 0.0, 0.0>, <0.0, 1.0, 0.0>, <0.0, 0.0, 0.0>, 1.0, 0.0, 0.0]);
       
       llOwnerSay("TUBE: " + (string)llGetMass()); // Output: Object: 5.235988
       
       llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_RING,
       PRIM_HOLE_DEFAULT, <0.0, 1.0, 0.0>, 0.0, <0.0, 0.0, 0.0>, <1.0, 0.5, 0.0>, <0.0, 0.0, 0.0>, <0.0, 1.0, 0.0>, <0.0, 0.0, 0.0>, 1.0, 0.0, 0.0]);
       
       llOwnerSay("RING: " + (string)llGetMass()); // Output: Object: 5.235988
       
       llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_SCULPT, "bea82b0f-27c6-730b-fd7f-733f2340b449", PRIM_SCULPT_TYPE_SPHERE] );
       
       llOwnerSay("SCULPTED APPLE: " + (string)llGetMass()); // Output: Object: 5.229262
       
       llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_SCULPT, "d1b6cc53-ac61-291f-9ce1-dc18170aa6a6", PRIM_SCULPT_TYPE_SPHERE] );
       
       llOwnerSay("SCULPTED APPLE STEM: " + (string)llGetMass()); // Output: Object: 5.229262
       
       llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_SCULPT, "d962089b-2197-993c-9ec9-4993eb0a95f2", PRIM_SCULPT_TYPE_SPHERE] );
       
       llOwnerSay("SCULPTED BANANA: " + (string)llGetMass()); // Output: Object: 5.229262
       
       llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_SCULPT, "fb39e9be-0609-2d1e-0988-803d1c04411e", PRIM_SCULPT_TYPE_SPHERE] );
       
       llOwnerSay("SCULPTED PLATE: " + (string)llGetMass()); // Output: Object: 5.229262
       
       llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_SCULPT, "", PRIM_SCULPT_TYPE_PLANE] );
       
       llOwnerSay("SCULPT (no map): " + (string)llGetMass()); // Output: Object: 5.229262
       
       llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_SCULPT, "", PRIM_SCULPT_TYPE_CYLINDER] );
       
       llOwnerSay("SCULPT (no map): " + (string)llGetMass()); // Output: Object: 5.229262
       
       llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_SCULPT, "", PRIM_SCULPT_TYPE_TORUS] );
       
       llOwnerSay("SCULPT (no map): " + (string)llGetMass()); // Output: Object: 5.229262
       
       llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_SCULPT, "", PRIM_SCULPT_TYPE_MASK] );
       
       llOwnerSay("SCULPT (no map): " + (string)llGetMass()); // Output: Object: 5.229262
   }

}</lsl>