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(); }