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


C# SceneObjectPart.SetParentAndUpdatePhysics方法代码示例

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


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

示例1: AddPart

        /// <summary>
        /// Add a new part to this scene object.  The part must already be correctly configured.
        /// </summary>
        /// <param name="part"></param>
        public void AddPart(SceneObjectPart part)
        {
            lock (m_parts)
            {
                part.SetParentAndUpdatePhysics(this);
                m_parts.Add(part.UUID, part);
                this.TrackLocalId(part, part.LocalId);

                part.LinkNum = m_parts.Count;

                if (part.LinkNum == 2 && RootPart != null)
                    RootPart.LinkNum = 1;

                //Rebuild the bounding box
                ClearBoundingBoxCache();

                // Update the ServerWeight/LandImpact
                RecalcPrimWeights();
            }
        }
开发者ID:zwagoth,项目名称:halcyon,代码行数:24,代码来源:SceneObjectGroup.cs

示例2: LinkNonRootPart

        private void LinkNonRootPart(SceneObjectPart part, Vector3 oldGroupPosition, Quaternion oldGroupRotation, int linkNum)
        {
            Quaternion parentRot = oldGroupRotation;
            Quaternion oldRot = part.RotationOffset;
            Quaternion worldRot = parentRot * oldRot;

            Vector3 partOffsetPosition = part.OffsetPosition;
            Vector3 partGroupPosition = part.GroupPosition;
            Quaternion partRotationOffset = part.RotationOffset;

            parentRot = oldGroupRotation;

            Vector3 axPos = partOffsetPosition;
            axPos *= parentRot;
            partOffsetPosition = axPos;

            partGroupPosition = oldGroupPosition + partOffsetPosition;
            partOffsetPosition = Vector3.Zero;
            partRotationOffset = worldRot;

            // Caller locks m_parts for us
            m_parts.Add(part.UUID, part);
            this.TrackLocalId(part, part.LocalId);

            part.LinkNum = linkNum;

            partOffsetPosition = partGroupPosition - AbsolutePosition;

            Quaternion rootRotation = m_rootPart.RotationOffset;

            Vector3 pos = partOffsetPosition;
            pos *= Quaternion.Inverse(rootRotation);
            partOffsetPosition = pos;

            parentRot = m_rootPart.RotationOffset;
            oldRot = partRotationOffset;
            Quaternion newRot = Quaternion.Inverse(parentRot) * oldRot;
            partRotationOffset = newRot;

            part.SetOffsetPositionDirect(partOffsetPosition);
            part.SetGroupPositionDirect(partGroupPosition);
            part.SetRotationOffsetDirect(partRotationOffset);

            part.ParentID = m_rootPart.LocalId;
            part.SetParentAndUpdatePhysics(this);
        }
开发者ID:zwagoth,项目名称:halcyon,代码行数:46,代码来源:SceneObjectGroup.cs

示例3: AddPart

        /// <summary>
        /// Add a new part to this scene object.  The part must already be correctly configured.
        /// </summary>
        /// <param name="part"></param>
        public void AddPart(SceneObjectPart part)
        {
            part.SetParentAndUpdatePhysics(this);
            int count = m_childParts.AddPart(part);

            part.LinkNum = count;

            if (part.LinkNum == 2 && RootPart != null)
                RootPart.LinkNum = 1;

            //Rebuild the bounding box
            ClearBoundingBoxCache();

            // Update the ServerWeight/LandImpact
            RecalcPrimWeights();
            RecalcScriptedStatus();
        }
开发者ID:kf6kjg,项目名称:halcyon,代码行数:21,代码来源:SceneObjectGroup.cs


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