public int GetVoxel(MiniPoint3 Coordinate) { if (RawBuffer == null) { return(Voxel); } return(RawBuffer[EncodeIndex(Coordinate.X - Origin.X, Coordinate.Y - Origin.Y, Coordinate.Z - Origin.Z)]); }
private int EncodeIndex(MiniPoint3 Coordinate) { var x = ((Coordinate.X - Origin.X) >> 3) & 0x1; var y = ((Coordinate.Y - Origin.Y) >> 3) & 0x1; var z = ((Coordinate.Z - Origin.Z) >> 3) & 0x1; return(Level2.EncodeIndex(x, y, z)); }
public int GetVoxel(MiniPoint3 Coordinate) { if (Children == null) { return(Voxel); } return(Children[EncodeIndex(Coordinate)].GetVoxel(Coordinate)); }
public void SetVoxel(MiniPoint3 Coordinate, int Voxel) { if (RawBuffer == null) { if (this.Voxel == Voxel) { return; } Subdivide(); } RawBuffer[EncodeIndex(Coordinate.X - Origin.X, Coordinate.Y - Origin.Y, Coordinate.Z - Origin.Z)] = Voxel; }
public void SetVoxel(MiniPoint3 Coordinate, int Voxel) { if (Children == null) { if (this.Voxel == Voxel) { return; } Subdivide(); } Children[EncodeIndex(Coordinate)].SetVoxel(Coordinate, Voxel); }
public Level4(MiniPoint3 Origin, int Voxel) { this.Origin = Origin; this.Voxel = Voxel; }
private int EncodeIndex(MiniPoint3 Coordinate) { return((Coordinate.Y >> 4) & 0x3); }
public Level2(MiniPoint3 Min, int Voxel) { Origin = Min; this.Voxel = Voxel; }