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