OpenSim.Region.ScriptEngine.Shared.Api.LSL_Api.SetFlexi C# (CSharp) Method

SetFlexi() protected method

Set flexi parameters of a part. FIXME: Much of this code should probably be within the part itself.
protected SetFlexi ( SceneObjectPart part, bool flexi, int softness, float gravity, float friction, float wind, float tension, OpenSim.Region.ScriptEngine.Shared.LSL_Types.Vector3 Force ) : void
part OpenSim.Region.Framework.Scenes.SceneObjectPart
flexi bool
softness int
gravity float
friction float
wind float
tension float
Force OpenSim.Region.ScriptEngine.Shared.LSL_Types.Vector3
return void
        protected void SetFlexi(SceneObjectPart part, bool flexi, int softness, float gravity, float friction,
            float wind, float tension, LSL_Vector Force)
        {
            if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted)
                return;

            if (flexi)
            {
                part.Shape.FlexiEntry = true;   // this setting flexi true isn't working, but the below parameters do
                                                                // work once the prim is already flexi
                part.Shape.FlexiSoftness = softness;
                part.Shape.FlexiGravity = gravity;
                part.Shape.FlexiDrag = friction;
                part.Shape.FlexiWind = wind;
                part.Shape.FlexiTension = tension;
                part.Shape.FlexiForceX = (float)Force.x;
                part.Shape.FlexiForceY = (float)Force.y;
                part.Shape.FlexiForceZ = (float)Force.z;
                part.Shape.PathCurve = (byte)Extrusion.Flexible;
            }
            else
            {
                // Other values not set, they do not seem to be sent to the viewer
                // Setting PathCurve appears to be what actually toggles the check box and turns Flexi on and off
                part.Shape.PathCurve = (byte)Extrusion.Straight;
                part.Shape.FlexiEntry = false;
            }
            part.ParentGroup.HasGroupChanged = true;
            part.ScheduleFullUpdate();
        }
LSL_Api