public FaceInfo(Coord _coord, Range1D _range, Direction _dir, ILightDataProvider _lightDataProvider) { coord = _coord; lightLevel = 0; // _range.top_light_level; direction = _dir; blockType = _range.blockType; // arg.. duplications... range = _range; lightDataProvider = _lightDataProvider; }
private void newFaceSetAtCoord(AlignedCoord coord, BlockType type, Direction dir, byte lightLevel, ILightDataProvider lightDataProvider) { //TODO: figure out what we should really to in this case. // maybe some kind of look up table re: which block type wins? int currentLookupIndex = indexOfFaceSetAtCoord(coord, dir); if (indexRepresentsAnOccupiedCoord(currentLookupIndex)) // { // remove // b.bug("represents an occupied coord: cur lookup index: " + currentLookupIndex + " direction: " + dir); FaceSet currentOccupantFaceSet = faceSets[currentLookupIndex]; currentOccupantFaceSet.removeFaceAtCoord(coord); // hang on to your hats! (no bugs please!) } // b.bug("adding a new face set at coord: " + coord.toString() ); int faceSetsCount = faceSets.Count; FaceSet fs = new FaceSet(type, dir, coord, lightLevel, lightDataProvider); faceSets.Add(fs); int nudge_lookup = ((int)dir % 2 == 0) ? 0 : 1; // pos dirs are 0, 2 and 4 faceSetTable[coord.across * 2 + nudge_lookup, coord.up] = faceSetsCount + FaceAggregator.FACETABLE_LOOKUP_SHIFT; }
public Range1D range; // new (oh no!) public FaceInfo(Coord _coord, byte _lightlev, Direction _dir, BlockType block_type, ILightDataProvider _lightDataProvider) { coord = _coord; lightLevel = _lightlev; direction = _dir; blockType = block_type; range = Range1D.theErsatzNullRange(); lightDataProvider = _lightDataProvider; }
public Chunk() { meshBuilder = new MeshBuilder(this); lightDataProvider = new LightDataProvider(this); }