Skip to main content

Class: VoxelSpace

Math/Spaces/VoxelSpace.VoxelSpace

Constructors

constructor

new VoxelSpace(data): VoxelSpace

Parameters

NameType
dataObject
data.getIndex(space: VoxelSpace) => number
data.getPosition(space: VoxelSpace) => VSVec3
data.getPostionFromIndex(space: VoxelSpace, index: number) => VSVec3

Returns

VoxelSpace

Defined in

divinevoxel/core/src/Math/Spaces/VoxelSpace.ts:102

Properties

_bounds

_bounds: VSVec3

Defined in

divinevoxel/core/src/Math/Spaces/VoxelSpace.ts:98


_boundsPower2

_boundsPower2: VSVec3

Defined in

divinevoxel/core/src/Math/Spaces/VoxelSpace.ts:99


_boundsSet

_boundsSet: boolean = false

Defined in

divinevoxel/core/src/Math/Spaces/VoxelSpace.ts:100


_hashedPosition

_hashedPosition: VSVec3

Defined in

divinevoxel/core/src/Math/Spaces/VoxelSpace.ts:97


_location

_location: LocationData

Defined in

divinevoxel/core/src/Math/Spaces/VoxelSpace.ts:95


_position

_position: VSVec3

Defined in

divinevoxel/core/src/Math/Spaces/VoxelSpace.ts:96


data

data: Object

Type declaration

NameType
getIndex(space: VoxelSpace) => number
getPosition(space: VoxelSpace) => VSVec3
getPostionFromIndex(space: VoxelSpace, index: number) => VSVec3

Defined in

divinevoxel/core/src/Math/Spaces/VoxelSpace.ts:103


WholeVec3

Static WholeVec3: VSVec3

Defined in

divinevoxel/core/src/Math/Spaces/VoxelSpace.ts:72


index

Static index: Flat3DIndex

Defined in

divinevoxel/core/src/Math/Spaces/VoxelSpace.ts:36

Methods

getArea

getArea(): number

Returns

number

Defined in

divinevoxel/core/src/Math/Spaces/VoxelSpace.ts:114


getDepth

getDepth(): number

Returns

number

Defined in

divinevoxel/core/src/Math/Spaces/VoxelSpace.ts:126


getHeight

getHeight(): number

Returns

number

Defined in

divinevoxel/core/src/Math/Spaces/VoxelSpace.ts:118


getIndex

getIndex(): number

Returns

number

Defined in

divinevoxel/core/src/Math/Spaces/VoxelSpace.ts:205


getIndexLocation

getIndexLocation(location): number

Parameters

NameType
locationLocationData

Returns

number

Defined in

divinevoxel/core/src/Math/Spaces/VoxelSpace.ts:217


getIndexToXYZ

getIndexToXYZ(index): VSVec3

Parameters

NameType
indexnumber

Returns

VSVec3

Defined in

divinevoxel/core/src/Math/Spaces/VoxelSpace.ts:213


getIndexXYZ

getIndexXYZ(x, y, z): number

Parameters

NameType
xnumber
ynumber
znumber

Returns

number

Defined in

divinevoxel/core/src/Math/Spaces/VoxelSpace.ts:209


getKey

getKey(): string

Returns

string

Defined in

divinevoxel/core/src/Math/Spaces/VoxelSpace.ts:225


getKeyLocation

getKeyLocation(location): string

Parameters

NameType
locationLocationData

Returns

string

Defined in

divinevoxel/core/src/Math/Spaces/VoxelSpace.ts:233


getKeyXYZ

getKeyXYZ(x, y, z): string

Parameters

NameType
xnumber
ynumber
znumber

Returns

string

Defined in

divinevoxel/core/src/Math/Spaces/VoxelSpace.ts:229


getLocation

getLocation(): LocationData

Returns

LocationData

Defined in

divinevoxel/core/src/Math/Spaces/VoxelSpace.ts:147


getLocationXYZ

getLocationXYZ(x, y, z): LocationData

Parameters

NameType
xnumber
ynumber
znumber

Returns

LocationData

Defined in

divinevoxel/core/src/Math/Spaces/VoxelSpace.ts:153


getPosition

getPosition(): VSVec3

Returns

VSVec3

Defined in

divinevoxel/core/src/Math/Spaces/VoxelSpace.ts:193


getPositionFromIndex

getPositionFromIndex(index): VSVec3

Parameters

NameType
indexnumber

Returns

VSVec3

Defined in

divinevoxel/core/src/Math/Spaces/VoxelSpace.ts:221


getPositionLocation

getPositionLocation(location): VSVec3

Parameters

NameType
locationLocationData

Returns

VSVec3

Defined in

divinevoxel/core/src/Math/Spaces/VoxelSpace.ts:201


getPositionXYZ

getPositionXYZ(x, y, z): VSVec3

Parameters

NameType
xnumber
ynumber
znumber

Returns

VSVec3

Defined in

divinevoxel/core/src/Math/Spaces/VoxelSpace.ts:197


getVolume

getVolume(): number

Returns

number

Defined in

divinevoxel/core/src/Math/Spaces/VoxelSpace.ts:110


getWidth

getWidth(): number

Returns

number

Defined in

divinevoxel/core/src/Math/Spaces/VoxelSpace.ts:122


setBounds

setBounds(bounds): undefined | VoxelSpace

Parameters

NameType
boundsVector3

Returns

undefined | VoxelSpace

Defined in

divinevoxel/core/src/Math/Spaces/VoxelSpace.ts:184


setCubeBounds

setCubeBounds(bounds): undefined | VoxelSpace

Parameters

NameType
boundsVector3

Returns

undefined | VoxelSpace

Defined in

divinevoxel/core/src/Math/Spaces/VoxelSpace.ts:172


setLocation

setLocation(location): VoxelSpace

Parameters

NameType
locationLocationData

Returns

VoxelSpace

Defined in

divinevoxel/core/src/Math/Spaces/VoxelSpace.ts:159


setXYZ

setXYZ(x, y, z): VoxelSpace

Parameters

NameType
xnumber
ynumber
znumber

Returns

VoxelSpace

Defined in

divinevoxel/core/src/Math/Spaces/VoxelSpace.ts:130


setXZ

setXZ(x, z): VoxelSpace

Parameters

NameType
xnumber
znumber

Returns

VoxelSpace

Defined in

divinevoxel/core/src/Math/Spaces/VoxelSpace.ts:139


updateLoaction

updateLoaction(location): VoxelSpace

Parameters

NameType
locationLocationData

Returns

VoxelSpace

Defined in

divinevoxel/core/src/Math/Spaces/VoxelSpace.ts:164


getIndex

getIndex(position, bounds): number

Parameters

NameType
positionVector3
boundsVector3

Returns

number

Defined in

divinevoxel/core/src/Math/Spaces/VoxelSpace.ts:67


getPositionFromIndex

getPositionFromIndex(position, bounds, index): VSVec3

Parameters

NameType
positionVSVec3
boundsVector3 | VSVec3
indexnumber

Returns

VSVec3

Defined in

divinevoxel/core/src/Math/Spaces/VoxelSpace.ts:53


mapLocationToVec3

mapLocationToVec3(location, vector): void

Parameters

NameType
locationLocationData
vectorVector3

Returns

void

Defined in

divinevoxel/core/src/Math/Spaces/VoxelSpace.ts:89


simpleCubeHash

simpleCubeHash(space): VSVec3

Parameters

NameType
spaceVoxelSpace

Returns

VSVec3

Defined in

divinevoxel/core/src/Math/Spaces/VoxelSpace.ts:37


spatialHash

spatialHash(space, parentSpace, divisor?): VSVec3

Parameters

NameTypeDefault value
spaceVoxelSpaceundefined
parentSpaceVoxelSpaceundefined
divisorVector3VoxelSpace.WholeVec3

Returns

VSVec3

Defined in

divinevoxel/core/src/Math/Spaces/VoxelSpace.ts:73