本文整理汇总了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);
}