Author Topic: Row/Height Filtering  (Read 82 times)

Divine

  • Newbie
  • *
  • Posts: 1
    • View Profile
Row/Height Filtering
« on: May 18, 2020, 09:01:38 PM »
Hello!

I'm looking for some advice. I'd like to filter out voxels by height. For example, take the Colorizer demo scene. If I specified Row 30, it would hide Row 31 (for all chunks). If I specified row 28, it would filter Rows 31-29. Do you have any advice on the best way to accomplish something like this?

I noticed that the Third Person Demo provides a way to filter out Voxels that would block the camera but I'm not sure where specifically to look for this capability.

Thanks!

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 5733
    • View Profile
Re: Row/Height Filtering
« Reply #1 on: May 21, 2020, 08:45:55 AM »
Hi,

You can use this method:
Code
public int GetVoxelIndices (Vector3 boxMin, Vector3 boxMax, List<VoxelIndex> indices, byte minOpaque = 0, int hasContents = 1)

To retrieve the indices (chunk and voxelindex) for a certain volume.
Then iterate the indices and use the method:
Code
public void VoxelSetHidden (List<VoxelIndex> indices, bool hidden, HideStyle hiddenStyle = HideStyle.DefinedByVoxelDefinition)

To hide/recover the list of voxels.

Regards