当前位置: 首页>>代码示例>>C#>>正文


C# SceneObjectPart.AddSeatedAvatar方法代码示例

本文整理汇总了C#中OpenSim.Region.Framework.Scenes.SceneObjectPart.AddSeatedAvatar方法的典型用法代码示例。如果您正苦于以下问题:C# SceneObjectPart.AddSeatedAvatar方法的具体用法?C# SceneObjectPart.AddSeatedAvatar怎么用?C# SceneObjectPart.AddSeatedAvatar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OpenSim.Region.Framework.Scenes.SceneObjectPart的用法示例。


在下文中一共展示了SceneObjectPart.AddSeatedAvatar方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ContinueSitAsRootAgent

        private void ContinueSitAsRootAgent(IClientAPI client, SceneObjectPart part, Vector3 offset)
        {
            Quaternion sitOrientation = Quaternion.Identity;

            DumpDebug("ContinueSitAsRootAgent", "n/a");

            if (part != null)
            {
                lock (m_posInfo)
                {
                    SceneObjectGroup group = part.ParentGroup;
                    SitTargetInfo sitInfo = group.SitTargetForPart(part.UUID);

                    part.AddSeatedAvatar(this, false);
                    sitOrientation = sitInfo.Rotation;

                    m_requestedSitTargetUUID = part.UUID;
                    m_requestedSitTargetID = part.LocalId;

                    if (m_avatarMovesWithPart)
                    {
                        Vector3 newPos = sitInfo.Offset;
                        newPos += m_sitTargetCorrectionOffset;
                        m_bodyRot = sitInfo.Rotation;
                        //Rotation = sitTargetOrient;
                        SetAgentPositionInfo(null, true, newPos, part, part.AbsolutePosition, Vector3.Zero);
                    }
                }
                //m_animPersistUntil = 0;    // abort any timed animation

                // Avatar has arrived on prim
                int avatarsRemainingOnPrim = part.ParentGroup.RidingAvatarArrivedFromOtherSim();
                if (avatarsRemainingOnPrim > 0)
                {
                    m_log.InfoFormat("[SCENE PRESENCE]: {0} Recognizing incoming avatar {1} seated on {2} ({3} remain)",
                        Scene.RegionInfo.RegionName, this.UUID.ToString(), part.ParentGroup.Name, part.ParentGroup.AvatarsToExpect);
                }

                m_scene.EventManager.TriggerOnCrossedAvatarReady(part, this.UUID);

                //mitigation for client not getting the required immediate update for crossing objects
                //part.ParentGroup.SendFullUpdateToClientImmediate(this.ControllingClient);

                // Trigger any remaining events that rely on the avatar being present.
                if (!part.ParentGroup.IsAttachment)
                    if (avatarsRemainingOnPrim == 0)
                        part.ParentGroup.TriggerScriptChangedEvent(Changed.REGION);

                if (ControllingClient.DebugCrossings)
                {
                    ulong elapsedMs = (Util.GetLongTickCount() - part.ParentGroup.TimeReceived);
                    string msg = (elapsedMs / 1000.0f).ToString("0.000") + " seconds to confirm seated on object  for " + this.Name;
                    m_log.Info("[CROSSING]: " + msg);
                    MessageToUserFromServer(msg);
                }
            }
            else
            {
                m_log.ErrorFormat("[SCENE PRESENCE]: ContinueSitAsRootAgent could not find seated prim {0} for agent {1}", part.UUID.ToString(), client.AgentId.ToString());
            }
        }
开发者ID:emperorstarfinder,项目名称:halcyon,代码行数:61,代码来源:ScenePresence.cs


注:本文中的OpenSim.Region.Framework.Scenes.SceneObjectPart.AddSeatedAvatar方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。