Home Reference Source
import {VoxelCell} from 'rabbit-hole'
public class | source

VoxelCell

Extends:

sparse-octree~CubicOctant → VoxelCell

A voxel octant.

Static Member Summary

Static Public Members
public static get

An error threshold for QEF-based voxel clustering (mesh simplification).

public static set

The mesh simplification error threshold.

Constructor Summary

Public Constructor
public

constructor(min: Vector3, size: Number)

Constructs a new voxel octant.

Member Summary

Public Members
public
public

A voxel that contains draw information.

Method Summary

Public Methods
public

Attempts to simplify this cell.

public

contains(p: Vector3): Boolean

Checks if the given point lies inside this cell.

Static Public Members

public static get errorThreshold: Number source

An error threshold for QEF-based voxel clustering (mesh simplification).

public static set errorThreshold: Number source

The mesh simplification error threshold.

A bigger threshold allows more voxel cells to collapse which results in less vertices being created.

An error threshold of -1 disables the mesh simplification.

Public Constructors

public constructor(min: Vector3, size: Number) source

Constructs a new voxel octant.

Params:

NameTypeAttributeDescription
min Vector3
  • optional

The lower bounds of the octant.

size Number
  • optional

The size of the octant.

Public Members

public children: * source

public voxel: Voxel source

A voxel that contains draw information.

Public Methods

public collapse(): Number source

Attempts to simplify this cell.

Return:

Number

The amount of removed voxels.

public contains(p: Vector3): Boolean source

Checks if the given point lies inside this cell.

Params:

NameTypeAttributeDescription
p Vector3

A point.

Return:

Boolean

Whether the given point lies inside this cell.