コード例 #1
0
        public override PhysicsActor AddAvatar(string avName, Vector3 position, Quaternion rotation, Vector3 size,
                                               bool isFlying, uint localID, UUID UUID)
        {
            if (!m_initialized)
            {
                return(null);
            }

            BSCharacter actor = new BSCharacter(localID, avName, this, position, size, isFlying);

            actor.UUID = UUID;
            lock (PhysObjects)
                PhysObjects.Add(localID, actor);

            // TODO: Remove kludge someday.
            // We must generate a collision for avatars whether they collide or not.
            // This is required by Universe to update avatar animations, etc.
            lock (m_avatars)
                m_avatars.Add(actor);

            return(actor);
        }
コード例 #2
0
        public override void RemoveAvatar(PhysicsActor actor)
        {
            // MainConsole.Instance.DebugFormat("{0}: RemoveAvatar", LogHeader);

            if (!m_initialized)
            {
                return;
            }

            BSCharacter bsactor = actor as BSCharacter;

            if (bsactor != null)
            {
                try
                {
                    lock (PhysObjects)
                        PhysObjects.Remove(bsactor.LocalID);
                    // Remove kludge someday
                    lock (m_avatars)
                        m_avatars.Remove(bsactor);
                }
                catch (Exception e)
                {
                    MainConsole.Instance.WarnFormat("{0}: Attempt to remove avatar that is not in physics scene: {1}",
                                                    LogHeader, e);
                }
                bsactor.Destroy();
                // bsactor.dispose();
            }
            else
            {
                MainConsole.Instance.ErrorFormat(
                    "{0}: Requested to remove avatar that is not a BSCharacter. ID={1}, type={2}",
                    LogHeader, actor.LocalID, actor.GetType().Name);
            }
        }
コード例 #3
0
        public override PhysicsActor AddAvatar(string avName, Vector3 position, Quaternion rotation, Vector3 size,
            bool isFlying, uint localID, UUID UUID)
        {
            if (!m_initialized) return null;

            BSCharacter actor = new BSCharacter(localID, avName, this, position, size, isFlying);
            actor.UUID = UUID;
            lock (PhysObjects)
                PhysObjects.Add(localID, actor);

            // TODO: Remove kludge someday.
            // We must generate a collision for avatars whether they collide or not.
            // This is required by Universe to update avatar animations, etc.
            lock (m_avatars)
                m_avatars.Add(actor);

            return actor;
        }