public void Initialize (ScriptEngine module)
        {
            m_module = module;

            m_manager = module.Worlds[0].RequestModuleInterface<IComponentManager> ();
            DefaultComponents com = new DefaultComponents (m_componentName);
            m_manager.RegisterComponent (com);
        }
Exemple #2
0
 /// <summary>
 ///   Get the State of a Component with the given name
 /// </summary>
 /// <param name = "obj">The object being checked</param>
 /// <param name = "Name">Name of the Component</param>
 /// <returns>The State of the Component</returns>
 public OSD GetComponentState(ISceneChildEntity obj, string Name)
 {
     //Check whether a Component exists for this name
     if (m_components.ContainsKey(Name))
     {
         //Return the State of the object
         return(m_components[Name].GetState(obj.UUID));
     }
     else
     {
         MainConsole.Instance.Warn("PUT THIS IN THE AURORA-SIM IRC CHANNEL IF POSSIBLE: " + Name);
         DefaultComponents com = new DefaultComponents(Name, 0);
         RegisterComponent(com);
         return(m_components[Name].GetState(obj.UUID));
     }
 }
Exemple #3
0
 public void RemoveComponentState(UUID obj, string name)
 {
     if (obj == UUID.Zero)
     {
         return;
     }
     //Check whether a Component exists for this name
     if (m_components.ContainsKey(name))
     {
         //Set the State
         m_components[name].RemoveState(obj);
     }
     else
     {
         DefaultComponents com = new DefaultComponents(name, 0);
         RegisterComponent(com);
         m_components[name].RemoveState(obj);
     }
 }
Exemple #4
0
 /// <summary>
 ///   Set the State of the Component with the given name
 /// </summary>
 /// <param name = "obj">The object to update</param>
 /// <param name = "Name">Name of the Component</param>
 /// <param name = "State">State to set the Component to</param>
 public void SetComponentState(ISceneChildEntity obj, string Name, OSD State)
 {
     if (obj.UUID == UUID.Zero)
     {
         return;
     }
     //Check whether a Component exists for this name
     if (m_components.ContainsKey(Name))
     {
         //Set the State
         m_components[Name].SetState(obj.UUID, State);
     }
     else
     {
         DefaultComponents com = new DefaultComponents(Name, 0);
         RegisterComponent(com);
         m_components[Name].SetState(obj.UUID, State);
     }
 }
Exemple #5
0
        /// <summary>
        ///   Register a few default Components that are in the SOP
        /// </summary>
        private void RegisterDefaultComponents()
        {
            DefaultComponents com = new DefaultComponents("APIDTarget", Quaternion.Identity);

            RegisterComponent(com);
            com = new DefaultComponents("APIDDamp", 0);
            RegisterComponent(com);
            com = new DefaultComponents("APIDStrength", 0);
            RegisterComponent(com);
            com = new DefaultComponents("ParticleSystem", new byte[0]);
            RegisterComponent(com);
            com = new DefaultComponents("Expires", null);
            RegisterComponent(com);
            com = new DefaultComponents("Rezzed", null);
            RegisterComponent(com);
            com = new DefaultComponents("Damage", 0);
            RegisterComponent(com);
            com = new DefaultComponents("DIE_AT_EDGE", false);
            RegisterComponent(com);
            com = new DefaultComponents("SitTargetOrientation", Quaternion.Identity);
            RegisterComponent(com);
            com = new DefaultComponents("SitTargetPosition", Vector3.Zero);
            RegisterComponent(com);
            com = new DefaultComponents("SitTargetOrientationLL", Vector3.Zero);
            RegisterComponent(com);
            com = new DefaultComponents("RETURN_AT_EDGE", false);
            RegisterComponent(com);
            com = new DefaultComponents("BlockGrab", false);
            RegisterComponent(com);
            com = new DefaultComponents("BlockGrabObject", false);
            RegisterComponent(com);
            com = new DefaultComponents("StatusSandbox", false);
            RegisterComponent(com);
            com = new DefaultComponents("StatusSandboxPos", Vector3.Zero);
            RegisterComponent(com);
            com = new DefaultComponents("UseSoundQueue", 0);
            RegisterComponent(com);
            com = new DefaultComponents("Sound", UUID.Zero);
            RegisterComponent(com);
            com = new DefaultComponents("SoundFlags", 0);
            RegisterComponent(com);
            com = new DefaultComponents("SoundGain", 0);
            RegisterComponent(com);
            com = new DefaultComponents("SoundRadius", 0);
            RegisterComponent(com);
            com = new DefaultComponents("STATUS_ROTATE_X", 0);
            RegisterComponent(com);
            com = new DefaultComponents("STATUS_ROTATE_Y", 0);
            RegisterComponent(com);
            com = new DefaultComponents("STATUS_ROTATE_Z", 0);
            RegisterComponent(com);
            com = new DefaultComponents("PIDTarget", Vector3.Zero);
            RegisterComponent(com);
            com = new DefaultComponents("PIDActive", false);
            RegisterComponent(com);
            com = new DefaultComponents("PIDTau", 0);
            RegisterComponent(com);
            com = new DefaultComponents("VolumeDetectActive", false);
            RegisterComponent(com);
            com = new DefaultComponents("CameraEyeOffset", Vector3.Zero);
            RegisterComponent(com);
            com = new DefaultComponents("CameraAtOffset", Vector3.Zero);
            RegisterComponent(com);
            com = new DefaultComponents("ForceMouselook", false);
            RegisterComponent(com);
            com = new DefaultComponents("CRC", 0);
            RegisterComponent(com);
            com = new DefaultComponents("LocalId", 0);
            RegisterComponent(com);
            com = new DefaultComponents("TextureAnimation", new byte[0]);
            RegisterComponent(com);
            com = new DefaultComponents("SavedAttachedPos", Vector3.Zero);
            RegisterComponent(com);
            com = new DefaultComponents("SavedAttachmentPoint", 0);
            RegisterComponent(com);
            com = new DefaultComponents("PhysicsType", 0);
            RegisterComponent(com);
            com = new DefaultComponents("Density", 0);
            RegisterComponent(com);
            com = new DefaultComponents("GravityMultiplier", 0);
            RegisterComponent(com);
            com = new DefaultComponents("Friction", 0);
            RegisterComponent(com);
            com = new DefaultComponents("Restitution", 0);
            RegisterComponent(com);
            com = new DefaultComponents("ScriptState", "");
            RegisterComponent(com);
            com = new DefaultComponents("OmegaAxis", Vector3.Zero);
            RegisterComponent(com);
            com = new DefaultComponents("OmegaSpinRate", 0);
            RegisterComponent(com);
            com = new DefaultComponents("OmegaGain", 0);
            RegisterComponent(com);
            com = new DefaultComponents("VehicleType", 0);
            RegisterComponent(com);
            com = new DefaultComponents("VehicleParameters", 0);
            RegisterComponent(com);
            com = new DefaultComponents("VehicleFlags", 0);
            RegisterComponent(com);
            com = new DefaultComponents("PIDHoverActive", 0);
            RegisterComponent(com);
            com = new DefaultComponents("KeyframeAnimation", null);
            RegisterComponent(com);
            com = new DefaultComponents("APIDEnabled", null);
            RegisterComponent(com);
            com = new DefaultComponents("APIDIterations", 0);
            RegisterComponent(com);
        }
 /// <summary>
 /// Register a few default Components that are in the SOP
 /// </summary>
 private void RegisterDefaultComponents()
 {
     DefaultComponents com = new DefaultComponents("APIDTarget", Quaternion.Identity);
     RegisterComponent(com);
     com = new DefaultComponents("APIDDamp", 0);
     RegisterComponent(com);
     com = new DefaultComponents("APIDStrength", 0);
     RegisterComponent(com);
     com = new DefaultComponents("ParticleSystem", new byte[0]);
     RegisterComponent(com);
     com = new DefaultComponents ("Expires", null);
     RegisterComponent(com);
     com = new DefaultComponents("Rezzed", null);
     RegisterComponent(com);
     com = new DefaultComponents("Damage", 0);
     RegisterComponent(com);
     com = new DefaultComponents("DIE_AT_EDGE", false);
     RegisterComponent(com);
     com = new DefaultComponents("SitTargetOrientation", Quaternion.Identity);
     RegisterComponent(com);
     com = new DefaultComponents("SitTargetPosition", Vector3.Zero);
     RegisterComponent(com);
     com = new DefaultComponents ("SitTargetOrientationLL", Vector3.Zero);
     RegisterComponent(com);
     com = new DefaultComponents ("RETURN_AT_EDGE", false);
     RegisterComponent(com);
     com = new DefaultComponents ("BlockGrab", false);
     RegisterComponent(com);
     com = new DefaultComponents ("BlockGrabObject", false);
     RegisterComponent(com);
     com = new DefaultComponents("StatusSandbox", false);
     RegisterComponent(com);
     com = new DefaultComponents("StatusSandboxPos", Vector3.Zero);
     RegisterComponent(com);
     com = new DefaultComponents("UseSoundQueue", 0);
     RegisterComponent(com);
     com = new DefaultComponents("Sound", UUID.Zero);
     RegisterComponent(com);
     com = new DefaultComponents("SoundFlags", 0);
     RegisterComponent(com);
     com = new DefaultComponents("SoundGain", 0);
     RegisterComponent(com);
     com = new DefaultComponents("SoundRadius", 0);
     RegisterComponent(com);
     com = new DefaultComponents("STATUS_ROTATE_X", 0);
     RegisterComponent(com);
     com = new DefaultComponents("STATUS_ROTATE_Y", 0);
     RegisterComponent(com);
     com = new DefaultComponents("STATUS_ROTATE_Z", 0);
     RegisterComponent(com);
     com = new DefaultComponents("PIDTarget", Vector3.Zero);
     RegisterComponent(com);
     com = new DefaultComponents("PIDActive", false);
     RegisterComponent(com);
     com = new DefaultComponents("PIDTau", 0);
     RegisterComponent(com);
     com = new DefaultComponents("VolumeDetectActive", false);
     RegisterComponent(com);
     com = new DefaultComponents("CameraEyeOffset", Vector3.Zero);
     RegisterComponent(com);
     com = new DefaultComponents("CameraAtOffset", Vector3.Zero);
     RegisterComponent(com);
     com = new DefaultComponents("ForceMouselook", false);
     RegisterComponent(com);
     com = new DefaultComponents("CRC", 0);
     RegisterComponent(com);
     com = new DefaultComponents("LocalId", 0);
     RegisterComponent(com);
     com = new DefaultComponents("TextureAnimation", new byte[0]);
     RegisterComponent(com);
     com = new DefaultComponents("SavedAttachedPos", Vector3.Zero);
     RegisterComponent (com);
     com = new DefaultComponents ("SavedAttachmentPoint", 0);
     RegisterComponent (com);
     com = new DefaultComponents ("PhysicsType", 0);
     RegisterComponent (com);
     com = new DefaultComponents ("Density", 0);
     RegisterComponent (com);
     com = new DefaultComponents ("GravityMultiplier", 0);
     RegisterComponent (com);
     com = new DefaultComponents ("Friction", 0);
     RegisterComponent (com);
     com = new DefaultComponents ("Restitution", 0);
     RegisterComponent (com);
     com = new DefaultComponents ("ScriptState", "");
     RegisterComponent (com);
     com = new DefaultComponents ("OmegaAxis", Vector3.Zero);
     RegisterComponent (com);
     com = new DefaultComponents ("OmegaSpinRate", 0);
     RegisterComponent (com);
     com = new DefaultComponents ("OmegaGain", 0);
     RegisterComponent (com);
     com = new DefaultComponents ("VehicleType", 0);
     RegisterComponent (com);
     com = new DefaultComponents ("VehicleParameters", 0);
     RegisterComponent (com);
     com = new DefaultComponents ("VehicleFlags", 0);
     RegisterComponent (com);
     com = new DefaultComponents ("PIDHoverActive", 0);
     RegisterComponent (com);
 }
 public void RemoveComponentState (UUID obj, string name)
 {
     if (obj == UUID.Zero)
         return;
     //Check whether a Component exists for this name
     if (m_components.ContainsKey (Name))
     {
         //Set the State
         m_components[Name].RemoveState (obj);
     }
     else
     {
         DefaultComponents com = new DefaultComponents (Name, 0);
         RegisterComponent (com);
         m_components[Name].RemoveState (obj);
     }
 }
 /// <summary>
 /// Set the State of the Component with the given name
 /// </summary>
 /// <param name="obj">The object to update</param>
 /// <param name="Name">Name of the Component</param>
 /// <param name="State">State to set the Component to</param>
 public void SetComponentState(ISceneChildEntity obj, string Name, OSD State)
 {
     if (obj.UUID == UUID.Zero)
         return;
     //Check whether a Component exists for this name
     if (m_components.ContainsKey(Name))
     {
         //Set the State
         m_components[Name].SetState(obj.UUID, State);
     }
     else
     {
         DefaultComponents com = new DefaultComponents (Name, 0);
         RegisterComponent (com);
         m_components[Name].SetState (obj.UUID, State);
     }
 }
 /// <summary>
 /// Get the State of a Component with the given name
 /// </summary>
 /// <param name="obj">The object being checked</param>
 /// <param name="Name">Name of the Component</param>
 /// <returns>The State of the Component</returns>
 public OSD GetComponentState (ISceneChildEntity obj, string Name)
 {
     //Check whether a Component exists for this name
     if (m_components.ContainsKey (Name))
     {
         //Return the State of the object
         return m_components[Name].GetState (obj.UUID);
     }
     else
     {
         m_log.Warn ("PUT THIS IN THE AURORA-SIM IRC CHANNEL IF POSSIBLE: " + Name);
         DefaultComponents com = new DefaultComponents (Name, 0);
         RegisterComponent (com);
         return m_components[Name].GetState (obj.UUID);
     }
 }
Exemple #10
0
        /// <summary>
        /// Register a few default Components that are in the SOP
        /// </summary>
        private void RegisterDefaultComponents()
        {
            DefaultComponents com = new DefaultComponents("APIDTarget");

            RegisterComponent(com);
            com = new DefaultComponents("APIDDamp");
            RegisterComponent(com);
            com = new DefaultComponents("APIDStrength");
            RegisterComponent(com);
            com = new DefaultComponents("ParticleSystem");
            RegisterComponent(com);
            com = new DefaultComponents("Expires");
            RegisterComponent(com);
            com = new DefaultComponents("Rezzed");
            RegisterComponent(com);
            com = new DefaultComponents("Damage");
            RegisterComponent(com);
            com = new DefaultComponents("DIE_AT_EDGE");
            RegisterComponent(com);
            com = new DefaultComponents("SitTargetOrientation");
            RegisterComponent(com);
            com = new DefaultComponents("SitTargetPosition");
            RegisterComponent(com);
            com = new DefaultComponents("SitTargetOrientationLL");
            RegisterComponent(com);
            com = new DefaultComponents("RETURN_AT_EDGE");
            RegisterComponent(com);
            com = new DefaultComponents("BlockGrab");
            RegisterComponent(com);
            com = new DefaultComponents("StatusSandbox");
            RegisterComponent(com);
            com = new DefaultComponents("StatusSandboxPos");
            RegisterComponent(com);
            com = new DefaultComponents("UseSoundQueue");
            RegisterComponent(com);
            com = new DefaultComponents("Sound");
            RegisterComponent(com);
            com = new DefaultComponents("SoundFlags");
            RegisterComponent(com);
            com = new DefaultComponents("SoundGain");
            RegisterComponent(com);
            com = new DefaultComponents("SoundRadius");
            RegisterComponent(com);
            com = new DefaultComponents("STATUS_ROTATE_X");
            RegisterComponent(com);
            com = new DefaultComponents("STATUS_ROTATE_Y");
            RegisterComponent(com);
            com = new DefaultComponents("STATUS_ROTATE_Z");
            RegisterComponent(com);
            com = new DefaultComponents("PIDTarget");
            RegisterComponent(com);
            com = new DefaultComponents("PIDActive");
            RegisterComponent(com);
            com = new DefaultComponents("PIDTau");
            RegisterComponent(com);
            com = new DefaultComponents("VolumeDetectActive");
            RegisterComponent(com);
            com = new DefaultComponents("CameraEyeOffset");
            RegisterComponent(com);
            com = new DefaultComponents("CameraAtOffset");
            RegisterComponent(com);
            com = new DefaultComponents("ForceMouselook");
            RegisterComponent(com);
            com = new DefaultComponents("CRC");
            RegisterComponent(com);
            com = new DefaultComponents("LocalId");
            RegisterComponent(com);
            com = new DefaultComponents("TextureAnimation");
            RegisterComponent(com);
            com = new DefaultComponents("SavedAttachedPos");
            RegisterComponent(com);
            com = new DefaultComponents("SavedAttachmentPoint");
            RegisterComponent(com);
        }
 /// <summary>
 /// Register a few default Components that are in the SOP
 /// </summary>
 private void RegisterDefaultComponents()
 {
     DefaultComponents com = new DefaultComponents("APIDTarget");
     RegisterComponent(com);
     com = new DefaultComponents("APIDDamp");
     RegisterComponent(com);
     com = new DefaultComponents("APIDStrength");
     RegisterComponent(com);
     com = new DefaultComponents("ParticleSystem");
     RegisterComponent(com);
     com = new DefaultComponents("Expires");
     RegisterComponent(com);
     com = new DefaultComponents("Rezzed");
     RegisterComponent(com);
     com = new DefaultComponents("Damage");
     RegisterComponent(com);
     com = new DefaultComponents("DIE_AT_EDGE");
     RegisterComponent(com);
     com = new DefaultComponents("SitTargetOrientation");
     RegisterComponent(com);
     com = new DefaultComponents("SitTargetPosition");
     RegisterComponent(com);
     com = new DefaultComponents("SitTargetOrientationLL");
     RegisterComponent(com);
     com = new DefaultComponents("RETURN_AT_EDGE");
     RegisterComponent(com);
     com = new DefaultComponents("BlockGrab");
     RegisterComponent(com);
     com = new DefaultComponents("StatusSandbox");
     RegisterComponent(com);
     com = new DefaultComponents("StatusSandboxPos");
     RegisterComponent(com);
     com = new DefaultComponents("UseSoundQueue");
     RegisterComponent(com);
     com = new DefaultComponents("Sound");
     RegisterComponent(com);
     com = new DefaultComponents("SoundFlags");
     RegisterComponent(com);
     com = new DefaultComponents("SoundGain");
     RegisterComponent(com);
     com = new DefaultComponents("SoundRadius");
     RegisterComponent(com);
     com = new DefaultComponents("STATUS_ROTATE_X");
     RegisterComponent(com);
     com = new DefaultComponents("STATUS_ROTATE_Y");
     RegisterComponent(com);
     com = new DefaultComponents("STATUS_ROTATE_Z");
     RegisterComponent(com);
     com = new DefaultComponents("PIDTarget");
     RegisterComponent(com);
     com = new DefaultComponents("PIDActive");
     RegisterComponent(com);
     com = new DefaultComponents("PIDTau");
     RegisterComponent(com);
     com = new DefaultComponents("VolumeDetectActive");
     RegisterComponent(com);
     com = new DefaultComponents("CameraEyeOffset");
     RegisterComponent(com);
     com = new DefaultComponents("CameraAtOffset");
     RegisterComponent(com);
     com = new DefaultComponents("ForceMouselook");
     RegisterComponent(com);
     com = new DefaultComponents("CRC");
     RegisterComponent(com);
     com = new DefaultComponents("LocalId");
     RegisterComponent(com);
     com = new DefaultComponents("TextureAnimation");
     RegisterComponent(com);
     com = new DefaultComponents("SavedAttachedPos");
     RegisterComponent(com);
     com = new DefaultComponents("SavedAttachmentPoint");
     RegisterComponent(com);
 }