當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。