public Scene() { _collisionSystem = new CollisionSystemBrute(); _collisionSystem.CollisionDetected += OnCollisionDetected; _collisionSystem.Detect(true); _world = new World(_collisionSystem); }
void CreateWorld() { CollisionSystem collision = null; switch (settings.CollisionSystem.CollisionSystem) { case JSettings.CollisionSystemEnum.SAP: collision = new CollisionSystemSAP(); break; case JSettings.CollisionSystemEnum.PersistentSAP: collision = new CollisionSystemPersistentSAP(); break; case JSettings.CollisionSystemEnum.Brute: collision = new CollisionSystemBrute(); break; } collision.EnableSpeculativeContacts = settings.CollisionSystem.EnableSpeculativeContacts; World = new World(collision); World.SetInactivityThreshold(settings.InactivityThreshold.MinAngularVelocity, settings.InactivityThreshold.MinLinearVelocity, settings.InactivityThreshold.MinSleepingTime); World.AllowDeactivation = settings.World.AllowDeactivation; Multithread = settings.Multithread.Mode; ThreadManager.ThreadsPerProcessor = settings.Multithread.ThreadsPerProcessor; timestep = settings.World.Timestep; JRigidbody.LerpFactor = settings.Rigidbody.LerpFactor; }