/// <summary> /// Constructs a new demo. /// </summary> /// <param name="game">Game owning this demo.</param> public GeneralConvexPairStressDemo(DemosGame game) : base(game) { Space.Remove(vehicle.Vehicle); //Enable simplex caching. ConfigurationHelper.ApplySuperSpeedySettings(Space); for (int i = 0; i < 2000; i++) { EntityShape shape; switch (i % 3) { case 0: shape = new CylinderShape(0.5f + (float)random.NextDouble() * 1.5f, 0.5f + (float)random.NextDouble() * 1.5f); break; case 1: shape = new ConeShape(0.5f + (float)random.NextDouble() * 1.5f, 0.5f + (float)random.NextDouble() * 1.5f); break; default: shape = new CapsuleShape(0.5f + (float)random.NextDouble() * 1.5f, 0.5f + (float)random.NextDouble() * 1.5f); break; } var toAdd = new Entity(shape, 2); //toAdd.LocalInertiaTensorInverse = new BEPUutilities.Matrix3x3(); RandomizeEntityState(toAdd); Space.Add(toAdd); } Space.ForceUpdater.Gravity = new Vector3(); game.Camera.Position = new Vector3(0, 6, 15); }