Aurora.ScriptEngine.AuroraDotNetEngine.APIs.LSL_Api.SetPointLight C# (CSharp) Метод

SetPointLight() защищенный Метод

Set a light point on a part
protected SetPointLight ( ISceneChildEntity part, bool light, Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.Vector3 color, float intensity, float radius, float falloff ) : void
part ISceneChildEntity
light bool
color Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.Vector3
intensity float
radius float
falloff float
Результат void
        protected void SetPointLight(ISceneChildEntity part, bool light, LSL_Vector color, float intensity, float radius, float falloff)
        {
            if (part == null)
                return;

            bool same = true;
            if (light)
            {
                if (part.Shape.LightEntry != true)
                    same = false;
                part.Shape.LightEntry = true;
                if (part.Shape.LightColorR != Util.Clip((float)color.x, 0.0f, 1.0f))
                    same = false;
                part.Shape.LightColorR = Util.Clip((float)color.x, 0.0f, 1.0f);
                if (part.Shape.LightColorG != Util.Clip((float)color.y, 0.0f, 1.0f))
                    same = false;
                part.Shape.LightColorG = Util.Clip((float)color.y, 0.0f, 1.0f);
                if (part.Shape.LightColorB != Util.Clip((float)color.z, 0.0f, 1.0f))
                    same = false;
                part.Shape.LightColorB = Util.Clip((float)color.z, 0.0f, 1.0f);
                if (part.Shape.LightIntensity != intensity)
                    same = false;
                part.Shape.LightIntensity = intensity;
                if (part.Shape.LightRadius != radius)
                    same = false;
                part.Shape.LightRadius = radius;
                if (part.Shape.LightFalloff != falloff)
                    same = false;
                part.Shape.LightFalloff = falloff;
            }
            else
            {
                if (part.Shape.LightEntry)
                    same = false;
                part.Shape.LightEntry = false;
            }

            if (!same)
            {
                part.ParentEntity.HasGroupChanged = true;
                part.ScheduleUpdate(PrimUpdateFlags.FindBest);
            }
        }
LSL_Api