Class VoxelVisibility
Namespace: ValveResourceFormat.Blocks
Assembly: ValveResourceFormat.dll
"VXVS" block.
public class VoxelVisibility : BlockInheritance
object ← Block ← VoxelVisibility
Inherited Members
Block.Type, Block.Offset, Block.Size, Block.Resource, Block.Read(BinaryReader), Block.ToString(), Block.WriteText(IndentedTextWriter), Block.Serialize(Stream)
Extension Methods
ResourceDataExtensions.AsKeyValueCollection(Block)
Properties
BaseClusterCount
Gets the number of visibility clusters.
public uint BaseClusterCount { get; }Property Value
EnclosedClusterList
Gets the enclosed cluster list entries.
public (int Offset, int Count)[] EnclosedClusterList { get; }Property Value
EnclosedClusters
Gets the enclosed cluster ids.
public ushort[] EnclosedClusters { get; }Property Value
ushort[]
GridSize
Gets the grid cell size.
public float GridSize { get; }Property Value
Masks
Gets the spatial occupancy masks.
public ulong[] Masks { get; }Property Value
ulong[]
MaxBounds
Gets the maximum bounds of the octree.
public Vector3 MaxBounds { get; }Property Value
MinBounds
Gets the minimum bounds of the octree.
public Vector3 MinBounds { get; }Property Value
Nodes
Gets the octree nodes.
public VoxelVisibility.Node[] Nodes { get; }Property Value
PVSBytesPerCluster
Gets the number of PVS bytes per cluster.
public uint PVSBytesPerCluster { get; }Property Value
Regions
Gets the region entries.
public VoxelVisibility.Region[] Regions { get; }Property Value
SkyVisibilityCluster
Gets the cluster index used for sky visibility.
public uint SkyVisibilityCluster { get; }Property Value
SunVisibilityCluster
Gets the cluster index used for sun visibility.
public uint SunVisibilityCluster { get; }Property Value
Type
Gets the block type.
public override BlockType Type { get; }Property Value
VisBlocks
Gets the raw PVS bit table.
public byte[] VisBlocks { get; }Property Value
byte[]
Methods
BuildClusterChildBounds()
Builds a list of bounding boxes for each cluster.
public Dictionary<ushort, List<(Vector3 Min, Vector3 Max)>> BuildClusterChildBounds()Returns
Dictionary<ushort, List<(Vector3 Min, Vector3 Max)>>
GetClusterForPosition(Vector3)
Gets the cluster id for a given world-space position.
public int GetClusterForPosition(Vector3 position)Parameters
position Vector3
Returns
GetPVSForPoint(Vector3)
Gets the PVS bitfield for the cluster(s) at the given point, or null if there is none.
public byte[]? GetPVSForPoint(Vector3 point)Parameters
point Vector3
Returns
byte[]?
Read(BinaryReader)
Reads the block data from a binary reader.
public override void Read(BinaryReader reader)Parameters
reader BinaryReader
The binary reader to read from.
Serialize(Stream)
Writes the binary representation of the object to Stream.
public override void Serialize(Stream stream)Parameters
stream Stream
Stream.
WriteText(IndentedTextWriter)
Writes the correct text dump of the object to IndentedTextWriter.
public override void WriteText(IndentedTextWriter writer)Parameters
writer IndentedTextWriter
IndentedTextWriter.
See Also
https://s2v.app/SchemaExplorer/cs2/worldrenderer/CVoxelVisibility

