Beispiel #1
0
        public void SendAvatarTerseUpdate(ScenePresence scenePresence)
        {
            //if (!ShowEntityToClient(m_presence.AbsolutePosition, scenePresence))
            //    return;//When they move around, they will trigger more updates, so when they get into the other avatar's DD, they will update
            Vector3    vPos      = Vector3.Zero;
            Quaternion vRot      = Quaternion.Identity;
            uint       vParentID = 0;

            m_perfMonMS = Environment.TickCount;
            scenePresence.RecalcVisualPosition(out vPos, out vRot, out vParentID);    // vParentID is not used in terse updates.  o.O
            PhysicsActor physActor = scenePresence.PhysicsActor;
            Vector3      accel     = (physActor != null) ? physActor.Acceleration : Vector3.Zero;

            // m_log.InfoFormat("[SCENE PRESENCE]: SendTerseUpdateToClient sit at {0} vel {1} rot {2} ", pos.ToString(),vel.ToString(), rot.ToString());
            m_presence.ControllingClient.SendAvatarTerseUpdate(scenePresence.Scene.RegionInfo.RegionHandle, (ushort)(scenePresence.Scene.TimeDilation * ushort.MaxValue), scenePresence.LocalId, vPos,
                                                               scenePresence.Velocity, accel, vRot, scenePresence.UUID, physActor != null ? physActor.CollisionPlane : Vector4.UnitW);
            m_presence.Scene.StatsReporter.AddAgentTime(Environment.TickCount - m_perfMonMS);
            m_presence.Scene.StatsReporter.AddAgentUpdates(1);
        }