예제 #1
0
        public void aaSayDistance(int channelID, LSL_Float Distance, string text)
        {
            ScriptProtection.CheckThreatLevel(ThreatLevel.VeryLow, "AASayDistance", m_host, "AA");

            if (text.Length > 1023)
            {
                text = text.Substring(0, 1023);
            }

            IChatModule chatModule = World.RequestModuleInterface <IChatModule>();

            if (chatModule != null)
            {
                chatModule.SimChat(text, ChatTypeEnum.Custom, channelID,
                                   m_host.ParentEntity.RootChild.AbsolutePosition, m_host.Name,
                                   m_host.UUID, false, false, (float)Distance.value, UUID.Zero, World);
            }

            IWorldComm wComm = World.RequestModuleInterface <IWorldComm>();

            if (wComm != null)
            {
                wComm.DeliverMessage(ChatTypeEnum.Custom, channelID, m_host.Name, m_host.UUID, text, (float)Distance.value);
            }
        }
예제 #2
0
 public void aaSetConeOfSilence(LSL_Float radius)
 {
     ScriptProtection.CheckThreatLevel(ThreatLevel.Low, "AASetConeOfSilence", m_host, "AA");
     if (World.Permissions.IsAdministrator(m_host.OwnerID))
     {
         m_host.SetConeOfSilence(radius.value);
     }
 }
예제 #3
0
 public void aaSetConeOfSilence(LSL_Float radius)
 {
     if (!ScriptProtection.CheckThreatLevel(ThreatLevel.Low, "AASetConeOfSilence", m_host, "AA", m_itemID))
     {
         return;
     }
     if (World.Permissions.IsGod(m_host.OwnerID))
     {
         m_host.SetConeOfSilence(radius.value);
     }
 }
예제 #4
0
 public void aaSetCloudDensity(LSL_Float density)
 {
     if (!ScriptProtection.CheckThreatLevel(ThreatLevel.Moderate, "AASetCloudDensity", m_host, "AA", m_itemID))
         return;
     if (!World.Permissions.CanIssueEstateCommand(m_host.OwnerID, false))
         return;
     ICloudModule CloudModule = World.RequestModuleInterface<ICloudModule>();
     if (CloudModule == null)
         return;
     CloudModule.SetCloudDensity((float) density);
 }
예제 #5
0
        public void botSetSpeed(LSL_Key bot, LSL_Float SpeedModifier)
        {
            if (!ScriptProtection.CheckThreatLevel(ThreatLevel.Moderate, "botSetSpeed", m_host, "OSSL", m_itemID))
            {
                return;
            }

            IBotManager manager = World.RequestModuleInterface <IBotManager>();

            if (manager != null)
            {
                manager.SetSpeed(UUID.Parse(bot), m_host.OwnerID, (float)SpeedModifier);
            }
        }
예제 #6
0
        public void botFollowAvatar(string bot, string avatarName, LSL_Float startFollowDistance,
                                    LSL_Float endFollowDistance)
        {
            if (!ScriptProtection.CheckThreatLevel(ThreatLevel.Moderate, "botFollowAvatar", m_host, "bot", m_itemID))
            {
                return;
            }
            IBotManager manager = World.RequestModuleInterface <IBotManager>();

            if (manager != null)
            {
                manager.FollowAvatar(UUID.Parse(bot), avatarName, (float)startFollowDistance, (float)endFollowDistance, false, Vector3.Zero,
                                     m_host.OwnerID);
            }
        }
예제 #7
0
        public void aaSetCloudDensity(LSL_Float density)
        {
            ScriptProtection.CheckThreatLevel(ThreatLevel.Moderate, "AASetCloudDensity", m_host, "AA");
            if (!World.Permissions.CanIssueEstateCommand(m_host.OwnerID, false))
            {
                return;
            }
            ICloudModule CloudModule = World.RequestModuleInterface <ICloudModule>();

            if (CloudModule == null)
            {
                return;
            }
            CloudModule.SetCloudDensity((float)density);
        }
예제 #8
0
 public void osReturnObjects(LSL_Float parameter)
 {
     m_OSSL_Functions.osReturnObjects(parameter);
 }
예제 #9
0
        public void osReturnObjects(LSL_Float Parameter)
        {
            ScriptProtection.CheckThreatLevel(ThreatLevel.Low, "osShutDown", m_host, "OSSL");

            Dictionary<UUID, List<SceneObjectGroup>> returns =
                    new Dictionary<UUID, List<SceneObjectGroup>>();
            ILandObject LO = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y);
                
            if (Parameter == 0) // Owner objects
            {
                foreach (SceneObjectGroup obj in LO.PrimsOverMe)
                {
                    if (obj.OwnerID == LO.LandData.OwnerID)
                    {
                        if (!returns.ContainsKey(obj.OwnerID))
                            returns[obj.OwnerID] =
                                    new List<SceneObjectGroup>();
                        returns[obj.OwnerID].Add(obj);
                    }
                }
            }
            if (Parameter == 1) //Everyone elses
            {
                foreach (SceneObjectGroup obj in LO.PrimsOverMe)
                {
                    if (obj.OwnerID != LO.LandData.OwnerID &&
                        (obj.GroupID != LO.LandData.GroupID ||
                        LO.LandData.GroupID == UUID.Zero))
                    {
                        if (!returns.ContainsKey(obj.OwnerID))
                            returns[obj.OwnerID] =
                                    new List<SceneObjectGroup>();
                        returns[obj.OwnerID].Add(obj);
                    }
                }
            }
            if (Parameter == 2) // Group
            {
                foreach (SceneObjectGroup obj in LO.PrimsOverMe)
                {
                    if (obj.GroupID == LO.LandData.GroupID)
                    {
                        if (!returns.ContainsKey(obj.OwnerID))
                            returns[obj.OwnerID] =
                                    new List<SceneObjectGroup>();
                        returns[obj.OwnerID].Add(obj);
                    }
                }
            }

            foreach (List<SceneObjectGroup> ol in returns.Values)
            {
                if (World.Permissions.CanReturnObjects(LO, m_host.OwnerID, ol))
                    World.returnObjects(ol.ToArray(), m_host.OwnerID);
            }
        }
예제 #10
0
        public void aaSayDistance(int channelID, LSL_Float Distance, string text)
        {
            if (!ScriptProtection.CheckThreatLevel(ThreatLevel.VeryLow, "AASayDistance", m_host, "AA", m_itemID))
                return;

            if (text.Length > 1023)
                text = text.Substring(0, 1023);

            IChatModule chatModule = World.RequestModuleInterface<IChatModule>();
            if (chatModule != null)
                chatModule.SimChat(text, ChatTypeEnum.Custom, channelID,
                                   m_host.ParentEntity.RootChild.AbsolutePosition, m_host.Name,
                                   m_host.UUID, false, false, (float) Distance.value, UUID.Zero, World);

            IWorldComm wComm = World.RequestModuleInterface<IWorldComm>();
            if (wComm != null)
                wComm.DeliverMessage(ChatTypeEnum.Custom, channelID, m_host.Name, m_host.UUID, text,
                                     (float) Distance.value);
        }
예제 #11
0
        //CFK 9/28: Most, but not all of the underlying plumbing between here and the physics modules is in
        //CFK 9/28: so these are not complete yet.
        public void llSetVehicleFloatParam(int param, LSL_Float value)
        {
            ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL");
            

            if (m_host.ParentGroup != null)
            {
                if (!m_host.ParentGroup.IsDeleted)
                {
                    m_host.ParentGroup.RootPart.SetVehicleFloatParam(param, (float)value);
                }
            }
        }
예제 #12
0
 public void botFollowAvatar (string bot, string avatarName, LSL_Float startFollowDistance, LSL_Float endFollowDistance)
 {
     ScriptProtection.CheckThreatLevel (ThreatLevel.Moderate, "botFollowAvatar", m_host, "bot");
     IBotManager manager = World.RequestModuleInterface<IBotManager> ();
     if (manager != null)
         manager.FollowAvatar (UUID.Parse (bot), avatarName, (float)startFollowDistance, (float)endFollowDistance);
 }
예제 #13
0
        public LSL_Float osGetHealth(string avatar)
        {
            if (!ScriptProtection.CheckThreatLevel(ThreatLevel.High, "osGetHealth", m_host, "OSSL", m_itemID))
                return new LSL_Float();

            UUID avatarId = new UUID(avatar);

            LSL_Float health = new LSL_Float(-1);
            IScenePresence presence = World.GetScenePresence(avatarId);
            Vector3 pos = m_host.GetWorldPosition();

            IParcelManagementModule parcelManagement = World.RequestModuleInterface<IParcelManagementModule>();
            if (parcelManagement != null)
            {
                LandData land = parcelManagement.GetLandObject(pos.X, pos.Y).LandData;
                if ((land.Flags & (uint) ParcelFlags.AllowDamage) == (uint) ParcelFlags.AllowDamage)
                {
                    ICombatPresence cp = presence.RequestModuleInterface<ICombatPresence>();
                    health = cp.Health;
                }
            }
            return health;
        }
예제 #14
0
        public void osSetSpeed(LSL_Key UUID, LSL_Float SpeedModifier)
        {
            if (!ScriptProtection.CheckThreatLevel(ThreatLevel.Moderate, "osSetSpeed", m_host, "OSSL", m_itemID))
                return;

            IScenePresence avatar = World.GetScenePresence(UUID);
            if (avatar != null)
            {
                if (avatar.UUID != m_host.OwnerID)
                {
                    //We need to make sure that they can do this then
                    if (!World.Permissions.IsGod(m_host.OwnerID))
                        return;
                }
                avatar.SpeedModifier = (float) SpeedModifier;
            }
        }
예제 #15
0
 public void llFleeFrom(LSL_Vector source, LSL_Float distance, LSL_List options)
 {
     NotImplemented("llFleeFrom");
 }
예제 #16
0
 public void aaSetEnv(LSL_String name, LSL_List value)
 {
     if (name == ScriptBaseClass.ENABLE_GRAVITY)
     {
         LSL_Integer enabled = value.GetLSLIntegerItem(0);
         float[]     grav    = m_host.ParentEntity.Scene.PhysicsScene.GetGravityForce();
         m_host.ParentEntity.Scene.PhysicsScene.SetGravityForce(enabled == 1, grav[0], grav[1], grav[2]);
     }
     else if (name == ScriptBaseClass.GRAVITY_FORCE_X)
     {
         LSL_Float f    = value.GetLSLFloatItem(0);
         float[]   grav = m_host.ParentEntity.Scene.PhysicsScene.GetGravityForce();
         m_host.ParentEntity.Scene.PhysicsScene.SetGravityForce(true, (float)f.value, grav[1], grav[2]);
     }
     else if (name == ScriptBaseClass.GRAVITY_FORCE_Y)
     {
         LSL_Float f    = value.GetLSLFloatItem(0);
         float[]   grav = m_host.ParentEntity.Scene.PhysicsScene.GetGravityForce();
         m_host.ParentEntity.Scene.PhysicsScene.SetGravityForce(true, grav[0], (float)f.value, grav[2]);
     }
     else if (name == ScriptBaseClass.GRAVITY_FORCE_Z)
     {
         LSL_Float f    = value.GetLSLFloatItem(0);
         float[]   grav = m_host.ParentEntity.Scene.PhysicsScene.GetGravityForce();
         m_host.ParentEntity.Scene.PhysicsScene.SetGravityForce(true, grav[0], grav[1], (float)f.value);
     }
     else if (name == ScriptBaseClass.ADD_GRAVITY_POINT)
     {
         LSL_Vector  pos       = value.GetVector3Item(0);
         LSL_Float   gravForce = value.GetLSLFloatItem(1);
         LSL_Float   radius    = value.GetLSLFloatItem(2);
         LSL_Integer ident     = value.GetLSLIntegerItem(3);
         float[]     grav      = m_host.ParentEntity.Scene.PhysicsScene.GetGravityForce();
         m_host.ParentEntity.Scene.PhysicsScene.AddGravityPoint(false,
                                                                new Vector3((float)pos.x, (float)pos.y,
                                                                            (float)pos.z),
                                                                0, 0, 0, (float)gravForce.value,
                                                                (float)radius.value, ident.value);
     }
     else if (name == ScriptBaseClass.ADD_GRAVITY_FORCE)
     {
         LSL_Vector  pos    = value.GetVector3Item(0);
         LSL_Float   xForce = value.GetLSLFloatItem(1);
         LSL_Float   yForce = value.GetLSLFloatItem(2);
         LSL_Float   zForce = value.GetLSLFloatItem(3);
         LSL_Float   radius = value.GetLSLFloatItem(4);
         LSL_Integer ident  = value.GetLSLIntegerItem(5);
         float[]     grav   = m_host.ParentEntity.Scene.PhysicsScene.GetGravityForce();
         m_host.ParentEntity.Scene.PhysicsScene.AddGravityPoint(true,
                                                                new Vector3((float)pos.x, (float)pos.y,
                                                                            (float)pos.z),
                                                                (float)xForce, (float)yForce, (float)zForce, 0,
                                                                (float)radius.value, ident.value);
     }
     else if (name == ScriptBaseClass.START_TIME_REVERSAL_SAVING)
     {
         IPhysicsStateModule physicsState = World.RequestModuleInterface <IPhysicsStateModule>();
         if (physicsState != null)
         {
             physicsState.StartSavingPhysicsTimeReversalStates();
         }
     }
     else if (name == ScriptBaseClass.STOP_TIME_REVERSAL_SAVING)
     {
         IPhysicsStateModule physicsState = World.RequestModuleInterface <IPhysicsStateModule>();
         if (physicsState != null)
         {
             physicsState.StopSavingPhysicsTimeReversalStates();
         }
     }
     else if (name == ScriptBaseClass.START_TIME_REVERSAL)
     {
         IPhysicsStateModule physicsState = World.RequestModuleInterface <IPhysicsStateModule>();
         if (physicsState != null)
         {
             physicsState.StartPhysicsTimeReversal();
         }
     }
     else if (name == ScriptBaseClass.STOP_TIME_REVERSAL)
     {
         IPhysicsStateModule physicsState = World.RequestModuleInterface <IPhysicsStateModule>();
         if (physicsState != null)
         {
             physicsState.StopPhysicsTimeReversal();
         }
     }
 }
예제 #17
0
        public void botSetSpeed(LSL_Key bot, LSL_Float SpeedModifier)
        {
            if (!ScriptProtection.CheckThreatLevel(ThreatLevel.Moderate, "botSetSpeed", m_host, "OSSL", m_itemID))
                return;

            IBotManager manager = World.RequestModuleInterface<IBotManager>();
            if (manager != null)
                manager.SetSpeed(UUID.Parse(bot), m_host.OwnerID, (float)SpeedModifier);
        }
예제 #18
0
        public LSL_Integer aaWindlightAddDayCycleFrame(LSL_Float dayCyclePosition, int dayCycleFrameToCopy)
        {
            IGenericsConnector gc = DataManager.DataManager.RequestPlugin<IGenericsConnector>();
            OSDWrapper d = gc.GetGeneric<OSDWrapper>(World.RegionInfo.RegionID, "EnvironmentSettings", "");
            if (d != null)
            {
                WindlightDayCycle cycle = new WindlightDayCycle();
                cycle.FromOSD(d.Info);

                if (cycle.Cycle.IsStaticDayCycle || dayCycleFrameToCopy >= cycle.Cycle.DataSettings.Count)
                    return LSL_Integer.FALSE;

                var data = cycle.Cycle.DataSettings.Keys.ToList();
                cycle.Cycle.DataSettings.Add(dayCyclePosition.ToString(), cycle.Cycle.DataSettings[data[dayCycleFrameToCopy]]);
                gc.AddGeneric(World.RegionInfo.RegionID, "EnvironmentSettings", "", new OSDWrapper { Info = cycle.ToOSD() }.ToOSD());
                return LSL_Integer.TRUE;
            }
            return LSL_Integer.FALSE;
        }
예제 #19
0
 public void botFollowAvatar(string bot, string avatarName, LSL_Float startFollowDistance,
                             LSL_Float endFollowDistance)
 {
     if (!ScriptProtection.CheckThreatLevel(ThreatLevel.Moderate, "botFollowAvatar", m_host, "bot", m_itemID))
         return;
     IBotManager manager = World.RequestModuleInterface<IBotManager>();
     if (manager != null)
         manager.FollowAvatar(UUID.Parse(bot), avatarName, (float) startFollowDistance, (float) endFollowDistance,
                              false, Vector3.Zero,
                              m_host.OwnerID);
 }
예제 #20
0
 public void llSetVehicleFloatParam(int param, LSL_Float value)
 {
     m_LSL_Functions.llSetVehicleFloatParam(param, value);
 }
예제 #21
0
 public void llWanderWithin(LSL_Vector origin, LSL_Float distance, LSL_List options)
 {
     NotImplemented("llWanderWithin");
 }
예제 #22
0
        public void osReturnObjects(LSL_Float Parameter)
        {
            if (!ScriptProtection.CheckThreatLevel(ThreatLevel.Low, "osReturnObjects", m_host, "OSSL", m_itemID))
                return;

            Dictionary<UUID, List<ISceneEntity>> returns =
                new Dictionary<UUID, List<ISceneEntity>>();
            IParcelManagementModule parcelManagement = World.RequestModuleInterface<IParcelManagementModule>();
            if (parcelManagement != null)
            {
                ILandObject LO = parcelManagement.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y);
                IPrimCountModule primCountModule = World.RequestModuleInterface<IPrimCountModule>();
                IPrimCounts primCounts = primCountModule.GetPrimCounts(LO.LandData.GlobalID);
                if (Parameter == 0) // Owner objects
                {
                    foreach (ISceneEntity obj in primCounts.Objects.Where(obj => obj.OwnerID == LO.LandData.OwnerID))
                    {
                        if (!returns.ContainsKey(obj.OwnerID))
                            returns[obj.OwnerID] =
                                new List<ISceneEntity>();

                        returns[obj.OwnerID].Add(obj);
                    }
                }
                if (Parameter == 1) //Everyone elses
                {
                    foreach (ISceneEntity obj in primCounts.Objects.Where(obj => obj.OwnerID != LO.LandData.OwnerID &&
                                                                                 (obj.GroupID != LO.LandData.GroupID ||
                                                                                  LO.LandData.GroupID == UUID.Zero)))
                    {
                        if (!returns.ContainsKey(obj.OwnerID))
                            returns[obj.OwnerID] =
                                new List<ISceneEntity>();

                        returns[obj.OwnerID].Add(obj);
                    }
                }
                if (Parameter == 2) // Group
                {
                    foreach (ISceneEntity obj in primCounts.Objects.Where(obj => obj.GroupID == LO.LandData.GroupID))
                    {
                        if (!returns.ContainsKey(obj.OwnerID))
                            returns[obj.OwnerID] =
                                new List<ISceneEntity>();

                        returns[obj.OwnerID].Add(obj);
                    }
                }

                foreach (List<ISceneEntity> ol in returns.Values)
                {
                    if (World.Permissions.CanReturnObjects(LO, m_host.OwnerID, ol))
                    {
                        ILLClientInventory inventoryModule = World.RequestModuleInterface<ILLClientInventory>();
                        if (inventoryModule != null)
                            inventoryModule.ReturnObjects(ol.ToArray(), m_host.OwnerID);
                    }
                }
            }
        }
예제 #23
0
        /* The new / changed functions were tested with the following LSL script:

        default
        {
            state_entry()
            {
                rotation rot = llEuler2Rot(<0,70,0> * DEG_TO_RAD);

                llOwnerSay("to get here, we rotate over: "+ (string) llRot2Axis(rot));
                llOwnerSay("and we rotate for: "+ (llRot2Angle(rot) * RAD_TO_DEG));

                // convert back and forth between quaternion <-> vector and angle

                rotation newrot = llAxisAngle2Rot(llRot2Axis(rot),llRot2Angle(rot));

                llOwnerSay("Old rotation was: "+(string) rot);
                llOwnerSay("re-converted rotation is: "+(string) newrot);

                llSetRot(rot);  // to check the parameters in the prim
            }
        }
        */

        // Xantor 29/apr/2008
        // Returns rotation described by rotating angle radians about axis.
        // q = cos(a/2) + i (x * sin(a/2)) + j (y * sin(a/2)) + k (z * sin(a/2))
        public LSL_Rotation llAxisAngle2Rot(LSL_Vector axis, LSL_Float angle)
        {
            if (!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID))
                return new LSL_Rotation();


            double s = Math.Cos(angle*0.5);
            double t = Math.Sin(angle*0.5);
            double x = axis.x*t;
            double y = axis.y*t;
            double z = axis.z*t;

            return new LSL_Rotation(x, y, z, s);
        }
예제 #24
0
        public void osSetWindParam(string plugin, string param, LSL_Float value)
        {
            if (!ScriptProtection.CheckThreatLevel(ThreatLevel.VeryLow, "osSetWindParam", m_host, "OSSL", m_itemID))
                return;

            IWindModule module = World.RequestModuleInterface<IWindModule>();
            if (module != null)
            {
                try
                {
                    module.WindParamSet(plugin, param, (float) value.value);
                }
                catch (Exception)
                {
                }
            }
        }
예제 #25
0
 public void AASetCloudDensity(LSL_Float density)
 {
     m_AA_Functions.AASetCloudDensity(density);
 }
예제 #26
0
파일: AA_API.cs 프로젝트: shangcheng/Aurora
 public void AASetConeOfSilence(LSL_Float radius)
 {
     ScriptProtection.CheckThreatLevel(ThreatLevel.Low, "AASetConeOfSilence", m_host, "AA");
     if(World.Permissions.IsAdministrator(m_host.OwnerID))
         m_host.SetConeOfSilence(radius.value);
 }
예제 #27
0
        public LSL_Integer aaWindlightAddDayCycleFrame(LSL_Float dayCyclePosition, int dayCycleFrameToCopy)
        {
            IEnvironmentSettingsModule environmentSettings = World.RequestModuleInterface<IEnvironmentSettingsModule>();
            if (environmentSettings == null)
                return LSL_Integer.FALSE;
            WindlightDayCycle cycle = environmentSettings.GetCurrentDayCycle();
            if (cycle == null)
                return LSL_Integer.FALSE;

            if (cycle.Cycle.IsStaticDayCycle || dayCycleFrameToCopy >= cycle.Cycle.DataSettings.Count)
                return LSL_Integer.FALSE;

            var data = cycle.Cycle.DataSettings.Keys.ToList();
            cycle.Cycle.DataSettings.Add(dayCyclePosition.ToString(),
                                         cycle.Cycle.DataSettings[data[dayCycleFrameToCopy]]);
            environmentSettings.SetDayCycle(cycle);
            return LSL_Integer.TRUE;
        }
예제 #28
0
 public void llSetText(string text, LSL_Vector color, LSL_Float alpha)
 {
     ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL");
     
     Vector3 av3 = new Vector3(Util.Clip((float)color.x, 0.0f, 1.0f),
                               Util.Clip((float)color.y, 0.0f, 1.0f),
                               Util.Clip((float)color.z, 0.0f, 1.0f));
     m_host.SetText(text, av3, Util.Clip((float)alpha, 0.0f, 1.0f));
     //m_host.ParentGroup.HasGroupChanged = true;
     //m_host.ParentGroup.ScheduleGroupForFullUpdate();
 }
예제 #29
0
        public void llTargetOmega (LSL_Vector axis, LSL_Float spinrate, LSL_Float gain)
        {
            if(!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID)) return;

            m_host.OmegaAxis = new Vector3 ((float)axis.x, (float)axis.y, (float)axis.z);
            m_host.OmegaGain = gain;
            m_host.OmegaSpinRate = spinrate;

            m_host.GenerateRotationalVelocityFromOmega ();
            ScriptData script = ScriptProtection.GetScript(this.m_itemID);
            if (script != null)
                script.TargetOmegaWasSet = true;
            m_host.ScheduleTerseUpdate();
            //m_host.SendTerseUpdateToAllClients();
        }
예제 #30
0
 public void aaSetConeOfSilence(LSL_Float radius)
 {
     if (!ScriptProtection.CheckThreatLevel(ThreatLevel.Low, "AASetConeOfSilence", m_host, "AA", m_itemID))
         return;
     if (World.Permissions.IsGod(m_host.OwnerID))
         m_host.SetConeOfSilence(radius.value);
 }
예제 #31
0
        //CFK 9/28: Most, but not all of the underlying plumbing between here and the physics modules is in
        //CFK 9/28: so these are not complete yet.
        public void llSetVehicleFloatParam(int param, LSL_Float value)
        {
            if(!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID)) return;


            if (m_host.ParentEntity != null)
            {
                if (!m_host.ParentEntity.IsDeleted)
                {
                    m_host.ParentEntity.RootChild.SetVehicleFloatParam (param, (float)value);
                }
            }
        }
예제 #32
0
        public void llSetPhysicsMaterial(LSL_Integer bits, LSL_Float density, LSL_Float friction, LSL_Float restitution,
                                         LSL_Float gravityMultiplier)
        {
            ObjectFlagUpdatePacket.ExtraPhysicsBlock[] blocks = new ObjectFlagUpdatePacket.ExtraPhysicsBlock[1];
            blocks[0] = new ObjectFlagUpdatePacket.ExtraPhysicsBlock();
            if ((bits & ScriptBaseClass.DENSITY) == ScriptBaseClass.DENSITY)
                m_host.Density = (float) density;
            else
                blocks[0].Density = m_host.Density;

            if ((bits & ScriptBaseClass.FRICTION) == ScriptBaseClass.FRICTION)
                m_host.Friction = (float) friction;
            else
                blocks[0].Friction = m_host.Friction;

            if ((bits & ScriptBaseClass.RESTITUTION) == ScriptBaseClass.RESTITUTION)
                m_host.Restitution = (float) restitution;
            else
                blocks[0].Restitution = m_host.Restitution;

            if ((bits & ScriptBaseClass.GRAVITY_MULTIPLIER) == ScriptBaseClass.GRAVITY_MULTIPLIER)
                m_host.GravityMultiplier = (float) gravityMultiplier;
            else
                blocks[0].GravityMultiplier = m_host.GravityMultiplier;

            bool UsePhysics = ((m_host.Flags & PrimFlags.Physics) != 0);
            bool IsTemporary = ((m_host.Flags & PrimFlags.TemporaryOnRez) != 0);
            bool IsPhantom = ((m_host.Flags & PrimFlags.Phantom) != 0);
            bool IsVolumeDetect = m_host.VolumeDetectActive;
            blocks[0].PhysicsShapeType = m_host.PhysicsType;
            if (m_host.UpdatePrimFlags(UsePhysics, IsTemporary, IsPhantom, IsVolumeDetect, blocks))
                m_host.ParentEntity.RebuildPhysicalRepresentation(true, null);
        }
예제 #33
0
 public void aaSetConeOfSilence(LSL_Float radius)
 {
     if (!ScriptProtection.CheckThreatLevel(ThreatLevel.Low, "aaSetConeOfSilence", m_host, "AA", m_itemID))
         return;
     if (World.Permissions.IsGod(m_host.OwnerID))
         m_host.SetConeOfSilence(radius.value);
     else
         ShoutError("You do not have god permissions here.");
 }
예제 #34
0
 public void AASetConeOfSilence(LSL_Float radius)
 {
     m_AA_Functions.AASetConeOfSilence(radius);
 }
예제 #35
0
 public LSL_Integer llTarget (LSL_Vector position, LSL_Float range)
 {
     if(!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID)) return 0;
     
     return m_host.registerTargetWaypoint(new Vector3((float)position.x, (float)position.y, (float)position.z), (float)range);
 }