protected void SetFlexi(ISceneChildEntity part, bool flexi, int softness, float gravity, float friction,
float wind, float tension, LSL_Vector Force)
{
if (part == null)
return;
if (flexi)
{
part.Shape.PathCurve |= (byte)Extrusion.Flexible;
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 = 0x80;
}
else
{
int curve = part.Shape.PathCurve;
curve &= (int)(~(Extrusion.Flexible));
part.Shape.PathCurve = (byte)curve;
part.Shape.FlexiEntry = false;
}
part.ParentEntity.HasGroupChanged = true;
part.ScheduleUpdate(PrimUpdateFlags.FullUpdate);
}