예제 #1
0
void ChunkVault::add_voxel(const glm::ivec3& indices, const Color& color)
{
	const auto chunkOrigin = convert_vault_indices_to_chunk_origin(indices);
	const auto chunkIndices = indices - chunkOrigin;
	const auto potentialChunkPair = _originToChunk.find(chunkOrigin); 

	auto chunk = potentialChunkPair == _originToChunk.end() ? add_empty_chunk(chunkOrigin) : potentialChunkPair->second;
	chunk->add_voxel(chunkIndices, color);
}
예제 #2
0
voxel * new_voxel (int ixyz, float pvalue, voxel * head_voxel)

{
  voxel * voxel_ptr = NULL;

  voxel_ptr = create_voxel ();

  voxel_ptr->ixyz      = ixyz;
  voxel_ptr->pvalue    = pvalue;

  head_voxel = add_voxel (voxel_ptr, head_voxel);

  return (head_voxel);
  
}
예제 #3
0
void ChunkVault::add_adjacent_voxel(const glm::ivec3& indices, AxiallyAligned::Voxel::Face face, const Color& color)
{
	const auto adjacentVoxelIndices = get_indices_of_adjacent_voxel(indices, face);
	add_voxel(adjacentVoxelIndices, color);
}