Exemplo n.º 1
0
        /// <summary>
        /// Sends a location update to the client connected to this scenePresence
        /// </summary>
        /// <param name="remoteClient"></param>
        public void SendTerseUpdateToClient(IClientAPI remoteClient)
        {
            // If the client is inactive, it's getting its updates from another
            // server.
            if (remoteClient.IsActive)
            {
                m_perfMonMS = Util.EnvironmentTickCount();

                PhysicsActor actor = m_physicsActor;
                Vector3 velocity = (actor != null) ? actor.Velocity : Vector3.Zero;

                Vector3 pos = m_pos;
                pos.Z += m_appearance.HipOffset;

                //m_log.DebugFormat("[SCENEPRESENCE]: TerseUpdate: Pos={0} Rot={1} Vel={2}", m_pos, m_bodyRot, m_velocity);

                remoteClient.SendAvatarTerseUpdate(new SendAvatarTerseData(m_rootRegionHandle, (ushort)(m_scene.TimeDilation * ushort.MaxValue), LocalId,
                    pos, velocity, Vector3.Zero, m_bodyRot, CollisionPlane, m_uuid, null, GetUpdatePriority(remoteClient)));

                m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS));
                m_scene.StatsReporter.AddAgentUpdates(1);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Sends a location update to the client connected to this scenePresence
        /// </summary>
        /// <param name="remoteClient"></param>
        public void SendTerseUpdateToClient(IClientAPI remoteClient)
        {
            // If the client is inactive, it's getting its updates from another
            // server.
            if (remoteClient.IsActive)
            {
                m_perfMonMS = Environment.TickCount;

                Vector3 pos = m_pos;
                Vector3 vel = Velocity;
                Quaternion rot = m_bodyRot;
                pos.Z -= m_appearance.HipOffset;
                remoteClient.SendAvatarTerseUpdate(m_regionHandle, (ushort)(m_scene.TimeDilation * ushort.MaxValue), LocalId, new Vector3(pos.X, pos.Y, pos.Z),
                                                   new Vector3(vel.X, vel.Y, vel.Z), rot, m_uuid);

                m_scene.StatsReporter.AddAgentTime(Environment.TickCount - m_perfMonMS);
                m_scene.StatsReporter.AddAgentUpdates(1);
            }
        }