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


C# BSScene.ProcessTaints方法代码示例

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


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

示例1: GeomHullConvexDecomp

    [TestCase(7, 2, 5f, 5f, 32, 0f)]    /* default hull parameters */
    public void GeomHullConvexDecomp( int maxDepthSplit,
                                        int maxDepthSplitForSimpleShapes,
                                        float concavityThresholdPercent,
                                        float volumeConservationThresholdPercent,
                                        int maxVertices,
                                        float maxSkinWidth)
    {
        // Setup the physics engine to use the C# version of convex decomp
        Dictionary<string, string> engineParams = new Dictionary<string, string>();
        engineParams.Add("MeshSculptedPrim", "true"); // ShouldMeshSculptedPrim
        engineParams.Add("ForceSimplePrimMeshing", "false"); // ShouldForceSimplePrimMeshing
        engineParams.Add("UseHullsForPhysicalObjects", "true"); // ShouldUseHullsForPhysicalObjects
        engineParams.Add("ShouldRemoveZeroWidthTriangles", "true");
        engineParams.Add("ShouldUseBulletHACD", "false");
        engineParams.Add("ShouldUseSingleConvexHullForPrims", "true");
        engineParams.Add("ShouldUseGImpactShapeForPrims", "false");
        engineParams.Add("ShouldUseAssetHulls", "true");

        engineParams.Add("CSHullMaxDepthSplit", maxDepthSplit.ToString());
        engineParams.Add("CSHullMaxDepthSplitForSimpleShapes", maxDepthSplitForSimpleShapes.ToString());
        engineParams.Add("CSHullConcavityThresholdPercent", concavityThresholdPercent.ToString());
        engineParams.Add("CSHullVolumeConservationThresholdPercent", volumeConservationThresholdPercent.ToString());
        engineParams.Add("CSHullMaxVertices", maxVertices.ToString());
        engineParams.Add("CSHullMaxSkinWidth", maxSkinWidth.ToString());

        PhysicsScene = BulletSimTestsUtil.CreateBasicPhysicsEngine(engineParams);

        PrimitiveBaseShape pbs;
        Vector3 pos;
        Vector3 size;
        Quaternion rot;
        bool isPhys;

        // Cylinder
        pbs = PrimitiveBaseShape.CreateCylinder();
        pos = new Vector3(100.0f, 100.0f, 0f);
        pos.Z = PhysicsScene.TerrainManager.GetTerrainHeightAtXYZ(pos) + 10f;
        ObjectInitPosition = pos;
        size = new Vector3(2f, 2f, 2f);
        pbs.Scale = size;
        rot = Quaternion.Identity;
        isPhys = true;
        uint cylinderLocalID = 123;
        PhysicsScene.AddPrimShape("testCylinder", pbs, pos, size, rot, isPhys, cylinderLocalID);
        BSPrim primTypeCylinder = (BSPrim)PhysicsScene.PhysObjects[cylinderLocalID];

        // Hollow Cylinder
        pbs = PrimitiveBaseShape.CreateCylinder();
        pbs.ProfileHollow = (ushort)(0.70f * 50000);
        pos = new Vector3(110.0f, 110.0f, 0f);
        pos.Z = PhysicsScene.TerrainManager.GetTerrainHeightAtXYZ(pos) + 10f;
        ObjectInitPosition = pos;
        size = new Vector3(2f, 2f, 2f);
        pbs.Scale = size;
        rot = Quaternion.Identity;
        isPhys = true;
        uint hollowCylinderLocalID = 124;
        PhysicsScene.AddPrimShape("testHollowCylinder", pbs, pos, size, rot, isPhys, hollowCylinderLocalID);
        BSPrim primTypeHollowCylinder = (BSPrim)PhysicsScene.PhysObjects[hollowCylinderLocalID];

        // Torus
        // ProfileCurve = Circle, PathCurve = Curve1
        pbs = PrimitiveBaseShape.CreateSphere();
        pbs.ProfileShape = (byte)ProfileShape.Circle;
        pbs.PathCurve = (byte)Extrusion.Curve1;
        pbs.PathScaleX = 100;   // default hollow info as set in the viewer
        pbs.PathScaleY = (int)(.25f / 0.01f) + 200;
        pos = new Vector3(120.0f, 120.0f, 0f);
        pos.Z = PhysicsScene.TerrainManager.GetTerrainHeightAtXYZ(pos) + 10f;
        ObjectInitPosition = pos;
        size = new Vector3(2f, 4f, 4f);
        pbs.Scale = size;
        rot = Quaternion.Identity;
        isPhys = true;
        uint torusLocalID = 125;
        PhysicsScene.AddPrimShape("testTorus", pbs, pos, size, rot, isPhys, torusLocalID);
        BSPrim primTypeTorus = (BSPrim)PhysicsScene.PhysObjects[torusLocalID];
        
        // The actual prim shape creation happens at taint time
        PhysicsScene.ProcessTaints();

        // Check out the created hull shapes and report their characteristics
        ReportShapeGeom(primTypeCylinder);
        ReportShapeGeom(primTypeHollowCylinder);
        ReportShapeGeom(primTypeTorus);
    }
开发者ID:Kubwa,项目名称:opensim,代码行数:87,代码来源:HullCreation.cs


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