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


C# ObjectShapePacket.ObjectDataBlock类代码示例

本文整理汇总了C#中ObjectShapePacket.ObjectDataBlock的典型用法代码示例。如果您正苦于以下问题:C# ObjectShapePacket.ObjectDataBlock类的具体用法?C# ObjectShapePacket.ObjectDataBlock怎么用?C# ObjectShapePacket.ObjectDataBlock使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: SetPrimitiveShapeParams

        // Prim type sculpt.
        protected void SetPrimitiveShapeParams(SceneObjectPart part, string map, int type, byte pathcurve)
        {
            ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock();
            UUID sculptId;

            if (!UUID.TryParse(map, out sculptId))
            {
                sculptId = InventoryKey(map, (int)AssetType.Texture);
            }

            if (sculptId == UUID.Zero)
                return;

            shapeBlock.PathCurve = pathcurve;
            shapeBlock.ObjectLocalID = part.LocalId;
            shapeBlock.PathScaleX = 100;
            shapeBlock.PathScaleY = 150;

            int flag = type & (ScriptBaseClass.PRIM_SCULPT_FLAG_INVERT | ScriptBaseClass.PRIM_SCULPT_FLAG_MIRROR);

            if (type != (ScriptBaseClass.PRIM_SCULPT_TYPE_CYLINDER | flag) &&
                type != (ScriptBaseClass.PRIM_SCULPT_TYPE_PLANE | flag) &&
                type != (ScriptBaseClass.PRIM_SCULPT_TYPE_SPHERE | flag) &&
                type != (ScriptBaseClass.PRIM_SCULPT_TYPE_TORUS | flag))
            {
                // default
                type = (int)ScriptBaseClass.PRIM_SCULPT_TYPE_SPHERE;
            }

            part.Shape.SetSculptProperties((byte)type, sculptId);
            part.Shape.SculptEntry = true;
            part.UpdateShape(shapeBlock);
        }
开发者ID:OpenPlex-Sim,项目名称:opensim,代码行数:34,代码来源:LSL_Api.cs

示例2: UpdatePrimShape

        /// <summary>
        /// </summary>
        /// <param name="LocalID"></param>
        /// <param name="shapeBlock"></param>
        /// <param name="agentID"></param>
        protected internal void UpdatePrimShape(UUID agentID, uint LocalID, UpdateShapeArgs shapeBlock)
        {
            ISceneChildEntity part;
            if (TryGetPart(LocalID, out part))
            {
                if (m_parentScene.Permissions.CanEditObject(part.UUID, agentID))
                {
                    ObjectShapePacket.ObjectDataBlock shapeData = new ObjectShapePacket.ObjectDataBlock
                                                                      {
                                                                          ObjectLocalID = shapeBlock.ObjectLocalID,
                                                                          PathBegin = shapeBlock.PathBegin,
                                                                          PathCurve = shapeBlock.PathCurve,
                                                                          PathEnd = shapeBlock.PathEnd,
                                                                          PathRadiusOffset = shapeBlock.PathRadiusOffset,
                                                                          PathRevolutions = shapeBlock.PathRevolutions,
                                                                          PathScaleX = shapeBlock.PathScaleX,
                                                                          PathScaleY = shapeBlock.PathScaleY,
                                                                          PathShearX = shapeBlock.PathShearX,
                                                                          PathShearY = shapeBlock.PathShearY,
                                                                          PathSkew = shapeBlock.PathSkew,
                                                                          PathTaperX = shapeBlock.PathTaperX,
                                                                          PathTaperY = shapeBlock.PathTaperY,
                                                                          PathTwist = shapeBlock.PathTwist,
                                                                          PathTwistBegin = shapeBlock.PathTwistBegin,
                                                                          ProfileBegin = shapeBlock.ProfileBegin,
                                                                          ProfileCurve = shapeBlock.ProfileCurve,
                                                                          ProfileEnd = shapeBlock.ProfileEnd,
                                                                          ProfileHollow = shapeBlock.ProfileHollow
                                                                      };

                    ((SceneObjectPart) part).UpdateShape(shapeData);
                }
            }
        }
开发者ID:velus,项目名称:Async-Sim-Testing,代码行数:39,代码来源:SceneGraph.cs

示例3: SetPrimitiveBlockShapeParams

        protected ObjectShapePacket.ObjectDataBlock SetPrimitiveBlockShapeParams(SceneObjectPart part, int holeshape, LSL_Vector cut, float hollow, LSL_Vector twist)
        {
            ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock();

            if (holeshape != (int)ScriptBaseClass.PRIM_HOLE_DEFAULT &&
                holeshape != (int)ScriptBaseClass.PRIM_HOLE_CIRCLE &&
                holeshape != (int)ScriptBaseClass.PRIM_HOLE_SQUARE &&
                holeshape != (int)ScriptBaseClass.PRIM_HOLE_TRIANGLE)
            {
                holeshape = (int)ScriptBaseClass.PRIM_HOLE_DEFAULT;
            }
            shapeBlock.ProfileCurve = (byte)holeshape;
            if (cut.x < 0f)
            {
                cut.x = 0f;
            }
            if (cut.x > 1f)
            {
                cut.x = 1f;
            }
            if (cut.y < 0f)
            {
                cut.y = 0f;
            }
            if (cut.y > 1f)
            {
                cut.y = 1f;
            }
            if (cut.y - cut.x < 0.05f)
            {
                cut.x = cut.y - 0.05f;
                if (cut.x < 0.0f)
                {
                    cut.x = 0.0f;
                    cut.y = 0.05f;
                }
            }
            shapeBlock.ProfileBegin = (ushort)(50000 * cut.x);
            shapeBlock.ProfileEnd = (ushort)(50000 * (1 - cut.y));
            if (hollow < 0f)
            {
                hollow = 0f;
            }
            if (hollow > 0.95)
            {
                hollow = 0.95f;
            }
            shapeBlock.ProfileHollow = (ushort)(50000 * hollow);
            if (twist.x < -1.0f)
            {
                twist.x = -1.0f;
            }
            if (twist.x > 1.0f)
            {
                twist.x = 1.0f;
            }
            if (twist.y < -1.0f)
            {
                twist.y = -1.0f;
            }
            if (twist.y > 1.0f)
            {
                twist.y = 1.0f;
            }
            shapeBlock.PathTwistBegin = (sbyte)(100 * twist.x);
            shapeBlock.PathTwist = (sbyte)(100 * twist.y);

            shapeBlock.ObjectLocalID = part.LocalId;

            // retain pathcurve
            shapeBlock.PathCurve = part.Shape.PathCurve;

            part.Shape.SculptEntry = false;
            return shapeBlock;
        }
开发者ID:mugginsm,项目名称:Aurora-Sim,代码行数:75,代码来源:LSL_Api.cs

示例4: SetPrimitiveBlockShapeParams

        protected ObjectShapePacket.ObjectDataBlock SetPrimitiveBlockShapeParams(SceneObjectPart part, int holeshape, LSL_Vector cut, float hollow, LSL_Vector twist, byte profileshape, byte pathcurve)
        {
            float tempFloat;                                    // Use in float expressions below to avoid byte cast precision issues.
            ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock();

            if (holeshape != (int)ScriptBaseClass.PRIM_HOLE_DEFAULT &&
                holeshape != (int)ScriptBaseClass.PRIM_HOLE_CIRCLE &&
                holeshape != (int)ScriptBaseClass.PRIM_HOLE_SQUARE &&
                holeshape != (int)ScriptBaseClass.PRIM_HOLE_TRIANGLE)
            {
                holeshape = (int)ScriptBaseClass.PRIM_HOLE_DEFAULT;
            }
            shapeBlock.PathCurve = pathcurve;
            shapeBlock.ProfileCurve = (byte)holeshape;          // Set the hole shape.
            shapeBlock.ProfileCurve += profileshape;            // Add in the profile shape.
            if (cut.x < 0f)
            {
                cut.x = 0f;
            }
            if (cut.x > 1f)
            {
                cut.x = 1f;
            }
            if (cut.y < 0f)
            {
                cut.y = 0f;
            }
            if (cut.y > 1f)
            {
                cut.y = 1f;
            }
            if (cut.y - cut.x < 0.05f)
            {
                cut.x = cut.y - 0.05f;
                if (cut.x < 0.0f)
                {
                    cut.x = 0.0f;
                    cut.y = 0.05f;
                }
            }
            shapeBlock.ProfileBegin = (ushort)(50000 * cut.x);
            shapeBlock.ProfileEnd = (ushort)(50000 * (1 - cut.y));
            if (hollow < 0f)
            {
                hollow = 0f;
            }
            // If the prim is a Cylinder, Prism, Sphere, Torus or Ring (or not a
            // Box or Tube) and the hole shape is a square, hollow is limited to
            // a max of 70%. The viewer performs its own check on this value but
            // we need to do it here also so llGetPrimitiveParams can have access
            // to the correct value.
            if (profileshape != (byte)ProfileCurve.Square &&
                holeshape == (int)ScriptBaseClass.PRIM_HOLE_SQUARE)
            {
                if (hollow > 0.70f)
                {
                    hollow = 0.70f;
                }
            }
            // Otherwise, hollow is limited to 95%. 
            else
            {
                if (hollow > 0.95f)
                {
                    hollow = 0.95f;
                }
            }
            shapeBlock.ProfileHollow = (ushort)(50000 * hollow);
            if (twist.x < -1.0f)
            {
                twist.x = -1.0f;
            }
            if (twist.x > 1.0f)
            {
                twist.x = 1.0f;
            }
            if (twist.y < -1.0f)
            {
                twist.y = -1.0f;
            }
            if (twist.y > 1.0f)
            {
                twist.y = 1.0f;
            }
            // A fairly large precision error occurs for some calculations,
            // if a float or double is directly cast to a byte or sbyte
            // variable, in both .Net and Mono. In .Net, coding
            // "(sbyte)(float)(some expression)" corrects the precision
            // errors. But this does not work for Mono. This longer coding
            // form of creating a tempoary float variable from the
            // expression first, then casting that variable to a byte or
            // sbyte, works for both .Net and Mono. These types of
            // assignments occur in SetPrimtiveBlockShapeParams and
            // SetPrimitiveShapeParams in support of llSetPrimitiveParams.
            tempFloat = (float)(100.0d * twist.x);
            shapeBlock.PathTwistBegin = (sbyte)tempFloat;
            tempFloat = (float)(100.0d * twist.y);
            shapeBlock.PathTwist = (sbyte)tempFloat;

            shapeBlock.ObjectLocalID = part.LocalId;
//.........这里部分代码省略.........
开发者ID:OpenPlex-Sim,项目名称:opensim,代码行数:101,代码来源:LSL_Api.cs

示例5: SetPrimitiveSculpted

        void SetPrimitiveSculpted(UUID map, byte type)
        {
            ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock();

            ISceneChildEntity part = GetSOP();

            UUID sculptId = map;

            shapeBlock.ObjectLocalID = part.LocalId;
            shapeBlock.PathScaleX = 100;
            shapeBlock.PathScaleY = 150;

            // retain pathcurve
            shapeBlock.PathCurve = part.Shape.PathCurve;

            part.Shape.SetSculptProperties(type, sculptId);
            part.Shape.SculptEntry = true;
            part.UpdateShape(shapeBlock);
        }
开发者ID:Virtual-Universe,项目名称:Virtual-Universe,代码行数:19,代码来源:SOPObject.cs

示例6: UpdatePrimShape

        /// <summary>
        ///
        /// </summary>
        /// <param name="primLocalID"></param>
        /// <param name="shapeBlock"></param>
        protected internal void UpdatePrimShape(UUID agentID, uint primLocalID, UpdateShapeArgs shapeBlock)
        {
            SceneObjectGroup group = GetGroupByPrim(primLocalID);
            if (group != null)
            {
                if (m_parentScene.Permissions.CanEditObject(group.GetPartsFullID(primLocalID), agentID))
                {
                    ObjectShapePacket.ObjectDataBlock shapeData = new ObjectShapePacket.ObjectDataBlock();
                    shapeData.ObjectLocalID = shapeBlock.ObjectLocalID;
                    shapeData.PathBegin = shapeBlock.PathBegin;
                    shapeData.PathCurve = shapeBlock.PathCurve;
                    shapeData.PathEnd = shapeBlock.PathEnd;
                    shapeData.PathRadiusOffset = shapeBlock.PathRadiusOffset;
                    shapeData.PathRevolutions = shapeBlock.PathRevolutions;
                    shapeData.PathScaleX = shapeBlock.PathScaleX;
                    shapeData.PathScaleY = shapeBlock.PathScaleY;
                    shapeData.PathShearX = shapeBlock.PathShearX;
                    shapeData.PathShearY = shapeBlock.PathShearY;
                    shapeData.PathSkew = shapeBlock.PathSkew;
                    shapeData.PathTaperX = shapeBlock.PathTaperX;
                    shapeData.PathTaperY = shapeBlock.PathTaperY;
                    shapeData.PathTwist = shapeBlock.PathTwist;
                    shapeData.PathTwistBegin = shapeBlock.PathTwistBegin;
                    shapeData.ProfileBegin = shapeBlock.ProfileBegin;
                    shapeData.ProfileCurve = shapeBlock.ProfileCurve;
                    shapeData.ProfileEnd = shapeBlock.ProfileEnd;
                    shapeData.ProfileHollow = shapeBlock.ProfileHollow;

                    group.UpdateShape(shapeData, primLocalID);
                }
            }
        }
开发者ID:AlphaStaxLLC,项目名称:taiga,代码行数:37,代码来源:SceneGraph.cs

示例7: SetPrimitiveShapeParams

        protected void SetPrimitiveShapeParams (ISceneChildEntity part, string map, int type)
        {
            ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock();
            UUID sculptId;

            if (!UUID.TryParse(map, out sculptId))
            {
                sculptId = InventoryKey(map, (int)AssetType.Texture);
            }

            if (sculptId == UUID.Zero)
                return;

            shapeBlock.ObjectLocalID = part.LocalId;
            shapeBlock.PathScaleX = 100;
            shapeBlock.PathScaleY = 150;

            int onlytype = (type & 7);//Removes the sculpt flags according to libOMV
            if (onlytype != (int)ScriptBaseClass.PRIM_SCULPT_TYPE_CYLINDER &&
                onlytype != (int)ScriptBaseClass.PRIM_SCULPT_TYPE_PLANE &&
                onlytype != (int)ScriptBaseClass.PRIM_SCULPT_TYPE_SPHERE &&
                onlytype != (int)ScriptBaseClass.PRIM_SCULPT_TYPE_TORUS &&
                onlytype != (int)ScriptBaseClass.PRIM_SCULPT_TYPE_MESH)
            {
                // default
                type |= (int)ScriptBaseClass.PRIM_SCULPT_TYPE_SPHERE;
            }

            // retain pathcurve
            shapeBlock.PathCurve = part.Shape.PathCurve;
            part.Shape.SetSculptProperties((byte)type, sculptId);
            part.Shape.SculptEntry = true;
            part.UpdateShape(shapeBlock);
        }
开发者ID:kchi059,项目名称:Aurora-Sim,代码行数:34,代码来源:LSL_Api.cs

示例8: SetPrimitiveBlockShapeParams

        protected ObjectShapePacket.ObjectDataBlock SetPrimitiveBlockShapeParams(ISceneChildEntity part, int holeshape,
                                                                                 LSL_Vector cut, float hollow,
                                                                                 LSL_Vector twist)
        {
            ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock();

            if (holeshape != (int) ScriptBaseClass.PRIM_HOLE_DEFAULT &&
                holeshape != (int) ScriptBaseClass.PRIM_HOLE_CIRCLE &&
                holeshape != (int) ScriptBaseClass.PRIM_HOLE_SQUARE &&
                holeshape != (int) ScriptBaseClass.PRIM_HOLE_TRIANGLE)
            {
                holeshape = ScriptBaseClass.PRIM_HOLE_DEFAULT;
            }
            shapeBlock.ProfileCurve = (byte) holeshape;
            if (cut.x < 0f)
            {
                cut.x = 0f;
            }
            if (cut.x > 1f)
            {
                cut.x = 1f;
            }
            if (cut.y < 0f)
            {
                cut.y = 0f;
            }
            if (cut.y > 1f)
            {
                cut.y = 1f;
            }
            if (cut.y - cut.x < 0.05f)
            {
                cut.x = cut.y - 0.05f;
                if (cut.x < 0.0f)
                {
                    cut.x = 0.0f;
                    cut.y = 0.05f;
                }
            }
            shapeBlock.ProfileBegin = (ushort) (50000*cut.x);
            shapeBlock.ProfileEnd = (ushort) (50000*(1 - cut.y));
            if (hollow < 0f)
            {
                hollow = 0f;
            }
            if (hollow > 0.95)
            {
                hollow = 0.95f;
            }
            shapeBlock.ProfileHollow = (ushort) (50000*hollow);
            if (twist.x < -1.0f)
            {
                twist.x = -1.0f;
            }
            if (twist.x > 1.0f)
            {
                twist.x = 1.0f;
            }
            if (twist.y < -1.0f)
            {
                twist.y = -1.0f;
            }
            if (twist.y > 1.0f)
            {
                twist.y = 1.0f;
            }
            // A fairly large precision error occurs for some calculations,
            // if a float or double is directly cast to a byte or sbyte
            // variable, in both .Net and Mono. In .Net, coding
            // "(sbyte)(float)(some expression)" corrects the precision
            // errors. But this does not work for Mono. This longer coding
            // form of creating a tempoary float variable from the
            // expression first, then casting that variable to a byte or
            // sbyte, works for both .Net and Mono. These types of
            // assignments occur in SetPrimtiveBlockShapeParams and
            // SetPrimitiveShapeParams in support of llSetPrimitiveParams.
            float tempFloat = (float) (100.0d*twist.x);
            shapeBlock.PathTwistBegin = (sbyte) tempFloat;
            tempFloat = (float) (100.0d*twist.y);
            shapeBlock.PathTwist = (sbyte) tempFloat;

            shapeBlock.ObjectLocalID = part.LocalId;

            // retain pathcurve
            shapeBlock.PathCurve = part.Shape.PathCurve;

            part.Shape.SculptEntry = false;
            return shapeBlock;
        }
开发者ID:velus,项目名称:Async-Sim-Testing,代码行数:89,代码来源:LSL_Api.cs

示例9: SetPrimitiveShapeParams

        protected void SetPrimitiveShapeParams(ISceneChildEntity part, string map, int type)
        {
            ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock();
            UUID sculptId = KeyOrName(map, AssetType.Texture, true);

            if (sculptId == UUID.Zero)
                return;

            shapeBlock.ObjectLocalID = part.LocalId;
            shapeBlock.PathScaleX = 100;
            shapeBlock.PathScaleY = 150;

            int onlytype = (type & (ScriptBaseClass.PRIM_SCULPT_FLAG_INVERT | ScriptBaseClass.PRIM_SCULPT_FLAG_MIRROR));
                //Removes the sculpt flags according to libOMV
            if (onlytype != (int) ScriptBaseClass.PRIM_SCULPT_TYPE_CYLINDER &&
                onlytype != (int) ScriptBaseClass.PRIM_SCULPT_TYPE_PLANE &&
                onlytype != (int) ScriptBaseClass.PRIM_SCULPT_TYPE_SPHERE &&
                onlytype != (int) ScriptBaseClass.PRIM_SCULPT_TYPE_TORUS &&
                onlytype != (int) ScriptBaseClass.PRIM_SCULPT_TYPE_MESH)
            {
                // default
                type |= ScriptBaseClass.PRIM_SCULPT_TYPE_SPHERE;
            }

            // retain pathcurve
            shapeBlock.PathCurve = part.Shape.PathCurve;
            bool changedTextureID = part.Shape.SculptTexture != sculptId;
            part.Shape.SetSculptProperties((byte) type, sculptId);
            part.Shape.SculptEntry = true;
            part.UpdateShape(shapeBlock, changedTextureID);
        }
开发者ID:emperorstarfinder,项目名称:My-Aurora-Sim,代码行数:31,代码来源:LSL_Api.cs


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