當前位置: 首頁>>代碼示例>>C#>>正文


C# SceneObjectPart.UpdatePrimFlags方法代碼示例

本文整理匯總了C#中OpenSim.Region.Framework.Scenes.SceneObjectPart.UpdatePrimFlags方法的典型用法代碼示例。如果您正苦於以下問題:C# SceneObjectPart.UpdatePrimFlags方法的具體用法?C# SceneObjectPart.UpdatePrimFlags怎麽用?C# SceneObjectPart.UpdatePrimFlags使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在OpenSim.Region.Framework.Scenes.SceneObjectPart的用法示例。


在下文中一共展示了SceneObjectPart.UpdatePrimFlags方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: LinkNonRootPart

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

            parentRot = oldGroupRotation;

            Vector3 axPos = part.OffsetPosition;

            axPos *= parentRot;
            part.OffsetPosition = axPos;
            part.GroupPosition = oldGroupPosition + part.OffsetPosition;
            part.OffsetPosition = Vector3.Zero;
            part.RotationOffset = worldRot;

            part.SetParent(this);
            part.ParentID = m_rootPart.LocalId;

            m_parts.Add(part.UUID, part);

            part.LinkNum = linkNum;

            part.OffsetPosition = part.GroupPosition - AbsolutePosition;

            Quaternion rootRotation = m_rootPart.RotationOffset;

            Vector3 pos = part.OffsetPosition;
            pos *= Quaternion.Inverse(rootRotation);
            part.OffsetPosition = pos;

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

            part.UpdatePrimFlags(UsesPhysics, IsTemporary, IsPhantom, IsVolumeDetect);
        }
開發者ID:JAllard,項目名稱:opensim,代碼行數:38,代碼來源:SceneObjectGroup.cs

示例2: LinkNonRootPart

        // This links an SOP from a previous linkset into my linkset.
        // The trick is that the SOP's position and rotation are relative to the old root SOP's
        //    so we are passed in the position and rotation of the old linkset so this can
        //    unjigger this SOP's position and rotation from the previous linkset and
        //    then make them relative to my linkset root.
        private void LinkNonRootPart(SceneObjectPart part, Vector3 oldGroupPosition, Quaternion oldGroupRotation, int linkNum)
        {
            Quaternion parentRot = oldGroupRotation;
            Quaternion oldRot = part.RotationOffset;

            // Move our position to not be relative to the old parent
            Vector3 axPos = part.OffsetPosition;
            axPos *= parentRot;
            part.OffsetPosition = axPos;
            part.GroupPosition = oldGroupPosition + part.OffsetPosition;
            part.OffsetPosition = Vector3.Zero;

            // Compution our rotation to be not relative to the old parent
            Quaternion worldRot = parentRot * oldRot;
            part.RotationOffset = worldRot;

            // Add this SOP to our linkset
            part.SetParent(this);
            part.ParentID = m_rootPart.LocalId;
            m_parts.Add(part.UUID, part);

            part.LinkNum = linkNum;

            // Compute the new position of this SOP relative to the group position
            part.OffsetPosition = part.GroupPosition - AbsolutePosition;

            // (radams1 20120711: I don't know why part.OffsetPosition is set multiple times.
            //   It would have the affect of setting the physics engine position multiple 
            //   times. In theory, that is not necessary but I don't have a good linkset
            //   test to know that cleaning up this code wouldn't break things.)

            // Rotate the relative position by the rotation of the group
            Quaternion rootRotation = m_rootPart.RotationOffset;
            Vector3 pos = part.OffsetPosition;
            pos *= Quaternion.Inverse(rootRotation);
            part.OffsetPosition = pos;

            // Compute the SOP's rotation relative to the rotation of the group.
            parentRot = m_rootPart.RotationOffset;
            oldRot = part.RotationOffset;
            Quaternion newRot = Quaternion.Inverse(parentRot) * oldRot;
            part.RotationOffset = newRot;

            // Since this SOP's state has changed, push those changes into the physics engine
            //    and the simulator.
            part.UpdatePrimFlags(UsesPhysics, IsTemporary, IsPhantom, IsVolumeDetect);
        }
開發者ID:justasabc,項目名稱:opensim75grid,代碼行數:52,代碼來源:SceneObjectGroup.cs

示例3: SetPhysics

 private void SetPhysics(SceneObjectPart part, bool flag)
 {
     bool isTemporary = (part.ObjectFlags & (uint)PrimFlags.Temporary) != 0;
     bool isPhantom = (part.ObjectFlags & (uint)PrimFlags.Phantom) != 0;
     part.UpdatePrimFlags(flag, isTemporary, isPhantom, part.VolumeDetectActive);
 }
開發者ID:takayuki,項目名稱:opensim-pcproject,代碼行數:6,代碼來源:PCVM.Primitives.cs


注:本文中的OpenSim.Region.Framework.Scenes.SceneObjectPart.UpdatePrimFlags方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。