VoxelCell
A cell from a VoxelPrimitive.
Provides access to properties associated with one cell of a voxel primitive.
Do not construct this directly. Access it through picking using Scene.pickVoxel.
// On left click, display all the properties for a voxel cell in the console log.
handler.setInputAction(function(movement) {
const voxelCell = scene.pickVoxel(movement.position);
if (voxelCell instanceof VoxelCell) {
const propertyIds = voxelCell.getPropertyIds();
const length = propertyIds.length;
for (let i = 0; i < length; ++i) {
const propertyId = propertyIds[i];
console.log(`{propertyId}: ${voxelCell.getProperty(propertyId)}`);
}
}
}, ScreenSpaceEventType.LEFT_CLICK);
Content copied to clipboard
Parameters
primitive
The voxel primitive containing the cell
tileIndex
The index of the tile
sampleIndex
The index of the sample within the tile, containing metadata for this cell
See also
Properties
Link copied to clipboard
Get a copy of the oriented bounding box containing the cell.
Link copied to clipboard
All objects returned by Scene.pick have a primitive
property. This returns the VoxelPrimitive containing the cell.
Link copied to clipboard
Get the sample index of the cell.