internal void ExecuteSpawn() { lock (this) { if (m_removeQueued || !m_spawnQueued) { return; } if (VoxelMap == null) { var mat = MatrixD.CreateFromQuaternion(Rotation); mat.Translation = WorldPosition; var genSeed = WorldPosition.GetHashCode(); if (VoxelUtility.TryFindAsteroidSeed(ref genSeed, Size, SeedSpecs.ProhibitsOre, SeedSpecs.RequiresOre, 10) || !SeedSpecs.ExcludeInvalid) { VoxelMap = VoxelUtility.SpawnAsteroid(new MyPositionAndOrientation(mat), VoxelUtility.CreateProceduralAsteroidProvider(genSeed, Size)); VoxelMap.OnPhysicsChanged += MarkForSave; } } m_spawnQueued = false; m_removeQueued = false; } }