/// <summary> /// Construct a world object. /// </summary> /// <param name="gravity">the world gravity vector.</param> /// <param name="doSleep">improve performance by not simulating inactive bodies.</param> public World(Vec2 gravity, IWorldPool argPool) { contactStacks = new ContactRegister[ShapeTypesCount][]; for (int i = 0; i < ShapeTypesCount; i++) { contactStacks[i] = new ContactRegister[ShapeTypesCount]; } pool = argPool; m_destructionListener = null; m_debugDraw = null; m_bodyList = null; m_jointList = null; m_bodyCount = 0; m_jointCount = 0; m_warmStarting = true; m_continuousPhysics = true; m_subStepping = false; m_stepComplete = true; m_allowSleep = true; m_gravity.set_Renamed(gravity); m_flags = CLEAR_FORCES; m_inv_dt0 = 0f; m_contactManager = new ContactManager(this); m_profile = new Profile(); initializeRegisters(); }
/// <summary> /// Construct a world object. /// </summary> /// <param name="gravity">the world gravity vector.</param> /// <param name="argPool"> </param> public World(Vec2 gravity, IWorldPool argPool) { contactStacks = new ContactRegister[ShapeTypesCount][]; for (int i = 0; i < ShapeTypesCount; i++) { contactStacks[i] = new ContactRegister[ShapeTypesCount]; } Pool = argPool; DestructionListener = null; DebugDraw = null; BodyList = null; JointList = null; BodyCount = 0; JointCount = 0; WarmStarting = true; ContinuousPhysics = true; m_subStepping = false; m_stepComplete = true; SleepingAllowed = true; m_gravity.Set(gravity); Flags = CLEAR_FORCES; invDt0 = 0f; ContactManager = new ContactManager(this); Profile = new Profile(); InitializeRegisters(); }