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


C# ISceneChildEntity.UpdateShape方法代码示例

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


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

示例1: 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

示例2: 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

示例3: SetPrimitiveShapeParams

        protected void SetPrimitiveShapeParams (ISceneChildEntity part, int holeshape, LSL_Vector cut, float hollow, LSL_Vector twist, LSL_Vector taper_b, LSL_Vector topshear, byte fudge)
        {
            float tempFloat; // Use in float expressions below to avoid byte cast precision issues.
            ObjectShapePacket.ObjectDataBlock shapeBlock;

            shapeBlock = SetPrimitiveBlockShapeParams(part, holeshape, cut, hollow, twist);

            shapeBlock.ProfileCurve += fudge;

            if (taper_b.x < 0f)
            {
                taper_b.x = 0f;
            }
            if (taper_b.x > 2f)
            {
                taper_b.x = 2f;
            }
            if (taper_b.y < 0f)
            {
                taper_b.y = 0f;
            }
            if (taper_b.y > 2f)
            {
                taper_b.y = 2f;
            }
            tempFloat = (float)(100.0d * (2.0d - taper_b.x));
            shapeBlock.PathScaleX = (byte)tempFloat;
            tempFloat = (float)(100.0d * (2.0d - taper_b.y));
            shapeBlock.PathScaleY = (byte)tempFloat;
            if (topshear.x < -0.5f)
            {
                topshear.x = -0.5f;
            }
            if (topshear.x > 0.5f)
            {
                topshear.x = 0.5f;
            }
            if (topshear.y < -0.5f)
            {
                topshear.y = -0.5f;
            }
            if (topshear.y > 0.5f)
            {
                topshear.y = 0.5f;
            }
            tempFloat = (float)(100.0d * topshear.x);
            shapeBlock.PathShearX = (byte)tempFloat;
            tempFloat = (float)(100.0d * topshear.y);
            shapeBlock.PathShearY = (byte)tempFloat;

            part.Shape.SculptEntry = false;
            part.UpdateShape(shapeBlock);
        }
开发者ID:chazzmac,项目名称:Aurora-Sim,代码行数:53,代码来源:LSL_Api.cs


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