// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Test the current rotation’s basis invariants // Not compiled or tested in-world // Setup: Use a spare owned test object. Rotate the test object in Edit, then touch. // Stop / restore: Disable/remove. Tests report privately and do not change visual prim properties. Any temporary timer stops at completion or timeout. // Notes: Tolerance is numeric; a passing basis does not prove intended artistic orientation. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Runtime verification, not pre-certified behavior. default { touch_start(integer detectedCount) { if(llDetectedKey(0)!=llGetOwner())return; rotation r=llGetRot(); vector x=<1.0,0.0,0.0>*r; vector y=<0.0,1.0,0.0>*r; vector z=<0.0,0.0,1.0>*r; float lengthError=llFabs(llVecMag(x)-1.0)+llFabs(llVecMag(y)-1.0)+llFabs(llVecMag(z)-1.0); float dotError=llFabs(x*y)+llFabs(x*z)+llFabs(y*z); float handed=(x%y)*z; llOwnerSay("Basis pass="+(string)(lengthError<0.001&&dotError<0.001&&handed>0.999)+" lengthError="+(string)lengthError+" dotError="+(string)dotError+" handedness="+(string)handed); } changed(integer flags) { if(flags&CHANGED_OWNER)llResetScript(); } }