// Set prim params for a sphere and check results. public void CheckllSetPrimitiveParams(LSL_Api api, string primTest, LSL_Types.Vector3 primSize, int primType, int primHoleType, LSL_Types.Vector3 primCut, float primHollow, LSL_Types.Vector3 primTwist, LSL_Types.Vector3 primDimple, float primHollowCheck) { // Set the prim params. api.llSetPrimitiveParams(new LSL_Types.list(ScriptBaseClass.PRIM_SIZE, primSize, ScriptBaseClass.PRIM_TYPE, primType, primHoleType, primCut, primHollow, primTwist, primDimple)); // Get params for prim to validate settings. LSL_Types.list primParams = api.llGetPrimitiveParams(new LSL_Types.list(ScriptBaseClass.PRIM_SIZE, ScriptBaseClass.PRIM_TYPE)); // Validate settings. CheckllSetPrimitiveParamsVector(primSize, api.llList2Vector(primParams, 0), primTest + " prim size"); Assert.AreEqual(primType, api.llList2Integer(primParams, 1), "TestllSetPrimitiveParams " + primTest + " prim type check fail"); Assert.AreEqual(primHoleType, api.llList2Integer(primParams, 2), "TestllSetPrimitiveParams " + primTest + " prim hole default check fail"); CheckllSetPrimitiveParamsVector(primCut, api.llList2Vector(primParams, 3), primTest + " prim cut"); Assert.AreEqual(primHollowCheck, api.llList2Float(primParams, 4), FLOAT_ACCURACY, "TestllSetPrimitiveParams " + primTest + " prim hollow check fail"); CheckllSetPrimitiveParamsVector(primTwist, api.llList2Vector(primParams, 5), primTest + " prim twist"); CheckllSetPrimitiveParamsVector(primDimple, api.llList2Vector(primParams, 6), primTest + " prim dimple"); }
// Set prim params for a sculpted prim and check results. public void CheckllSetPrimitiveParams(LSL_Api api, string primTest, LSL_Types.Vector3 primSize, int primType, string primMap, int primSculptType) { // Set the prim params. api.llSetPrimitiveParams(new LSL_Types.list(ScriptBaseClass.PRIM_SIZE, primSize, ScriptBaseClass.PRIM_TYPE, primType, primMap, primSculptType)); // Get params for prim to validate settings. LSL_Types.list primParams = api.llGetPrimitiveParams(new LSL_Types.list(ScriptBaseClass.PRIM_SIZE, ScriptBaseClass.PRIM_TYPE)); // Validate settings. CheckllSetPrimitiveParamsVector(primSize, api.llList2Vector(primParams, 0), primTest + " prim size"); Assert.AreEqual(primType, api.llList2Integer(primParams, 1), "TestllSetPrimitiveParams " + primTest + " prim type check fail"); Assert.AreEqual(primMap, (string)api.llList2String(primParams, 2), "TestllSetPrimitiveParams " + primTest + " prim map check fail"); Assert.AreEqual(primSculptType, api.llList2Integer(primParams, 3), "TestllSetPrimitiveParams " + primTest + " prim type scuplt check fail"); }
// Set prim params for a torus, tube or ring and check results. public void CheckllSetPrimitiveParams(LSL_Api api, string primTest, LSL_Types.Vector3 primSize, int primType, int primHoleType, LSL_Types.Vector3 primCut, float primHollow, LSL_Types.Vector3 primTwist, LSL_Types.Vector3 primHoleSize, LSL_Types.Vector3 primShear, LSL_Types.Vector3 primProfCut, LSL_Types.Vector3 primTaper, float primRev, float primRadius, float primSkew, float primHollowCheck) { // Set the prim params. api.llSetPrimitiveParams(new LSL_Types.list(ScriptBaseClass.PRIM_SIZE, primSize, ScriptBaseClass.PRIM_TYPE, primType, primHoleType, primCut, primHollow, primTwist, primHoleSize, primShear, primProfCut, primTaper, primRev, primRadius, primSkew)); // Get params for prim to validate settings. LSL_Types.list primParams = api.llGetPrimitiveParams(new LSL_Types.list(ScriptBaseClass.PRIM_SIZE, ScriptBaseClass.PRIM_TYPE)); // Valdate settings. CheckllSetPrimitiveParamsVector(primSize, api.llList2Vector(primParams, 0), primTest + " prim size"); Assert.AreEqual(primType, api.llList2Integer(primParams, 1), "TestllSetPrimitiveParams " + primTest + " prim type check fail"); Assert.AreEqual(primHoleType, api.llList2Integer(primParams, 2), "TestllSetPrimitiveParams " + primTest + " prim hole default check fail"); CheckllSetPrimitiveParamsVector(primCut, api.llList2Vector(primParams, 3), primTest + " prim cut"); Assert.AreEqual(primHollowCheck, api.llList2Float(primParams, 4), FLOAT_ACCURACY, "TestllSetPrimitiveParams " + primTest + " prim hollow check fail"); CheckllSetPrimitiveParamsVector(primTwist, api.llList2Vector(primParams, 5), primTest + " prim twist"); CheckllSetPrimitiveParamsVector(primHoleSize, api.llList2Vector(primParams, 6), primTest + " prim hole size"); CheckllSetPrimitiveParamsVector(primShear, api.llList2Vector(primParams, 7), primTest + " prim shear"); CheckllSetPrimitiveParamsVector(primProfCut, api.llList2Vector(primParams, 8), primTest + " prim profile cut"); CheckllSetPrimitiveParamsVector(primTaper, api.llList2Vector(primParams, 9), primTest + " prim taper"); Assert.AreEqual(primRev, api.llList2Float(primParams, 10), FLOAT_ACCURACY, "TestllSetPrimitiveParams " + primTest + " prim revolutions fail"); Assert.AreEqual(primRadius, api.llList2Float(primParams, 11), FLOAT_ACCURACY, "TestllSetPrimitiveParams " + primTest + " prim radius fail"); Assert.AreEqual(primSkew, api.llList2Float(primParams, 12), FLOAT_ACCURACY, "TestllSetPrimitiveParams " + primTest + " prim skew fail"); }