本文整理汇总了C#中BulletXNA.BulletCollision.CollisionObject.SetCollisionShape方法的典型用法代码示例。如果您正苦于以下问题:C# CollisionObject.SetCollisionShape方法的具体用法?C# CollisionObject.SetCollisionShape怎么用?C# CollisionObject.SetCollisionShape使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BulletXNA.BulletCollision.CollisionObject
的用法示例。
在下文中一共展示了CollisionObject.SetCollisionShape方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitializeDemo
public override void InitializeDemo()
{
// Setup the basic world
SetTexturing(true);
SetShadows(true);
SetCameraDistance(5.0f);
m_collisionConfiguration = new DefaultCollisionConfiguration();
m_dispatcher = new CollisionDispatcher(m_collisionConfiguration);
IndexedVector3 worldAabbMin = new IndexedVector3(-10000,-10000,-10000);
IndexedVector3 worldAabbMax = new IndexedVector3(10000,10000,10000);
//m_broadphase = new AxisSweep3Internal(ref worldAabbMin, ref worldAabbMax, 0xfffe, 0xffff, 16384, null, true);
m_broadphase = new SimpleBroadphase(1000, null);
m_constraintSolver = new SequentialImpulseConstraintSolver();
m_dynamicsWorld = new DiscreteDynamicsWorld(m_dispatcher, m_broadphase, m_constraintSolver, m_collisionConfiguration);
//m_dynamicsWorld.getDispatchInfo().m_useConvexConservativeDistanceUtil = true;
//m_dynamicsWorld.getDispatchInfo().m_convexConservativeDistanceThreshold = 0.01f;
// Setup a big ground box
{
CollisionShape groundShape = new BoxShape(new IndexedVector3(200.0f,10.0f,200.0f));
m_collisionShapes.Add(groundShape);
IndexedMatrix groundTransform = IndexedMatrix.CreateTranslation(0,-10,0);
CollisionObject fixedGround = new CollisionObject();
fixedGround.SetCollisionShape(groundShape);
fixedGround.SetWorldTransform(ref groundTransform);
fixedGround.SetUserPointer("Ground");
m_dynamicsWorld.AddCollisionObject(fixedGround);
}
// Spawn one ragdoll
IndexedVector3 startOffset = new IndexedVector3(1,0.5f,0);
//string filename = @"c:\users\man\bullet\xna-ragdoll-constraints-output.txt";
//FileStream filestream = File.Open(filename, FileMode.Create, FileAccess.Write, FileShare.Read);
//BulletGlobals.g_streamWriter = new StreamWriter(filestream);
SpawnRagdoll(ref startOffset, BulletGlobals.g_streamWriter);
//startOffset = new IndexedVector3(-1,0.5f,0);
//spawnRagdoll(ref startOffset);
ClientResetScene();
}