private void StartJobs() { using (m_poolLock.AcquireSharedUsing()) { foreach (var pool in m_pools) { foreach (var model in pool.Value) { if (model.Value.Count < PREALLOCATE_COUNT && !m_tracker.Exists(pool.Key)) { MyPhysicalModelDefinition def; MyDefinitionManager.Static.TryGetDefinition <MyPhysicalModelDefinition>(pool.Key, out def); var modelData = VRage.Game.Models.MyModels.GetModelOnlyData(def.Model); if (modelData.HavokBreakableShapes == null) { continue; } MyBreakableShapeCloneJob.Args args = new MyBreakableShapeCloneJob.Args(); args.Model = model.Key; args.DefId = pool.Key; args.ShapeToClone = modelData.HavokBreakableShapes[0]; args.Count = PREALLOCATE_COUNT - pool.Value.Count; args.Tracker = m_tracker; MyBreakableShapeCloneJob.Start(args); } } } } }
private void StartJobs() { using (this.m_poolLock.AcquireSharedUsing()) { foreach (KeyValuePair <MyDefinitionId, Dictionary <string, ConcurrentQueue <HkdBreakableShape> > > pair in this.m_pools) { foreach (KeyValuePair <string, ConcurrentQueue <HkdBreakableShape> > pair2 in pair.Value) { if (pair2.Value.Count >= 50) { continue; } if (!this.m_tracker.Exists(pair.Key)) { MyPhysicalModelDefinition definition; MyDefinitionManager.Static.TryGetDefinition <MyPhysicalModelDefinition>(pair.Key, out definition); MyModel modelOnlyData = MyModels.GetModelOnlyData(definition.Model); if (modelOnlyData.HavokBreakableShapes != null) { MyBreakableShapeCloneJob.Args args = new MyBreakableShapeCloneJob.Args { Model = pair2.Key, DefId = pair.Key, ShapeToClone = modelOnlyData.HavokBreakableShapes[0], Count = 50 - pair.Value.Count, Tracker = this.m_tracker }; MyBreakableShapeCloneJob.Start(args); } } } } } }
private void StartJobs() { foreach (var pool in m_pools) { if (pool.Value.Count < PREALLOCATE_COUNT && !m_tracker.Exists(pool.Key)) { MyPhysicalModelDefinition def; MyDefinitionManager.Static.TryGetDefinition <MyPhysicalModelDefinition>(pool.Key, out def); MyBreakableShapeCloneJob.Args args = new MyBreakableShapeCloneJob.Args(); args.DefId = pool.Key; args.ShapeToClone = MyModels.GetModelOnlyData(def.Model).HavokBreakableShapes[0]; args.Count = PREALLOCATE_COUNT - pool.Value.Count; args.Tracker = m_tracker; MyBreakableShapeCloneJob.Start(args); } } }
private void StartJobs() { using (m_poolLock.AcquireSharedUsing()) { foreach (var pool in m_pools) { foreach (var model in pool.Value) { if (model.Value.Count < PREALLOCATE_COUNT && !m_tracker.Exists(pool.Key)) { MyPhysicalModelDefinition def; MyDefinitionManager.Static.TryGetDefinition<MyPhysicalModelDefinition>(pool.Key, out def); var modelData = VRage.Game.Models.MyModels.GetModelOnlyData(def.Model); if (modelData.HavokBreakableShapes == null) continue; MyBreakableShapeCloneJob.Args args = new MyBreakableShapeCloneJob.Args(); args.Model = model.Key; args.DefId = pool.Key; args.ShapeToClone = modelData.HavokBreakableShapes[0]; args.Count = PREALLOCATE_COUNT - pool.Value.Count; args.Tracker = m_tracker; MyBreakableShapeCloneJob.Start(args); } } } } }
private void StartJobs() { foreach (var pool in m_pools) { if (pool.Value.Count < PREALLOCATE_COUNT && !m_tracker.Exists(pool.Key)) { MyPhysicalModelDefinition def; MyDefinitionManager.Static.TryGetDefinition<MyPhysicalModelDefinition>(pool.Key, out def); MyBreakableShapeCloneJob.Args args = new MyBreakableShapeCloneJob.Args(); args.DefId = pool.Key; args.ShapeToClone = MyModels.GetModelOnlyData(def.Model).HavokBreakableShapes[0]; args.Count = PREALLOCATE_COUNT - pool.Value.Count; args.Tracker = m_tracker; MyBreakableShapeCloneJob.Start(args); } } }